s3:smbd: correctly copy the error logic from samba4 for invalid tree ids
authorStefan Metzmacher <metze@samba.org>
Thu, 3 May 2012 13:49:45 +0000 (15:49 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 16 May 2012 06:10:07 +0000 (08:10 +0200)
Jeremy, you inversed the logic with commit
a59149b86a36cd8b51ad5ae11b4d2b0714bb5e9c :-)

Found by the raw.context test.

metze

source3/smbd/process.c

index 087326205c3dddc479df242f24c7643224b117c2..10d1df13740b258bc8621c4ef419ff52c85e3694 100644 (file)
@@ -1413,10 +1413,17 @@ static connection_struct *switch_message(uint8 type, struct smb_request *req)
                         * Amazingly, the error code depends on the command
                         * (from Samba4).
                         */
-                       if (type == SMBntcreateX) {
-                               reply_nterror(req, NT_STATUS_INVALID_HANDLE);
-                       } else {
-                               reply_nterror(req, NT_STATUS_NETWORK_NAME_DELETED);
+                       switch (type) {
+                       case SMBntcreateX:
+                       case SMBntcancel:
+                       case SMBtdis:
+                               reply_force_doserror(req, ERRSRV, ERRinvnid);
+                               break;
+                       default:
+                               reply_botherror(req,
+                                               NT_STATUS_INVALID_HANDLE,
+                                               ERRSRV, ERRinvnid);
+                               break;
                        }
                        return NULL;
                }