summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2003-03-23 08:41:05 +0000
committerVolker Lendecke <vlendec@samba.org>2003-03-23 08:41:05 +0000
commit42ba08260a5677ff2ab2e7ef666b74e25e458b2b (patch)
tree4015ed5be108ea0f7931f269cbd54a4b39fae520
parent0e55d8d6e5d49f61cd6c27c0697bde3a76d7eee5 (diff)
downloadsamba-42ba08260a5677ff2ab2e7ef666b74e25e458b2b.tar.gz
samba-42ba08260a5677ff2ab2e7ef666b74e25e458b2b.tar.bz2
samba-42ba08260a5677ff2ab2e7ef666b74e25e458b2b.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 7ae9c2500e3ac5f671d41077327156f1f3767fff)
-rw-r--r--source3/passdb/pdb_ldap.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index f02812be46..f00abe7cab 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -2110,7 +2110,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 };
@@ -2156,7 +2156,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)) {
@@ -2182,6 +2182,11 @@ static BOOL init_group_from_ldap(struct ldapsam_privates *ldap_state,
temp)) {
DEBUG(3, ("Attribute displayName not found\n"));
temp[0] = '\0';
+ if (!get_single_attribute(ldap_state->ldap_struct, entry, "cn",
+ temp)) {
+ DEBUG(0, ("Attributes displayName and cn not found for gidNumber(%i)\n",map->gid));
+ return False;
+ }
}
fstrcpy(map->nt_name, temp);
@@ -2301,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);
}