diff options
author | Andreas Schneider <asn@samba.org> | 2014-02-18 13:52:49 +0100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2014-02-19 01:28:14 +0100 |
commit | 79e2725f339e7c5336b4053348c4266268de6ca3 (patch) | |
tree | 1ae008d5e02bebb52ac40e8b2f6a634dde354167 /source3/auth | |
parent | 4d792db03f18aa164b565c7fdc7b446c174fba28 (diff) | |
download | samba-79e2725f339e7c5336b4053348c4266268de6ca3.tar.gz samba-79e2725f339e7c5336b4053348c4266268de6ca3.tar.xz samba-79e2725f339e7c5336b4053348c4266268de6ca3.zip |
s3-auth: Pass mem_ctx to do_map_to_guest_server_info().
Change-Id: If53117023e3ab37c810193edd00a81d247fdde7a
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Feb 19 01:28:14 CET 2014 on sn-devel-104
Diffstat (limited to 'source3/auth')
-rw-r--r-- | source3/auth/auth_ntlmssp.c | 7 | ||||
-rw-r--r-- | source3/auth/auth_util.c | 12 | ||||
-rw-r--r-- | source3/auth/proto.h | 8 |
3 files changed, 16 insertions, 11 deletions
diff --git a/source3/auth/auth_ntlmssp.c b/source3/auth/auth_ntlmssp.c index cb7726cb701..d4fe901f7cc 100644 --- a/source3/auth/auth_ntlmssp.c +++ b/source3/auth/auth_ntlmssp.c @@ -151,10 +151,11 @@ NTSTATUS auth3_check_password(struct auth4_context *auth4_context, free_user_info(&mapped_user_info); if (!NT_STATUS_IS_OK(nt_status)) { - nt_status = do_map_to_guest_server_info(nt_status, - &server_info, + nt_status = do_map_to_guest_server_info(mem_ctx, + nt_status, user_info->client.account_name, - user_info->client.domain_name); + user_info->client.domain_name, + &server_info); *server_returned_info = talloc_steal(mem_ctx, server_info); return nt_status; } diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c index 2b6b13f5c47..fb9e8c8258a 100644 --- a/source3/auth/auth_util.c +++ b/source3/auth/auth_util.c @@ -1536,9 +1536,11 @@ bool is_trusted_domain(const char* dom_name) on a logon error possibly map the error to success if "map to guest" is set approriately */ -NTSTATUS do_map_to_guest_server_info(NTSTATUS status, - struct auth_serversupplied_info **server_info, - const char *user, const char *domain) +NTSTATUS do_map_to_guest_server_info(TALLOC_CTX *mem_ctx, + NTSTATUS status, + const char *user, + const char *domain, + struct auth_serversupplied_info **server_info) { user = user ? user : ""; domain = domain ? domain : ""; @@ -1548,13 +1550,13 @@ NTSTATUS do_map_to_guest_server_info(NTSTATUS status, (lp_map_to_guest() == MAP_TO_GUEST_ON_BAD_PASSWORD)) { DEBUG(3,("No such user %s [%s] - using guest account\n", user, domain)); - return make_server_info_guest(NULL, server_info); + return make_server_info_guest(mem_ctx, server_info); } } else if (NT_STATUS_EQUAL(status, NT_STATUS_WRONG_PASSWORD)) { if (lp_map_to_guest() == MAP_TO_GUEST_ON_BAD_PASSWORD) { DEBUG(3,("Registered username %s for guest access\n", user)); - return make_server_info_guest(NULL, server_info); + return make_server_info_guest(mem_ctx, server_info); } } diff --git a/source3/auth/proto.h b/source3/auth/proto.h index 15b1ba04ebf..7b8959f035f 100644 --- a/source3/auth/proto.h +++ b/source3/auth/proto.h @@ -264,9 +264,11 @@ NTSTATUS make_user_info(struct auth_usersupplied_info **ret_user_info, enum auth_password_state password_state); void free_user_info(struct auth_usersupplied_info **user_info); -NTSTATUS do_map_to_guest_server_info(NTSTATUS status, - struct auth_serversupplied_info **server_info, - const char *user, const char *domain); +NTSTATUS do_map_to_guest_server_info(TALLOC_CTX *mem_ctx, + NTSTATUS status, + const char *user, + const char *domain, + struct auth_serversupplied_info **server_info); /* The following definitions come from auth/auth_winbind.c */ |