summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2006-03-24 22:04:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:15:44 -0500
commit190554b770b9f21c1641574c29acaa4fbea90f48 (patch)
treeee4c4a1a930d9a3bdca166f53b0a959321488cdf /source3/nsswitch
parentac2b7c0d93eb30e026c56b01a4a7a470ed3d77e7 (diff)
downloadsamba-190554b770b9f21c1641574c29acaa4fbea90f48.tar.gz
samba-190554b770b9f21c1641574c29acaa4fbea90f48.tar.bz2
samba-190554b770b9f21c1641574c29acaa4fbea90f48.zip
r14698: Make sure we expand our own local groups and not
just the BUILTIN group when calling winbindd_getgroups. $ id foo uid=502(foo) gid=100(users) groups=100(users),10007(RHEL4\staff), 10001(BUILTIN\users) (This used to be commit 603b4b501a759510d2ec66cbe5ab1e9f5dc5dbc1)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/winbindd_async.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source3/nsswitch/winbindd_async.c b/source3/nsswitch/winbindd_async.c
index 1581b7c272..543dc88470 100644
--- a/source3/nsswitch/winbindd_async.c
+++ b/source3/nsswitch/winbindd_async.c
@@ -956,6 +956,7 @@ struct gettoken_state {
TALLOC_CTX *mem_ctx;
DOM_SID user_sid;
struct winbindd_domain *alias_domain;
+ struct winbindd_domain *local_alias_domain;
struct winbindd_domain *builtin_domain;
DOM_SID *sids;
size_t num_sids;
@@ -990,6 +991,7 @@ void winbindd_gettoken_async(TALLOC_CTX *mem_ctx, const DOM_SID *user_sid,
state->mem_ctx = mem_ctx;
sid_copy(&state->user_sid, user_sid);
state->alias_domain = find_our_domain();
+ state->local_alias_domain = find_domain_from_name( get_global_sam_name() );
state->builtin_domain = find_builtin_domain();
state->cont = cont;
state->private_data = private_data;
@@ -1081,9 +1083,19 @@ static void gettoken_recvaliases(void *private_data, BOOL success,
add_sid_to_array(state->mem_ctx, &aliases[i],
&state->sids, &state->num_sids);
+ if (state->local_alias_domain != NULL) {
+ struct winbindd_domain *local_domain = state->local_alias_domain;
+ DEBUG(10, ("Expanding our own local groups\n"));
+ state->local_alias_domain = NULL;
+ winbindd_getsidaliases_async(local_domain, state->mem_ctx,
+ state->sids, state->num_sids,
+ gettoken_recvaliases, state);
+ return;
+ }
+
if (state->builtin_domain != NULL) {
struct winbindd_domain *builtin_domain = state->builtin_domain;
- DEBUG(10, ("Expanding our own local groups\n"));
+ DEBUG(10, ("Expanding our own BUILTIN groups\n"));
state->builtin_domain = NULL;
winbindd_getsidaliases_async(builtin_domain, state->mem_ctx,
state->sids, state->num_sids,