server prepare...
[metze/samba/wip.git] / source / smb_server / smb / receive.c
index 0afa3a652d5d02486fe4da10490c237b8325fa55..fd2810e54a3810cbc98bce3b704e654075b0c5c4 100644 (file)
@@ -442,11 +442,6 @@ NTSTATUS smbsrv_recv_smb_request(void *private, DATA_BLOB blob)
        /* fix the bufinfo */
        smbsrv_setup_bufinfo(req);
 
-       if (!smbsrv_signing_check_incoming(req)) {
-               smbsrv_send_error(req, NT_STATUS_ACCESS_DENIED);
-               return NT_STATUS_OK;
-       }
-
        command = CVAL(req->in.hdr, HDR_COM);
        switch_message(command, req);
        return NT_STATUS_OK;
@@ -483,14 +478,19 @@ static void switch_message(int type, struct smbsrv_request *req)
 
        errno = 0;
 
+       flags = smb_messages[type].flags;
+
+       if (!smbsrv_signing_check_incoming(req, (flags & SIGNING_NO_REPLY))) {
+               smbsrv_send_error(req, NT_STATUS_ACCESS_DENIED);
+               return;
+       }
+
        if (smb_messages[type].fn == NULL) {
                DEBUG(0,("Unknown message type %d!\n",type));
                smbsrv_reply_unknown(req);
                return;
        }
 
-       flags = smb_messages[type].flags;
-
        req->tcon = smbsrv_smb_tcon_find(smb_conn, SVAL(req->in.hdr,HDR_TID), req->request_time);
 
        if (!req->session) {
@@ -511,11 +511,6 @@ static void switch_message(int type, struct smbsrv_request *req)
        DEBUG(5,("switch message %s (task_id %u)\n",
                 smb_fn_name(type), (unsigned)req->smb_conn->connection->server_id.id));
 
-       /* this must be called before we do any reply */
-       if (flags & SIGNING_NO_REPLY) {
-               smbsrv_signing_no_reply(req);
-       }
-
        /* see if the vuid is valid */
        if ((flags & NEED_SESS) && !req->session) {
                status = NT_STATUS_DOS(ERRSRV, ERRbaduid);