s3-netlogon: Fix _netr_LogonSamLogon{Ex} with validation level != 3.
authorGünther Deschner <gd@samba.org>
Fri, 29 May 2009 11:15:27 +0000 (13:15 +0200)
committerGünther Deschner <gd@samba.org>
Fri, 29 May 2009 23:55:47 +0000 (01:55 +0200)
Guenther
(cherry picked from commit 90b38906541de554e3964d96ed83a7c71b5ea05c)

source3/rpc_server/srv_netlog_nt.c

index 3ca2dae88b4d8e02f69e5c9f85a2c395161fc38a..79606ab56e7aeb1ac32c9a5e7949538da2c4b2d6 100644 (file)
@@ -881,6 +881,13 @@ NTSTATUS _netr_LogonSamLogon(pipes_struct *p,
                return NT_STATUS_ACCESS_DENIED;
        }
 
+       *r->out.authoritative = true; /* authoritative response */
+       if (r->in.validation_level != 2 && r->in.validation_level != 3) {
+               DEBUG(0,("%s: bad validation_level value %d.\n",
+                       fn, (int)r->in.validation_level));
+               return NT_STATUS_INVALID_INFO_CLASS;
+       }
+
        sam3 = TALLOC_ZERO_P(p->mem_ctx, struct netr_SamInfo3);
        if (!sam3) {
                return NT_STATUS_NO_MEMORY;
@@ -888,12 +895,6 @@ NTSTATUS _netr_LogonSamLogon(pipes_struct *p,
 
        /* store the user information, if there is any. */
        r->out.validation->sam3 = sam3;
-       *r->out.authoritative = true; /* authoritative response */
-       if (r->in.validation_level != 2 && r->in.validation_level != 3) {
-               DEBUG(0,("%s: bad validation_level value %d.\n",
-                       fn, (int)r->in.validation_level));
-               return NT_STATUS_INVALID_INFO_CLASS;
-       }
 
        if (process_creds) {