diff options
-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 */ |