From: Günther Deschner Date: Tue, 2 Apr 2019 11:14:06 +0000 (+0200) Subject: s3-libnet_join: always pass down admin domain to ads layer X-Git-Tag: tdb-1.4.1~534 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea29aa27cbac4253ee1701fed99a3e0811f7475d;p=thirdparty%2Fsamba.git s3-libnet_join: always pass down admin domain to ads layer Otherwise we could loose the information that a non-default domain name has been used for admin creds. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13861 Guenther Signed-off-by: Guenther Deschner Reviewed-by: Andreas Schneider --- diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c index e052306523d..fc7429e6a23 100644 --- a/source3/libnet/libnet_join.c +++ b/source3/libnet/libnet_join.c @@ -205,7 +205,19 @@ static ADS_STATUS libnet_join_connect_ads(TALLOC_CTX *mem_ctx, password = r->in.machine_password; ccname = "MEMORY:libnet_join_machine_creds"; } else { + char *p = NULL; + username = r->in.admin_account; + + p = strchr(r->in.admin_account, '@'); + if (p == NULL) { + username = talloc_asprintf(mem_ctx, "%s@%s", + r->in.admin_account, + r->in.admin_domain); + } + if (username == NULL) { + return ADS_ERROR(LDAP_NO_MEMORY); + } password = r->in.admin_password; /*