winbindd: Route predefined domains through the BUILTIN domain child
authorRalph Boehme <slow@samba.org>
Wed, 28 Nov 2018 14:39:21 +0000 (15:39 +0100)
committerKarolin Seeger <kseeger@samba.org>
Mon, 10 Dec 2018 12:43:15 +0000 (13:43 +0100)
Without this eg "NT Authority" didn't work:

  $ bin/wbinfo -n "NT Authority/Authenticated Users"
  failed to call wbcLookupName: WBC_ERR_DOMAIN_NOT_FOUND
  Could not lookup name NT Authority/Authenticated Users

  $ bin/wbinfo --group-info="NT Authority/Authenticated Users"
  failed to call wbcGetgrnam: WBC_ERR_DOMAIN_NOT_FOUND
  Could not get info for group NT Authority/Authenticated Users

With the patch:

  $ bin/wbinfo -n "NT Authority/Authenticated Users"
  S-1-5-11 SID_WKN_GROUP (5)

  $ bin/wbinfo --group-info="NT Authority/Authenticated Users"
  NT AUTHORITY\authenticated users:x:10002:

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12164

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Dec  5 11:27:22 CET 2018 on sn-devel-144

(cherry picked from commit 8b8d9fdad4a4e2c479141b3d40e9a7320a49c0dd)

Autobuild-User(v4-9-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-9-test): Mon Dec 10 13:43:15 CET 2018 on sn-devel-144

selftest/knownfail.d/samba.blackbox.wbinfo [deleted file]
source3/winbindd/winbindd_util.c

diff --git a/selftest/knownfail.d/samba.blackbox.wbinfo b/selftest/knownfail.d/samba.blackbox.wbinfo
deleted file mode 100644 (file)
index e294c2d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-^samba.blackbox.wbinfo\(.*\).wbinfo -n NT Authority/Authenticated Users\(.*\)
-^samba.blackbox.wbinfo\(.*\).wbinfo --group-info NT Authority/Authenticated Users\(.*\)
index d3b3eaaa1ec2f9008930cdf6bb23bf214e4a4b5f..5d4fca213e0ef8f7b83bf84ebed910e7f63a3f82 100644 (file)
@@ -1504,6 +1504,8 @@ struct winbindd_domain *find_lookup_domain_from_sid(const struct dom_sid *sid)
 
 struct winbindd_domain *find_lookup_domain_from_name(const char *domain_name)
 {
+       bool predefined;
+
        if ( strequal(domain_name, unix_users_domain_name() ) ||
             strequal(domain_name, unix_groups_domain_name() ) )
        {
@@ -1519,6 +1521,11 @@ struct winbindd_domain *find_lookup_domain_from_name(const char *domain_name)
                return find_domain_from_name_noinit(domain_name);
        }
 
+       predefined = dom_sid_lookup_is_predefined_domain(domain_name);
+       if (predefined) {
+               return find_domain_from_name_noinit(builtin_domain_name());
+       }
+
        if (IS_DC) {
                struct winbindd_domain *domain = NULL;