On Thu, 18 Oct 2001, Fernando Costa de Almeida wrote:
> There is no variable basedn defined in the scope.. the compiling process
> shows a error... Sorry to insist in this subject, but I need to do this work
> and Im in a hurry.... I have no time to try to understand the entire code
> and make the changes myself...
>
> Thanks!
Here is a working patch. Nevertheless, you should stick with the main source
tree and not with my patch.
--
kkalev
--- src/modules/rlm_ldap/rlm_ldap.orig Tue Aug 28 23:01:48 2001
+++ src/modules/rlm_ldap/rlm_ldap.c Tue Oct 16 10:55:07 2001
@@ -334,6 +334,7 @@
char *user_dn = NULL;
char *attrs[] = {"*", NULL};
static char filter[MAX_AUTH_QUERY_LEN];
+ static char base_dn[MAX_AUTH_QUERY_LEN];
static char filt_patt[] = "(| (& (objectClass=GroupOfNames)
(member=%{Ldap-UserDn})) (& (objectClass=GroupOfUniqueNames)
(uniquemember=%{Ldap-UserDn})))";
VALUE_PAIR *check_tmp;
VALUE_PAIR *reply_tmp;
@@ -365,8 +366,11 @@
if(!radius_xlat(filter, MAX_AUTH_QUERY_LEN, inst->filter,
request, NULL))
radlog (L_ERR, "rlm_ldap: unable to create filter.\n");
+ if (!radius_xlat(base_dn, MAX_AUTH_QUERY_LEN, inst->basedn,
+ request, NULL))
+ radlog (L_ERR, "rlm_ldap: unable to create base dn.\n");
- if ((res = perform_search(instance, inst->basedn, LDAP_SCOPE_SUBTREE, filter,
attrs, &result)) != RLM_MODULE_OK) {
+ if ((res = perform_search(instance, base_dn, LDAP_SCOPE_SUBTREE, filter,
+attrs, &result)) != RLM_MODULE_OK) {
DEBUG("rlm_ldap: search failed");
return (res);
}
@@ -524,6 +528,7 @@
ldap_instance *inst = instance;
char *user_dn, *attrs[] = {"uid", NULL};
static char filter[MAX_AUTH_QUERY_LEN];
+ static char base_dn[MAX_AUTH_QUERY_LEN];
int res;
VALUE_PAIR *vp_user_dn;
@@ -557,9 +562,12 @@
if(!radius_xlat(filter, MAX_AUTH_QUERY_LEN, inst->filter,
request, NULL))
radlog (L_ERR, "rlm_ldap: unable to create filter.\n");
+ if (!radius_xlat(base_dn, MAX_AUTH_QUERY_LEN, inst->basedn,
+ request, NULL))
+ radlog (L_ERR, "rlm_ldap: unable to create base dn.\n");
while((vp_user_dn = pairfind(request->packet->vps, LDAP_USERDN)) == NULL) {
- if ((res = perform_search(instance, inst->basedn, LDAP_SCOPE_SUBTREE,
filter, attrs, &result)) != RLM_MODULE_OK) {
+ if ((res = perform_search(instance, base_dn, LDAP_SCOPE_SUBTREE,
+filter, attrs, &result)) != RLM_MODULE_OK) {
return (res);
}
if ((msg = ldap_first_entry(inst->ld, result)) == NULL) {