summaryrefslogtreecommitdiff
path: root/source4/rpc_server
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2014-04-29 13:31:42 +0200
committerAndrew Bartlett <abartlet@samba.org>2014-05-03 07:57:13 +0200
commit1cfc02d786b2d88ed1cafc10c501d5a97f254ec2 (patch)
tree5cbcf8848350fe05cd676afb9fcd9d9905e7a16c /source4/rpc_server
parent7c2bf8d2bc5230e4bd98cc5a0f1b8f3cc56a3f77 (diff)
downloadsamba-1cfc02d786b2d88ed1cafc10c501d5a97f254ec2.tar.gz
s4:samr: allow builtin groups for samr_OpenGroup.
This fixes nsswitch getgrgid for builtins. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/rpc_server')
-rw-r--r--source4/rpc_server/samr/dcesrv_samr.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c
index 3e58a44fb82..eacbe7da7b4 100644
--- a/source4/rpc_server/samr/dcesrv_samr.c
+++ b/source4/rpc_server/samr/dcesrv_samr.c
@@ -1746,13 +1746,22 @@ static NTSTATUS dcesrv_samr_OpenGroup(struct dcesrv_call_state *dce_call, TALLOC
}
/* search for the group record */
- ret = gendb_search(d_state->sam_ctx,
- mem_ctx, d_state->domain_dn, &msgs, attrs,
- "(&(objectSid=%s)(objectClass=group)"
- "(|(groupType=%d)(groupType=%d)))",
- ldap_encode_ndr_dom_sid(mem_ctx, sid),
- GTYPE_SECURITY_UNIVERSAL_GROUP,
- GTYPE_SECURITY_GLOBAL_GROUP);
+ if (d_state->builtin) {
+ ret = gendb_search(d_state->sam_ctx,
+ mem_ctx, d_state->domain_dn, &msgs, attrs,
+ "(&(objectSid=%s)(objectClass=group)"
+ "(groupType=%d))",
+ ldap_encode_ndr_dom_sid(mem_ctx, sid),
+ GTYPE_SECURITY_BUILTIN_LOCAL_GROUP);
+ } else {
+ ret = gendb_search(d_state->sam_ctx,
+ mem_ctx, d_state->domain_dn, &msgs, attrs,
+ "(&(objectSid=%s)(objectClass=group)"
+ "(|(groupType=%d)(groupType=%d)))",
+ ldap_encode_ndr_dom_sid(mem_ctx, sid),
+ GTYPE_SECURITY_UNIVERSAL_GROUP,
+ GTYPE_SECURITY_GLOBAL_GROUP);
+ }
if (ret == 0) {
return NT_STATUS_NO_SUCH_GROUP;
}