1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-28 01:58:17 +03:00

r7450: fix my bone head mistake with ntlm authentcation and 'map to guest = bad uid'; make sure the authentication suceeds

(This used to be commit 5de1ffce2f2a0a340f6591939b8f63a3d96a627e)
This commit is contained in:
Gerald Carter 2005-06-09 18:45:56 +00:00 committed by Gerald (Jerry) Carter
parent db0b2f9ebe
commit 958624a9fc
2 changed files with 12 additions and 9 deletions

View File

@ -312,15 +312,10 @@ static NTSTATUS check_ntlm_password(const struct auth_context *auth_context,
/* failed authentication; check for guest lapping */
if ( lp_map_to_guest() == MAP_TO_GUEST_ON_BAD_UID ) {
make_server_info_guest(server_info);
nt_status = NT_STATUS_OK;
} 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);
}
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;
}

View File

@ -1161,7 +1161,15 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
&found_username, &uid, &gid, &sam_account );
}
/* if we still don't have a valid unix account check for
'map to gues = bad uid' */
if (!NT_STATUS_IS_OK(nt_status)) {
if ( lp_map_to_guest() == MAP_TO_GUEST_ON_BAD_UID ) {
make_server_info_guest(server_info);
return NT_STATUS_OK;
}
DEBUG(0, ("make_server_info_info3: pdb_init_sam failed!\n"));
return nt_status;
}