auth: Preserve guest flag on transition via netr_SamInfo3
authorAndrew Bartlett <abartlet@samba.org>
Tue, 19 Jul 2011 00:43:23 +0000 (10:43 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 19 Jul 2011 23:17:10 +0000 (09:17 +1000)
Signed-off-by: Andrew Tridgell <tridge@samba.org>
auth/auth_sam_reply.c
source3/auth/auth_util.c

index 54797ef..5cd4530 100644 (file)
@@ -102,6 +102,9 @@ NTSTATUS auth_convert_user_info_dc_sambaseinfo(TALLOC_CTX *mem_ctx,
        }
 
        sam->user_flags = 0; /* w2k3 uses NETLOGON_EXTRA_SIDS | NETLOGON_NTLMV2_ENABLED */
+       if (!user_info_dc->info->authenticated) {
+               sam->user_flags |= NETLOGON_GUEST;
+       }
        sam->acct_flags = user_info_dc->info->acct_flags;
        sam->logon_server.string = user_info_dc->info->logon_server;
        sam->domain.string = user_info_dc->info->domain_name;
index 59850bb..5553300 100644 (file)
@@ -1340,6 +1340,8 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
 
        result->nss_token |= username_was_mapped;
 
+       result->guest = (info3->base.user_flags & NETLOGON_GUEST);
+
        *server_info = result;
 
        return NT_STATUS_OK;