summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--auth/auth_sam_reply.c3
-rw-r--r--source3/auth/auth_util.c3
2 files changed, 5 insertions, 1 deletions
diff --git a/auth/auth_sam_reply.c b/auth/auth_sam_reply.c
index ee27e966f6..59fcf7ad5d 100644
--- a/auth/auth_sam_reply.c
+++ b/auth/auth_sam_reply.c
@@ -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;
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
index 0627911aeb..d5ca1a206b 100644
--- a/source3/auth/auth_util.c
+++ b/source3/auth/auth_util.c
@@ -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;
}