summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2017-01-03 14:54:46 +0000
committerVolker Lendecke <vl@samba.org>2017-01-04 12:22:12 +0100
commitbb050bfd88e34c9d922ac2c26ab4cefc1bd07543 (patch)
tree8ce9af1152dd748fd802b566fdab7444b9aee8d5 /source3
parenta8ab48ee193f68217e7c53b71bf6c57d2d15f8d7 (diff)
downloadsamba-bb050bfd88e34c9d922ac2c26ab4cefc1bd07543.tar.gz
winbind: Add "expand_local_aliases" to wb_gettoken
I hate passing down booleans, but we have the "domain_groups_only" parameter in wbcLookupUserSids which we need to keep for API compatibility. To make sure we use as few code paths as possible, this basically passes down this flag. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/winbindd/wb_gettoken.c10
-rw-r--r--source3/winbindd/winbindd_getgroups.c2
-rw-r--r--source3/winbindd/winbindd_getusersids.c2
-rw-r--r--source3/winbindd/winbindd_proto.h3
4 files changed, 13 insertions, 4 deletions
diff --git a/source3/winbindd/wb_gettoken.c b/source3/winbindd/wb_gettoken.c
index 1c99121bb09..d8867c36b9d 100644
--- a/source3/winbindd/wb_gettoken.c
+++ b/source3/winbindd/wb_gettoken.c
@@ -26,6 +26,7 @@
struct wb_gettoken_state {
struct tevent_context *ev;
struct dom_sid usersid;
+ bool expand_local_aliases;
int num_sids;
struct dom_sid *sids;
};
@@ -41,7 +42,8 @@ static void wb_gettoken_gotbuiltins(struct tevent_req *subreq);
struct tevent_req *wb_gettoken_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
- const struct dom_sid *sid)
+ const struct dom_sid *sid,
+ bool expand_local_aliases)
{
struct tevent_req *req, *subreq;
struct wb_gettoken_state *state;
@@ -52,6 +54,7 @@ struct tevent_req *wb_gettoken_send(TALLOC_CTX *mem_ctx,
}
sid_copy(&state->usersid, sid);
state->ev = ev;
+ state->expand_local_aliases = expand_local_aliases;
subreq = wb_queryuser_send(state, ev, &state->usersid);
if (tevent_req_nomem(subreq, req)) {
@@ -115,6 +118,11 @@ static void wb_gettoken_gotuser(struct tevent_req *subreq)
num_groups * sizeof(struct dom_sid));
state->num_sids += num_groups;
+ if (!state->expand_local_aliases) {
+ tevent_req_done(req);
+ return;
+ }
+
/*
* Expand our domain's aliases
*/
diff --git a/source3/winbindd/winbindd_getgroups.c b/source3/winbindd/winbindd_getgroups.c
index 8b9d0a3ecdf..8bf670654e1 100644
--- a/source3/winbindd/winbindd_getgroups.c
+++ b/source3/winbindd/winbindd_getgroups.c
@@ -99,7 +99,7 @@ static void winbindd_getgroups_lookupname_done(struct tevent_req *subreq)
return;
}
- subreq = wb_gettoken_send(state, state->ev, &state->sid);
+ subreq = wb_gettoken_send(state, state->ev, &state->sid, true);
if (tevent_req_nomem(subreq, req)) {
return;
}
diff --git a/source3/winbindd/winbindd_getusersids.c b/source3/winbindd/winbindd_getusersids.c
index 6b5510ad5a5..d6995c4390a 100644
--- a/source3/winbindd/winbindd_getusersids.c
+++ b/source3/winbindd/winbindd_getusersids.c
@@ -55,7 +55,7 @@ struct tevent_req *winbindd_getusersids_send(TALLOC_CTX *mem_ctx,
return tevent_req_post(req, ev);
}
- subreq = wb_gettoken_send(state, ev, &state->sid);
+ subreq = wb_gettoken_send(state, ev, &state->sid, true);
if (tevent_req_nomem(subreq, req)) {
return tevent_req_post(req, ev);
}
diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h
index a4e05187d32..2aed8dc25aa 100644
--- a/source3/winbindd/winbindd_proto.h
+++ b/source3/winbindd/winbindd_proto.h
@@ -687,7 +687,8 @@ NTSTATUS winbindd_getuserdomgroups_recv(struct tevent_req *req,
struct winbindd_response *response);
struct tevent_req *wb_gettoken_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
- const struct dom_sid *sid);
+ const struct dom_sid *sid,
+ bool expand_local_aliases);
NTSTATUS wb_gettoken_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
int *num_sids, struct dom_sid **sids);
struct tevent_req *winbindd_getgroups_send(TALLOC_CTX *mem_ctx,