mirror of
https://github.com/samba-team/samba.git
synced 2025-03-29 02:50:28 +03:00
auth: Set NETLOGON_GUEST and use it to determine guest status
These additional measures should help ensure we do not accidentily upgrade a guest to an authenticated user in the future. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
This commit is contained in:
parent
02444afb87
commit
9d09b66f41
@ -237,7 +237,8 @@ NTSTATUS make_user_info_SamBaseInfo(TALLOC_CTX *mem_ctx,
|
||||
info->bad_password_count = base->bad_password_count;
|
||||
info->acct_flags = base->acct_flags;
|
||||
|
||||
info->authenticated = authenticated;
|
||||
/* Only set authenticated if both NETLOGON_GUEST is not set, and authenticated is set */
|
||||
info->authenticated = (authenticated && (!(base->user_flags & NETLOGON_GUEST)));
|
||||
|
||||
*_user_info = info;
|
||||
return NT_STATUS_OK;
|
||||
|
@ -809,6 +809,9 @@ static NTSTATUS get_guest_info3(TALLOC_CTX *mem_ctx,
|
||||
/* Primary gid */
|
||||
info3->base.primary_gid = BUILTIN_RID_GUESTS;
|
||||
|
||||
/* Set as guest */
|
||||
info3->base.user_flags = NETLOGON_GUEST;
|
||||
|
||||
TALLOC_FREE(pwd);
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user