summaryrefslogtreecommitdiff
path: root/source3/smbd/groupname.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-10-13 01:59:14 +0000
committerJeremy Allison <jra@samba.org>2000-10-13 01:59:14 +0000
commit330d678fbad70fabd9712c56ad15bd215f950255 (patch)
treedf834b65049fb3c675119cf6acfefa167cb96376 /source3/smbd/groupname.c
parenta7f8d8b6362f4c2970fee63130963734528bcb6e (diff)
downloadsamba-330d678fbad70fabd9712c56ad15bd215f950255.tar.gz
samba-330d678fbad70fabd9712c56ad15bd215f950255.tar.bz2
samba-330d678fbad70fabd9712c56ad15bd215f950255.zip
Fix to allow smbd to call winbindd if it is running for all group enumeration,
falling back to the UNIX calls on error. This should fix all problems with smbd enumerating all users in all groups in all trusted domains via winbindd. Also changed GETDC to query 1C name rather than 1b name as only the PDC registers 1b. Jeremy. (This used to be commit 5b0038a2afd8abbd6fd4a58f5477a40d1926d498)
Diffstat (limited to 'source3/smbd/groupname.c')
-rw-r--r--source3/smbd/groupname.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source3/smbd/groupname.c b/source3/smbd/groupname.c
index f0b11e1b36..d53fa56a44 100644
--- a/source3/smbd/groupname.c
+++ b/source3/smbd/groupname.c
@@ -119,7 +119,7 @@ void load_groupname_map(void)
for (i=0; lines[i]; i++) {
pstring unixname;
pstring windows_name;
- struct group *gptr;
+ gid_t gid;
DOM_SID tmp_sid;
char *s = lines[i];
@@ -150,8 +150,8 @@ void load_groupname_map(void)
* Attempt to get the unix gid_t for this name.
*/
- if((gptr = (struct group *)getgrnam(unixname)) == NULL) {
- DEBUG(0,("load_groupname_map: getgrnam for group %s failed.\
+ if ((gid = nametogid(unixname)) == (gid_t)-1)
+ DEBUG(0,("load_groupname_map: nametogid for group %s failed.\
Error was %s.\n", unixname, strerror(errno) ));
continue;
}
@@ -167,7 +167,7 @@ Error was %s.\n", unixname, strerror(errno) ));
*/
tmp_sid = global_sam_sid;
tmp_sid.sub_auths[tmp_sid.num_auths++] =
- pdb_gid_to_group_rid((gid_t)gptr->gr_gid);
+ pdb_gid_to_group_rid(gid);
}
/*
@@ -180,7 +180,7 @@ Error was %s.\n", unixname, strerror(errno) ));
return;
}
- new_ep->unix_gid = gptr->gr_gid;
+ new_ep->unix_gid = gid;
new_ep->windows_sid = tmp_sid;
new_ep->windows_name = strdup( windows_name );
new_ep->unix_name = strdup( unixname );