r7523: blergh
authorAndrew Tridgell <tridge@samba.org>
Mon, 13 Jun 2005 07:11:29 +0000 (07:11 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:18:06 +0000 (13:18 -0500)
the error code for an invalid tid depends on the command

source/smb_server/smb_server.c

index 86aa46ba9aacb82501a8e811825dd2cca6451102..3b4d06f3b27086d44470de1cc5747c83ac4498ad 100644 (file)
@@ -511,7 +511,12 @@ static void switch_message(int type, struct smbsrv_request *req)
 
        /* does this protocol need a valid tree connection? */
        if ((flags & AS_USER) && !req->tcon) {
-               req_reply_error(req, NT_STATUS_DOS(ERRSRV, ERRinvnid));
+               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);
+               }
                return;
        }