From af52df2f1fde76b518bf946e396bc29869aa6964 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 27 May 2005 13:58:04 +0000 Subject: r7020: fixing printer ace values and getting rid of false compiler warning about unitialized variable (This used to be commit 3a91b20e4bcc78c91932e6c4394b3f6f153b2ff5) --- source3/auth/auth.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'source3/auth') diff --git a/source3/auth/auth.c b/source3/auth/auth.c index b777e97cc9..e38279a140 100644 --- a/source3/auth/auth.c +++ b/source3/auth/auth.c @@ -215,6 +215,7 @@ static NTSTATUS check_ntlm_password(const struct auth_context *auth_context, if (!user_info || !auth_context || !server_info) return NT_STATUS_LOGON_FAILURE; + DEBUG(3, ("check_ntlm_password: Checking password for unmapped user [%s]\\[%s]@[%s] with the new password interface\n", user_info->client_domain.str, user_info->smb_name.str, user_info->wksta_name.str)); @@ -305,12 +306,19 @@ static NTSTATUS check_ntlm_password(const struct auth_context *auth_context, unix_username)); } } - if (!NT_STATUS_IS_OK(nt_status)) { - DEBUG(2, ("check_ntlm_password: Authentication for user [%s] -> [%s] FAILED with error %s\n", - user_info->smb_name.str, user_info->internal_username.str, - nt_errstr(nt_status))); - ZERO_STRUCTP(server_info); + if (lp_map_to_guest() == MAP_TO_GUEST_ON_VALID_DOMAIN_USER ){ + /*user_info->smb_name.str = lp_guestaccount();*/ + become_root(); + nt_status = smb_pam_accountcheck(lp_guestaccount()); + unbecome_root(); + make_server_info_guest(server_info); + }else{ + DEBUG(2, ("check_ntlm_password: Authentication for user [%s] -> [%s] FAILED with error %s\n", + user_info->smb_name.str, user_info->internal_username.str, + nt_errstr(nt_status))); + ZERO_STRUCTP(server_info); + } } return nt_status; } -- cgit