From 9eb64502f0f3d7b0a86488452740ad8184ae3e37 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 28 Mar 2015 08:31:05 +0000 Subject: [PATCH] s3:winbindd: list users/groups of our own domain as AD DC The AD users/groups of the local domain of an AD DC only exist via winbindd and not in /etc/passwd or /etc/group. This also matches the behaviour of the source4/winbind code. Bug: https://bugzilla.samba.org/show_bug.cgi?id=11183 Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- selftest/knownfail | 4 +++- source3/winbindd/winbindd_util.c | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/selftest/knownfail b/selftest/knownfail index 777a4e4835b..3262c9c185f 100644 --- a/selftest/knownfail +++ b/selftest/knownfail @@ -267,7 +267,6 @@ ^samba4.winbind.struct.getdcname\(s4member:local\) ^samba.blackbox.wbinfo\(s4member:local\).wbinfo -r against s4member\(s4member:local\) ^samba.blackbox.wbinfo\(s4member:local\).wbinfo --user-sids against s4member\(s4member:local\) -^samba4.winbind.struct.getpwent\(ad_dc:local\) ^samba.wbinfo_simple.\(s4member:local\).--user-groups ^samba.nss.test using winbind\(s4member:local\) # @@ -277,6 +276,9 @@ ^samba3.local.nss.reentrant enumeration crosschecks\(ad_dc_ntvfs:local\) ^samba3.local.nss.reentrant enumeration\(ad_dc_ntvfs:local\) ^samba3.local.nss.enumeration\(ad_dc_ntvfs:local\) +^samba3.local.nss.reentrant enumeration crosschecks\(ad_dc:local\) +^samba3.local.nss.reentrant enumeration\(ad_dc:local\) +^samba3.local.nss.enumeration\(ad_dc:local\) # # These fail only if we run the unix.whoami test before them # in the member and ad_member environments. ==> Strange!!! diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c index 88c7568bf4b..021f5ca1d6c 100644 --- a/source3/winbindd/winbindd_util.c +++ b/source3/winbindd/winbindd_util.c @@ -87,10 +87,13 @@ struct winbindd_domain *wb_next_domain(struct winbindd_domain *domain) domain = domain->next; } - if ((domain != NULL) - && sid_check_is_our_sam(&domain->sid)) { + if ((domain != NULL) && + (lp_server_role() != ROLE_ACTIVE_DIRECTORY_DC) && + sid_check_is_our_sam(&domain->sid)) + { domain = domain->next; } + return domain; }