]>
Commit | Line | Data |
---|---|---|
3d551623 PG |
1 | diff --git a/CHANGELOG b/CHANGELOG |
2 | index 1c147c5..74d39fd 100644 | |
3 | --- a/CHANGELOG | |
4 | +++ b/CHANGELOG | |
5 | @@ -41,6 +41,7 @@ | |
6 | - fix handling of LDAP base dns with spaces. | |
7 | - handle MTAB_NOTUPDATED status return from mount. | |
8 | - when default master map, auto.master, is used also check for auto_master. | |
9 | +- fix schema selection in LDAP schema discovery. | |
10 | ||
11 | 18/06/2007 autofs-5.0.2 | |
12 | ----------------------- | |
13 | diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c | |
14 | index dfb3054..8719af9 100644 | |
15 | --- a/modules/lookup_ldap.c | |
16 | +++ b/modules/lookup_ldap.c | |
17 | @@ -193,10 +193,11 @@ static int get_query_dn(unsigned logopt, LDAP *ldap, struct lookup_context *ctxt | |
18 | LDAPMessage *result = NULL, *e; | |
19 | struct ldap_searchdn *sdns = NULL; | |
20 | char *attrs[2]; | |
21 | + struct berval **value; | |
22 | int scope; | |
23 | int rv, l; | |
24 | ||
25 | - attrs[0] = LDAP_NO_ATTRS; | |
26 | + attrs[0] = (char *) key; | |
27 | attrs[1] = NULL; | |
28 | ||
29 | if (!ctxt->mapname && !ctxt->base) { | |
30 | @@ -283,7 +284,8 @@ static int get_query_dn(unsigned logopt, LDAP *ldap, struct lookup_context *ctxt | |
31 | } | |
32 | ||
33 | e = ldap_first_entry(ldap, result); | |
34 | - if (e) { | |
35 | + if (e && (value = ldap_get_values_len(ldap, e, key))) { | |
36 | + ldap_value_free_len(value); | |
37 | dn = ldap_get_dn(ldap, e); | |
38 | debug(logopt, MODPREFIX "found query dn %s", dn); | |
39 | } else { |