summaryrefslogtreecommitdiffstats
path: root/source3/rpc_server/srv_util.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-06-09 08:45:35 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-06-09 08:45:35 +0000
commitae6bdb2cd525faa5033931ec437e164d624849c4 (patch)
treee02d4f5bfe231eabc87d353ffa8cdc35548f3a05 /source3/rpc_server/srv_util.c
parent766a78e6b8141f905d8741d3da2b59cb6f1e771e (diff)
downloadsamba-ae6bdb2cd525faa5033931ec437e164d624849c4.tar.gz
samba-ae6bdb2cd525faa5033931ec437e164d624849c4.tar.xz
samba-ae6bdb2cd525faa5033931ec437e164d624849c4.zip
This (hopefully) fixes a bug reported by Kai Krueger <kai@kruegernetz.de>
involving the use of lp_winbind_gid() without checking if they have been set. Also revert the 'clashing user' check back to a Get_Pwnam() - I probably should never have changed it. Andrew Bartlett (This used to be commit 1d6ba405589cee4e1582bc91cf659b89564899d4)
Diffstat (limited to 'source3/rpc_server/srv_util.c')
-rw-r--r--source3/rpc_server/srv_util.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source3/rpc_server/srv_util.c b/source3/rpc_server/srv_util.c
index af653ba0e8e..7500ec361fb 100644
--- a/source3/rpc_server/srv_util.c
+++ b/source3/rpc_server/srv_util.c
@@ -93,6 +93,7 @@ NTSTATUS get_alias_user_groups(TALLOC_CTX *ctx, DOM_SID *sid, int *numgroups, ui
uint32 *rids=NULL, *new_rids=NULL;
gid_t winbind_gid_low, winbind_gid_high;
BOOL ret;
+ BOOL winbind_groups_exist;
/*
* this code is far from perfect.
@@ -108,7 +109,7 @@ NTSTATUS get_alias_user_groups(TALLOC_CTX *ctx, DOM_SID *sid, int *numgroups, ui
*prids=NULL;
*numgroups=0;
- lp_winbind_gid(&winbind_gid_low, &winbind_gid_high);
+ winbind_groups_exist = lp_winbind_gid(&winbind_gid_low, &winbind_gid_high);
DEBUG(10,("get_alias_user_groups: looking if SID %s is a member of groups in the SID domain %s\n",
@@ -155,7 +156,7 @@ NTSTATUS get_alias_user_groups(TALLOC_CTX *ctx, DOM_SID *sid, int *numgroups, ui
}
/* Don't return winbind groups as they are not local! */
- if ((grp->gr_gid >= winbind_gid_low) && (grp->gr_gid <= winbind_gid_high)) {
+ if (winbind_groups_exist && (grp->gr_gid >= winbind_gid_low) && (grp->gr_gid <= winbind_gid_high)) {
DEBUG(10,("get_alias_user_groups: not returing %s, not local.\n", map.nt_name));
continue;
}
@@ -224,7 +225,7 @@ NTSTATUS get_alias_user_groups(TALLOC_CTX *ctx, DOM_SID *sid, int *numgroups, ui
}
/* Don't return winbind groups as they are not local! */
- if ((gid >= winbind_gid_low) && (gid <= winbind_gid_high)) {
+ if (winbind_groups_exist && (gid >= winbind_gid_low) && (gid <= winbind_gid_high)) {
DEBUG(10,("get_alias_user_groups: not returing %s, not local.\n", map.nt_name ));
goto done;
}