The branch, v4-2-test has been updated via 9bc968a samr4: Use <SID=%s> in GetGroupsForUser from 08bbbbc s3-util: Compare the maximum allowed length of a NetBIOS name
https://git.samba.org/?p=samba.git;a=shortlog;h=v4-2-test - Log ----------------------------------------------------------------- commit 9bc968a812eaa1527210f41f12aa445fee80ab6a Author: Volker Lendecke <v...@samba.org> Date: Tue Sep 1 08:41:04 2015 +0200 samr4: Use <SID=%s> in GetGroupsForUser This way we avoid quoting problems in user's DNs Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> Autobuild-User(master): Jeremy Allison <j...@samba.org> Autobuild-Date(master): Tue Sep 1 23:49:14 CEST 2015 on sn-devel-104 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11488 (cherry picked from commit 841845dea35089a187fd1626c9752d708989ac7b) Autobuild-User(v4-2-test): Stefan Metzmacher <me...@samba.org> Autobuild-Date(v4-2-test): Thu Sep 3 11:45:06 CEST 2015 on sn-devel-104 ----------------------------------------------------------------------- Summary of changes: source4/rpc_server/samr/dcesrv_samr.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c index c0bec43..8c34e30 100644 --- a/source4/rpc_server/samr/dcesrv_samr.c +++ b/source4/rpc_server/samr/dcesrv_samr.c @@ -3577,17 +3577,23 @@ static NTSTATUS dcesrv_samr_GetGroupsForUser(struct dcesrv_call_state *dce_call, const char * const attrs[2] = { "objectSid", NULL }; struct samr_RidWithAttributeArray *array; int i, count; + char membersidstr[DOM_SID_STR_BUFLEN]; DCESRV_PULL_HANDLE(h, r->in.user_handle, SAMR_HANDLE_USER); a_state = h->data; d_state = a_state->domain_state; + dom_sid_string_buf(a_state->account_sid, + membersidstr, sizeof(membersidstr)), + count = samdb_search_domain(a_state->sam_ctx, mem_ctx, d_state->domain_dn, &res, attrs, d_state->domain_sid, - "(&(member=%s)(|(grouptype=%d)(grouptype=%d))(objectclass=group))", - ldb_dn_get_linearized(a_state->account_dn), + "(&(member=<SID=%s>)" + "(|(grouptype=%d)(grouptype=%d))" + "(objectclass=group))", + membersidstr, GTYPE_SECURITY_UNIVERSAL_GROUP, GTYPE_SECURITY_GLOBAL_GROUP); if (count < 0) -- Samba Shared Repository