r11640: just a nicer format, and make adding more special cases easier
authorStefan Metzmacher <metze@samba.org>
Thu, 10 Nov 2005 12:59:15 +0000 (12:59 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:46:05 +0000 (13:46 -0500)
metze
(This used to be commit 5fb5d1a864d9df0ac82fca145b51fdb27406bc97)

source4/smb_server/smb_server.c

index c8d411af162d3ecf9c652072466571f3446ba3e3..0a28023e467eee0d22e1edff8d7d92ce2c0d60b7 100644 (file)
@@ -450,11 +450,14 @@ static void switch_message(int type, struct smbsrv_request *req)
 
        /* does this protocol need a valid tree connection? */
        if ((flags & AS_USER) && !req->tcon) {
-               if (type == SMBntcreateX) {
-                       /* amazingly, the error code depends on the command */
-                       req_reply_error(req, NT_STATUS_DOS(ERRSRV, ERRinvnid));
-               } else {
-                       req_reply_error(req, NT_STATUS_INVALID_HANDLE);
+               /* amazingly, the error code depends on the command */
+               switch (type) {
+                       case SMBntcreateX:
+                               req_reply_error(req, NT_STATUS_DOS(ERRSRV, ERRinvnid));
+                               break;
+                       default:
+                               req_reply_error(req, NT_STATUS_INVALID_HANDLE);
+                               break;
                }
                return;
        }