]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Attempt to fix bug #6099. According to Microsoft
authorJeremy Allison <jra@samba.org>
Mon, 16 Feb 2009 02:18:38 +0000 (18:18 -0800)
committerKarolin Seeger <kseeger@samba.org>
Mon, 16 Feb 2009 08:57:07 +0000 (09:57 +0100)
Windows 7 looks at the negotiate_flags
returned in this structure *even if the
call fails with access denied ! So in order
to allow Win7 to connect to a Samba NT style
PDC we set the flags before we know if it's
an error or not.
Jeremy.
(cherry picked from commit cafc9efceadcefa9154874e9846158cf23ee1645)

source/rpc_server/srv_netlog_nt.c

index d3751011e228447b66f057cd773311839231e2c9..2efef7f82004f20505d49326a30f7c8ed46bbb5f 100644 (file)
@@ -474,6 +474,32 @@ NTSTATUS _netr_ServerAuthenticate2(pipes_struct *p,
        uint32_t srv_flgs;
        struct netr_Credential srv_chal_out;
 
+       /* According to Microsoft (see bugid #6099)
+        * Windows 7 looks at the negotiate_flags
+        * returned in this structure *even if the
+        * call fails with access denied ! So in order
+        * to allow Win7 to connect to a Samba NT style
+        * PDC we set the flags before we know if it's
+        * an error or not.
+        */
+
+       /* 0x000001ff */
+       srv_flgs = NETLOGON_NEG_ACCOUNT_LOCKOUT |
+                  NETLOGON_NEG_PERSISTENT_SAMREPL |
+                  NETLOGON_NEG_ARCFOUR |
+                  NETLOGON_NEG_PROMOTION_COUNT |
+                  NETLOGON_NEG_CHANGELOG_BDC |
+                  NETLOGON_NEG_FULL_SYNC_REPL |
+                  NETLOGON_NEG_MULTIPLE_SIDS |
+                  NETLOGON_NEG_REDO |
+                  NETLOGON_NEG_PASSWORD_CHANGE_REFUSAL;
+
+       if (lp_server_schannel() != false) {
+               srv_flgs |= NETLOGON_NEG_SCHANNEL;
+       }
+
+       *r->out.negotiate_flags = srv_flgs;
+
        /* We use this as the key to store the creds: */
        /* r->in.computer_name */
 
@@ -520,26 +546,9 @@ NTSTATUS _netr_ServerAuthenticate2(pipes_struct *p,
                        r->in.account_name));
                return NT_STATUS_ACCESS_DENIED;
        }
-
-       /* 0x000001ff */
-       srv_flgs = NETLOGON_NEG_ACCOUNT_LOCKOUT |
-                  NETLOGON_NEG_PERSISTENT_SAMREPL |
-                  NETLOGON_NEG_ARCFOUR |
-                  NETLOGON_NEG_PROMOTION_COUNT |
-                  NETLOGON_NEG_CHANGELOG_BDC |
-                  NETLOGON_NEG_FULL_SYNC_REPL |
-                  NETLOGON_NEG_MULTIPLE_SIDS |
-                  NETLOGON_NEG_REDO |
-                  NETLOGON_NEG_PASSWORD_CHANGE_REFUSAL;
-
-       if (lp_server_schannel() != false) {
-               srv_flgs |= NETLOGON_NEG_SCHANNEL;
-       }
-
        /* set up the LSA AUTH 2 response */
        memcpy(r->out.return_credentials->data, &srv_chal_out.data,
               sizeof(r->out.return_credentials->data));
-       *r->out.negotiate_flags = srv_flgs;
 
        fstrcpy(p->dc->mach_acct, r->in.account_name);
        fstrcpy(p->dc->remote_machine, r->in.computer_name);