From: Andreas Schneider Date: Mon, 1 Apr 2019 13:59:10 +0000 (+0200) Subject: auth:creds: Prefer the principal over DOMAIN/username when using NTLM X-Git-Tag: tdb-1.4.1~557 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c7f0a6902cfdd698e5f4159d37537bb4c9c1cc3;p=thirdparty%2Fsamba.git auth:creds: Prefer the principal over DOMAIN/username when using NTLM If we want to authenticate using -Wadmin@otherdomain the DC should do take care of the authentication with the right DC for us. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13861 Pair-Programmed-With: Guenther Deschner Signed-off-by: Guenther Deschner Signed-off-by: Andreas Schneider Reviewed-by: Ralph Boehme Reviewed-by: Andrew Bartlett --- diff --git a/auth/credentials/credentials.c b/auth/credentials/credentials.c index 4663185c979..7ef58d0752c 100644 --- a/auth/credentials/credentials.c +++ b/auth/credentials/credentials.c @@ -1115,7 +1115,7 @@ _PUBLIC_ void cli_credentials_get_ntlm_username_domain(struct cli_credentials *c const char **username, const char **domain) { - if (cred->principal_obtained > cred->username_obtained) { + if (cred->principal_obtained >= cred->username_obtained) { *domain = talloc_strdup(mem_ctx, ""); *username = cli_credentials_get_principal(cred, mem_ctx); } else {