From a73e35eefab2bbcb784fe6882a14be8866846f73 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 19 Sep 2016 13:59:54 +0200 Subject: [PATCH] s3-lib: Fix %G substitution in AD member environment If we are a domain member we should look up the user with the domain name specified else it will only work if we have 'winbind use default domain' set. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12276 Signed-off-by: Andreas Schneider --- source3/lib/substitute.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c index bcfdd29..88c9aef 100644 --- a/source3/lib/substitute.c +++ b/source3/lib/substitute.c @@ -501,8 +501,8 @@ char *talloc_sub_basic(TALLOC_CTX *mem_ctx, struct passwd *pass; if (domain_name != NULL && domain_name[0] != '\0' && - !strequal(domain_name, my_sam_name())) - { + (lp_security() == SEC_ADS || + lp_security() == SEC_DOMAIN)) { r = talloc_asprintf(tmp_ctx, "%s%c%s", domain_name, -- 2.10.0