From: Ralph Boehme Date: Fri, 13 Dec 2019 11:14:04 +0000 (+0100) Subject: s3:auth: fill in info3 domain name in passwd_to_SamInfo3() X-Git-Tag: ldb-2.2.0~243 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7e77ce32dbb5bbbc5605fe6cbe557378bbbe966;p=thirdparty%2Fsamba.git s3:auth: fill in info3 domain name in passwd_to_SamInfo3() This is needed for make_session_info_from_username() to fill in the domain name. The callchain goes like this: make_session_info_from_username() -> make_server_info_pw() -> passwd_to_SamInfo3() Other callers of passwd_to_SamInfo3() are also affected. A subsequent change will let set_conn_force_user_group() user the domainname from the session_info returned from make_session_info_from_username() to create substitution context. Without this fix domain name would be NULL. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/auth/server_info.c b/source3/auth/server_info.c index 527a7dbce60..f3e2b3b25f8 100644 --- a/source3/auth/server_info.c +++ b/source3/auth/server_info.c @@ -732,6 +732,12 @@ NTSTATUS passwd_to_SamInfo3(TALLOC_CTX *mem_ctx, goto done; } + info3->base.logon_domain.string = talloc_strdup(info3, domain_name); + if (info3->base.logon_domain.string == NULL) { + status = NT_STATUS_NO_MEMORY; + goto done; + } + ZERO_STRUCT(domain_sid); status = SamInfo3_handle_sids(unix_username,