]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/samba/samba-3.6.99-bug-1117059.patch
Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into next-suricata
[ipfire-2.x.git] / src / patches / samba / samba-3.6.99-bug-1117059.patch
CommitLineData
1d13e637
AF
1From 7f0edd8c68cd20a136a33d692f32ee2ffc30db76 Mon Sep 17 00:00:00 2001
2From: Michael Adam <obnox@samba.org>
3Date: Mon, 19 Jan 2015 13:51:55 +0100
4Subject: [PATCH] s3:winbind:grent: don't stop group enumeration when a group
5 has no gid
6
7simply continue with the next group
8
9Note: this patch introduces some code duplication to make it
10easier to create minimal backport patch. Subsequent patches
11will provide some refactoring to reduce the duplication.
12
13BUG: https://bugzilla.samba.org/show_bug.cgi?id=8905
14
15Signed-off-by: Michael Adam <obnox@samba.org>
16---
17 source3/winbindd/wb_next_grent.c | 51 +++++++++++++++++++++++++++++++++++++++-
18 1 file changed, 50 insertions(+), 1 deletion(-)
19
20diff --git a/source3/winbindd/wb_next_grent.c b/source3/winbindd/wb_next_grent.c
21index 2b3799a..f52d2d1 100644
22--- a/source3/winbindd/wb_next_grent.c
23+++ b/source3/winbindd/wb_next_grent.c
24@@ -168,9 +168,58 @@ static void wb_next_grent_getgrsid_done(struct tevent_req *subreq)
25 status = wb_getgrsid_recv(subreq, talloc_tos(), &domname, &name,
26 &state->gr->gr_gid, &state->members);
27 TALLOC_FREE(subreq);
28- if (tevent_req_nterror(req, status)) {
29+
30+ if (NT_STATUS_EQUAL(status, NT_STATUS_NONE_MAPPED)) {
31+ state->gstate->next_group += 1;
32+
33+ if (state->gstate->next_group >= state->gstate->num_groups) {
34+ TALLOC_FREE(state->gstate->groups);
35+
36+ if (state->gstate->domain == NULL) {
37+ state->gstate->domain = domain_list();
38+ } else {
39+ state->gstate->domain = state->gstate->domain->next;
40+ }
41+
42+ if ((state->gstate->domain != NULL) &&
43+ sid_check_is_domain(&state->gstate->domain->sid))
44+ {
45+ state->gstate->domain = state->gstate->domain->next;
46+ }
47+
48+ if (state->gstate->domain == NULL) {
49+ tevent_req_nterror(req,
50+ NT_STATUS_NO_MORE_ENTRIES);
51+ return;
52+ }
53+
54+ subreq = dcerpc_wbint_QueryGroupList_send(
55+ state, state->ev,
56+ dom_child_handle(state->gstate->domain),
57+ &state->next_groups);
58+ if (tevent_req_nomem(subreq, req)) {
59+ return;
60+ }
61+
62+ tevent_req_set_callback(subreq,
63+ wb_next_grent_fetch_done, req);
64+ return;
65+ }
66+
67+ subreq = wb_getgrsid_send(
68+ state, state->ev,
69+ &state->gstate->groups[state->gstate->next_group].sid,
70+ state->max_nesting);
71+ if (tevent_req_nomem(subreq, req)) {
72+ return;
73+ }
74+ tevent_req_set_callback(subreq, wb_next_grent_getgrsid_done,
75+ req);
76+ return;
77+ } else if (tevent_req_nterror(req, status)) {
78 return;
79 }
80+
81 if (!fill_grent(talloc_tos(), state->gr, domname, name,
82 state->gr->gr_gid)) {
83 DEBUG(5, ("fill_grent failed\n"));
84--
852.1.0
86