summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2019-01-11 10:44:30 +0100
committerKarolin Seeger <kseeger@samba.org>2019-10-02 11:06:19 +0000
commit42d530b0dbc1b1389b393c648357de31e4c11e9f (patch)
treedc5f2d29bf528d35338e0f3e71372d9c92e12912 /source3
parent4a43d8b996b1ce444596ed41a686be5ae526113d (diff)
downloadsamba-42d530b0dbc1b1389b393c648357de31e4c11e9f.tar.gz
winbind: provide passwd struct for group sid with ID_TYPE_BOTH mapping (again)
https://git.samba.org/?p=samba.git;a=commitdiff;h=394622ef8c916cf361f8596dba4664dc8d6bfc9e originally introduced the above feature. This functionality was undone as part of "winbind: Restructure get_pwsid" https://git.samba.org/?p=samba.git;a=commitdiff;h=bce19a6efe11980933531f0349c8f5212419366a I think that this semantic change was accidential. This patch undoes the semantic change and re-establishes the functionality. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14141 Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Christof Schmitt <cs@samba.org> Autobuild-Date(master): Fri Sep 27 17:25:29 UTC 2019 on sn-devel-184 (cherry picked from commit 63c9147f8631d73b52bdd36ff407e0361dcf5178) Autobuild-User(v4-11-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-11-test): Wed Oct 2 11:06:20 UTC 2019 on sn-devel-184
Diffstat (limited to 'source3')
-rw-r--r--source3/winbindd/wb_queryuser.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/source3/winbindd/wb_queryuser.c b/source3/winbindd/wb_queryuser.c
index 17170c3352a..2eb61406fc5 100644
--- a/source3/winbindd/wb_queryuser.c
+++ b/source3/winbindd/wb_queryuser.c
@@ -166,8 +166,22 @@ static void wb_queryuser_got_domain(struct tevent_req *subreq)
return;
}
- if (type != SID_NAME_USER) {
- /* allow SID_NAME_COMPUTER? */
+ switch (type) {
+ case SID_NAME_USER:
+ case SID_NAME_COMPUTER:
+ /*
+ * user case: we only need the account name from lookup_sids
+ */
+ break;
+ case SID_NAME_DOM_GRP:
+ case SID_NAME_ALIAS:
+ case SID_NAME_WKN_GRP:
+ /*
+ * also treat group-type SIDs (they might map to ID_TYPE_BOTH)
+ */
+ sid_copy(&info->group_sid, &info->user_sid);
+ break;
+ default:
tevent_req_nterror(req, NT_STATUS_NO_SUCH_USER);
return;
}