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 11:17:52 +0000 (13:17 +0200)
Guenther

source3/rpc_server/srv_netlog_nt.c

index 73d1f4b1a54322885a13502038a9b6d3c7613baa..7f45a4809c4f9c8cf24229459eca40bbb3489b25 100644 (file)
@@ -882,6 +882,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;
@@ -889,12 +896,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) {