From b7e77ce32dbb5bbbc5605fe6cbe557378bbbe966 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Fri, 13 Dec 2019 12:14:04 +0100 Subject: [PATCH] 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 --- source3/auth/server_info.c | 6 ++++++ 1 file changed, 6 insertions(+) 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, -- 2.34.1