summaryrefslogtreecommitdiff
path: root/source3/winbindd/wb_getgrsid.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-12-28 23:14:43 +0100
committerVolker Lendecke <vl@samba.org>2009-12-28 23:20:02 +0100
commitc0289d63c39401e9555d4852ac74043d70a085f3 (patch)
tree412acab7e99eb218fc998f363379c23f5d312f6b /source3/winbindd/wb_getgrsid.c
parentb8fcba9cb8f508ffd97f00179dafa4537342c9c0 (diff)
downloadsamba-c0289d63c39401e9555d4852ac74043d70a085f3.tar.gz
samba-c0289d63c39401e9555d4852ac74043d70a085f3.tar.bz2
samba-c0289d63c39401e9555d4852ac74043d70a085f3.zip
s3: Move a lp_winbind_trusted_domains_only() check to wb_getgrsid()
winbindd_getgrgid was not protected by this.
Diffstat (limited to 'source3/winbindd/wb_getgrsid.c')
-rw-r--r--source3/winbindd/wb_getgrsid.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source3/winbindd/wb_getgrsid.c b/source3/winbindd/wb_getgrsid.c
index 03d71e45b9..bb93be2174 100644
--- a/source3/winbindd/wb_getgrsid.c
+++ b/source3/winbindd/wb_getgrsid.c
@@ -52,6 +52,17 @@ struct tevent_req *wb_getgrsid_send(TALLOC_CTX *mem_ctx,
state->ev = ev;
state->max_nesting = max_nesting;
+ if (lp_winbind_trusted_domains_only()) {
+ struct winbindd_domain *our_domain = find_our_domain();
+
+ if (sid_compare_domain(group_sid, &our_domain->sid) == 0) {
+ DEBUG(7, ("winbindd_getgrsid: My domain -- rejecting "
+ "getgrsid() for %s\n", sid_string_tos(group_sid)));
+ tevent_req_nterror(req, NT_STATUS_NO_SUCH_GROUP);
+ return tevent_req_post(req, ev);
+ }
+ }
+
subreq = wb_lookupsid_send(state, ev, &state->sid);
if (tevent_req_nomem(subreq, req)) {
return tevent_req_post(req, ev);