summaryrefslogtreecommitdiff
path: root/source3/auth
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2018-02-13 12:09:12 +0100
committerJeremy Allison <jra@samba.org>2018-02-20 21:55:13 +0100
commit7f47cec2343ca7658460cc14fa613fdd2611677a (patch)
tree3dcd8c21da3a093e43444b22c0039847120864cb /source3/auth
parentb2aec11c76904bf6a8f67f0634cce5e443e77d8b (diff)
downloadsamba-7f47cec2343ca7658460cc14fa613fdd2611677a.tar.gz
s3:auth: Pass mem_ctx to init_guest_session_info()
Use a mem_ctx which gets freed if possible. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/auth')
-rw-r--r--source3/auth/auth_util.c9
-rw-r--r--source3/auth/proto.h2
2 files changed, 8 insertions, 3 deletions
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
index 377d56d0488..c81432d277d 100644
--- a/source3/auth/auth_util.c
+++ b/source3/auth/auth_util.c
@@ -1136,12 +1136,17 @@ static struct auth_session_info *guest_info = NULL;
static struct auth_serversupplied_info *guest_server_info = NULL;
-bool init_guest_info(void)
+bool init_guest_session_info(TALLOC_CTX *mem_ctx)
{
+ NTSTATUS status;
+
if (guest_info != NULL)
return true;
- return NT_STATUS_IS_OK(make_new_session_info_guest(NULL, &guest_info, &guest_server_info));
+ status = make_new_session_info_guest(mem_ctx,
+ &guest_info,
+ &guest_server_info);
+ return NT_STATUS_IS_OK(status);
}
NTSTATUS make_server_info_guest(TALLOC_CTX *mem_ctx,
diff --git a/source3/auth/proto.h b/source3/auth/proto.h
index ca851c21d4b..6d6f789d8b6 100644
--- a/source3/auth/proto.h
+++ b/source3/auth/proto.h
@@ -240,7 +240,7 @@ NTSTATUS make_session_info_from_username(TALLOC_CTX *mem_ctx,
struct auth_session_info **session_info);
struct auth_session_info *copy_session_info(TALLOC_CTX *mem_ctx,
const struct auth_session_info *src);
-bool init_guest_info(void);
+bool init_guest_session_info(TALLOC_CTX *mem_ctx);
NTSTATUS init_system_session_info(void);
bool session_info_set_session_key(struct auth_session_info *info,
DATA_BLOB session_key);