1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

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>
This commit is contained in:
Andreas Schneider 2018-02-13 12:09:12 +01:00 committed by Jeremy Allison
parent b2aec11c76
commit 7f47cec234
4 changed files with 10 additions and 5 deletions

View File

@ -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,

View File

@ -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);

View File

@ -1991,7 +1991,7 @@ extern void build_options(bool screen);
return -1;
}
if (!init_guest_info()) {
if (!init_guest_session_info(NULL)) {
DEBUG(0,("ERROR: failed to setup guest info.\n"));
return -1;
}

View File

@ -525,7 +525,7 @@ int main(int argc, const char *argv[])
/* some basic initialization stuff */
sec_init();
init_guest_info();
init_guest_session_info(frame);
locking_init();
vfs = talloc_zero(NULL, struct vfs_state);
if (vfs == NULL) {