s4:rpc_server/netlogon: netr_ServerAuthenticate3 should check the challenge after...
authorStefan Metzmacher <metze@samba.org>
Sat, 23 Oct 2010 09:01:43 +0000 (11:01 +0200)
committerStefan Metzmacher <metze@samba.org>
Sat, 23 Oct 2010 09:01:43 +0000 (11:01 +0200)
metze

source4/rpc_server/netlogon/dcerpc_netlogon.c

index b4c58e3babb889ceaea4f1b2b9cbc3aca85b537b..0f4d7465b5b1d3b736bdbc02b373b8166f8fdb32 100644 (file)
@@ -125,11 +125,6 @@ static NTSTATUS dcesrv_netr_ServerAuthenticate3(struct dcesrv_call_state *dce_ca
                                  NETLOGON_NEG_AUTHENTICATED_RPC_LSASS |
                                  NETLOGON_NEG_AUTHENTICATED_RPC;
 
-       if (!pipe_state) {
-               DEBUG(1, ("No challenge requested by client, cannot authenticate\n"));
-               return NT_STATUS_ACCESS_DENIED;
-       }
-
        sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx,
                                system_session(dce_call->conn->dce_ctx->lp_ctx), 0);
        if (sam_ctx == NULL) {
@@ -239,6 +234,11 @@ static NTSTATUS dcesrv_netr_ServerAuthenticate3(struct dcesrv_call_state *dce_ca
                return NT_STATUS_ACCESS_DENIED;
        }
 
+       if (!pipe_state) {
+               DEBUG(1, ("No challenge requested by client, cannot authenticate\n"));
+               return NT_STATUS_ACCESS_DENIED;
+       }
+
        creds = netlogon_creds_server_init(mem_ctx,
                                           r->in.account_name,
                                           r->in.computer_name,