]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:auth: fill in info3 domain name in passwd_to_SamInfo3()
authorRalph Boehme <slow@samba.org>
Fri, 13 Dec 2019 11:14:04 +0000 (12:14 +0100)
committerJeremy Allison <jra@samba.org>
Sat, 30 May 2020 01:17:36 +0000 (01:17 +0000)
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 <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/auth/server_info.c

index 527a7dbce60a4cd084fab54267e339da24d33aee..f3e2b3b25f82a77e1cd0792b0dc9eda81218506e 100644 (file)
@@ -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,