summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-08-26 19:15:19 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:03:24 -0500
commitf44e11c100751f2202be9052503bd891c626e6ed (patch)
treec4729dd9a2ba49a5e45218f76a381032fb3e8cb2 /source3
parentbe0f3f159f6c210cc3f9c6054dc7e1d079f2c611 (diff)
downloadsamba-f44e11c100751f2202be9052503bd891c626e6ed.tar.gz
samba-f44e11c100751f2202be9052503bd891c626e6ed.tar.bz2
samba-f44e11c100751f2202be9052503bd891c626e6ed.zip
r9661: fallback to cn attribubte if displayName is not available
(This used to be commit b1524999e0b4fc99d213fc6e56182a8fa8e88ef1)
Diffstat (limited to 'source3')
-rw-r--r--source3/passdb/pdb_ldap.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index 17ff053783..99f6670653 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -3692,24 +3692,24 @@ static BOOL ldapgroup2displayentry(struct ldap_search_state *state,
return False;
}
- /* verify that the 'cn' attribute exists */
-
- vals = ldap_get_values(ld, entry, "cn");
- if ((vals == NULL) || (vals[0] == NULL)) {
- DEBUG(5, ("\"cn\" not found\n"));
- return False;
- }
- ldap_value_free(vals);
-
/* display name is the NT group name */
vals = ldap_get_values(ld, entry, "displayName");
- if ((vals == NULL) || (vals[0] == NULL))
+ if ((vals == NULL) || (vals[0] == NULL)) {
DEBUG(8, ("\"displayName\" not found\n"));
- else
- pull_utf8_talloc(mem_ctx,
- CONST_DISCARD(char **, &result->account_name),
- vals[0]);
+
+ /* fallback to the 'cn' attribute */
+ vals = ldap_get_values(ld, entry, "cn");
+ if ((vals == NULL) || (vals[0] == NULL)) {
+ DEBUG(5, ("\"cn\" not found\n"));
+ return False;
+ }
+ pull_utf8_talloc(mem_ctx, CONST_DISCARD(char **, &result->account_name), vals[0]);
+ }
+ else {
+ pull_utf8_talloc(mem_ctx, CONST_DISCARD(char **, &result->account_name), vals[0]);
+ }
+
ldap_value_free(vals);
vals = ldap_get_values(ld, entry, "description");