diff options
author | Volker Lendecke <vlendec@samba.org> | 2003-03-23 08:40:28 +0000 |
---|---|---|
committer | Volker Lendecke <vlendec@samba.org> | 2003-03-23 08:40:28 +0000 |
commit | 8a55edea4d87082282af815f09e229651757b560 (patch) | |
tree | b09004e3b25b06de33004cbbdfc5e32bab6a8fe0 | |
parent | a8394385e6a9a5d1ab171c2f40c195fcbf57769a (diff) | |
download | samba-8a55edea4d87082282af815f09e229651757b560.tar.gz samba-8a55edea4d87082282af815f09e229651757b560.tar.bz2 samba-8a55edea4d87082282af815f09e229651757b560.zip |
Metzes change:
> Hi Volker,
>
> if 'displayName' is not available we should fallback to 'cn' for map->nt_name
> 'cn' is used as unix group name by nss_ldap.
>
> and if nt_name is not available we should fail (so does this patch)
Volker
(This used to be commit 3a7d1e72e208b9609da4ff65d9fff9179799ecac)
-rw-r--r-- | source3/passdb/pdb_ldap.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c index 9eab2863da..f137d27cff 100644 --- a/source3/passdb/pdb_ldap.c +++ b/source3/passdb/pdb_ldap.c @@ -2109,7 +2109,7 @@ static void free_private_data(void **vp) /* No need to free any further, as it is talloc()ed */ } -static const char *group_attr[] = {"gid", "ntSid", "ntGroupType", +static const char *group_attr[] = {"cn", "ntSid", "ntGroupType", "gidNumber", "displayName", "description", NULL }; @@ -2155,7 +2155,7 @@ static BOOL init_group_from_ldap(struct ldapsam_privates *ldap_state, } DEBUG(2, ("Entry found for group: %s\n", temp)); - map->gid = (uint32)atol(temp); + map->gid = (gid_t)atol(temp); if (!get_single_attribute(ldap_state->ldap_struct, entry, "ntSid", temp)) { @@ -2188,6 +2188,12 @@ static BOOL init_group_from_ldap(struct ldapsam_privates *ldap_state, temp)) { DEBUG(3, ("Attribute description not found\n")); temp[0] = '\0'; + if (!get_single_attribute(ldap_state->ldap_struct, entry, "cn", + temp)) { + DEBUG(0, ("Attributes cn not found either " + "for gidNumber(%i)\n",map->gid)); + return False; + } } fstrcpy(map->comment, temp); @@ -2300,8 +2306,8 @@ static NTSTATUS ldapsam_getgrnam(struct pdb_methods *methods, GROUP_MAP *map, /* TODO: Escaping of name? */ snprintf(filter, sizeof(filter)-1, - "(&(objectClass=sambaGroupMapping)(displayName=%s))", - name); + "(&(objectClass=sambaGroupMapping)(|(displayName=%s)(cn=%s)))", + name, name); return ldapsam_getgroup(methods, filter, map); } |