>From 8b7ae8a7c0fc01bb244fca90acc3cbfc94ac822f Mon Sep 17 00:00:00 2001 From: Noel Power Date: Tue, 20 Sep 2016 11:49:49 +0100 Subject: [PATCH] s3/winbindd: using default domain with user@domain.com format fails For example for samba client joined to a windows AD DC the following commands fail if 'winbind use default domain = yes' getent passwd user@domain.com ssh -o user=user@domain.com localhost The same commands succeed if the setting above has the default 'no' value Signed-off-by: Noel Power --- source3/winbindd/winbindd_util.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c index 5ece738..a8ff149 100644 --- a/source3/winbindd/winbindd_util.c +++ b/source3/winbindd/winbindd_util.c @@ -853,10 +853,11 @@ bool parse_domain_user(const char *domuser, fstring domain, fstring user) if ( !p ) { fstrcpy(user, domuser); + p = strchr(domuser, '@'); - if ( assume_domain(lp_workgroup())) { + if ( assume_domain(lp_workgroup()) && p == NULL) { fstrcpy(domain, lp_workgroup()); - } else if ((p = strchr(domuser, '@')) != NULL) { + } else if (p != NULL) { fstrcpy(domain, p + 1); user[PTR_DIFF(p, domuser)] = 0; } else { -- 1.7.12.4