From: Andreas Schneider Date: Tue, 13 Feb 2018 11:12:06 +0000 (+0100) Subject: s3:auth: Pass mem_ctx to init_system_session_info() X-Git-Tag: tevent-0.9.36~59 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6f9c6d369f4aa4a5c861f51041dd663e81e2ec4e;p=thirdparty%2Fsamba.git s3:auth: Pass mem_ctx to init_system_session_info() We have a stackframe we can use for the lifetime of the session. Signed-off-by: Andreas Schneider Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Wed Feb 21 02:46:40 CET 2018 on sn-devel-144 --- diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c index c81432d277d..4b2026127ed 100644 --- a/source3/auth/auth_util.c +++ b/source3/auth/auth_util.c @@ -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, diff --git a/source3/auth/proto.h b/source3/auth/proto.h index 6d6f789d8b6..bdefeaf8ec5 100644 --- a/source3/auth/proto.h +++ b/source3/auth/proto.h @@ -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, diff --git a/source3/smbd/server.c b/source3/smbd/server.c index d80ea7311bd..e7e297f1f18 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -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))); diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c index 6e3df1f18a8..9611f737378 100644 --- a/source3/winbindd/winbindd.c +++ b/source3/winbindd/winbindd.c @@ -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)); }