]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:auth: Pass mem_ctx to init_system_session_info()
authorAndreas Schneider <asn@samba.org>
Tue, 13 Feb 2018 11:12:06 +0000 (12:12 +0100)
committerJeremy Allison <jra@samba.org>
Wed, 21 Feb 2018 01:46:40 +0000 (02:46 +0100)
We have a stackframe we can use for the lifetime of the session.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Feb 21 02:46:40 CET 2018 on sn-devel-144

source3/auth/auth_util.c
source3/auth/proto.h
source3/smbd/server.c
source3/winbindd/winbindd.c

index c81432d277d67235a446d2ef78acfa8bb259e0de..4b2026127ed4128540dc5c20316436d6c5952841 100644 (file)
@@ -1169,12 +1169,12 @@ NTSTATUS make_session_info_guest(TALLOC_CTX *mem_ctx,
 
 static struct auth_session_info *system_info = NULL;
 
-NTSTATUS init_system_session_info(void)
+NTSTATUS init_system_session_info(TALLOC_CTX *mem_ctx)
 {
        if (system_info != NULL)
                return NT_STATUS_OK;
 
-       return make_new_session_info_system(NULL, &system_info);
+       return make_new_session_info_system(mem_ctx, &system_info);
 }
 
 NTSTATUS make_session_info_system(TALLOC_CTX *mem_ctx,
index 6d6f789d8b676bcbe52355c2d7846deaf138b8f2..bdefeaf8ec5aae9f817cb17caf691155609e8811 100644 (file)
@@ -241,7 +241,7 @@ NTSTATUS make_session_info_from_username(TALLOC_CTX *mem_ctx,
 struct auth_session_info *copy_session_info(TALLOC_CTX *mem_ctx,
                                             const struct auth_session_info *src);
 bool init_guest_session_info(TALLOC_CTX *mem_ctx);
-NTSTATUS init_system_session_info(void);
+NTSTATUS init_system_session_info(TALLOC_CTX *mem_ctx);
 bool session_info_set_session_key(struct auth_session_info *info,
                                 DATA_BLOB session_key);
 NTSTATUS make_server_info_guest(TALLOC_CTX *mem_ctx,
index d80ea7311bd697b81fe8efab3c4db895b6cf8ed7..e7e297f1f1862c9a3f9f788741dafa93ede13306 100644 (file)
@@ -1984,7 +1984,7 @@ extern void build_options(bool screen);
                exit_daemon("ERROR: failed to load share info db.", EACCES);
        }
 
-       status = init_system_session_info();
+       status = init_system_session_info(NULL);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(1, ("ERROR: failed to setup system user info: %s.\n",
                          nt_errstr(status)));
index 6e3df1f18a8ecaedb041270ce64452a887e04afe..9611f73737850f936869afeb56514a0a7069e415 100644 (file)
@@ -1768,7 +1768,7 @@ int main(int argc, const char **argv)
                exit(1);
        }
 
-       status = init_system_session_info();
+       status = init_system_session_info(NULL);
        if (!NT_STATUS_IS_OK(status)) {
                exit_daemon("Winbindd failed to setup system user info", map_errno_from_nt_status(status));
        }