]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: return correct error for compound related requests that went async
authorRalph Boehme <slow@samba.org>
Mon, 26 Aug 2024 08:48:34 +0000 (10:48 +0200)
committerRalph Boehme <slow@samba.org>
Thu, 31 Oct 2024 11:33:31 +0000 (11:33 +0000)
For a compound related request chain of eg CREATE+NOTIFY+GETINFO, the NOTIFY
will typically go async. When this is noted in smbd_smb2_request_pending_queue()
the pending async tevent_req is cancelled which means we return
NT_STATUS_CANCELLED to the client while Windows returns
NT_STATUS_INTERNAL_ERROR.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15697

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
selftest/knownfail
source3/smbd/smb2_server.c

index 31e70a1a9d345d143428b7f1b5c1b8d6c7fd45ff..5f64e4edad05b224a59f3b70518107b0ae0ea4f1 100644 (file)
 ^samba3.smb2.getinfo.fsinfo # quotas don't work yet
 ^samba3.smb2.setinfo.setinfo
 ^samba3.smb2.session.*reauth5 # some special anonymous checks?
-^samba3.smb2.compound.interim2 # wrong return code (STATUS_CANCELLED)
-^samba3.smb2.compound.aio.interim2 # wrong return code (STATUS_CANCELLED)
 ^samba3.smb2.lock.*replay_broken_windows # This tests the windows behaviour
 ^samba3.smb2.lease.unlink # we currently do not downgrade RH lease to R after unlink
 ^samba4.smb2.ioctl.compress_notsup.*\(ad_dc_ntvfs\)
index b37829e8c4f8f398e4e81a20eefab7442119da3b..287d9844e842c71de2692433cc3b208705530af1 100644 (file)
@@ -4076,6 +4076,16 @@ NTSTATUS smbd_smb2_request_error_ex(struct smbd_smb2_request *req,
                }
        }
 
+       if (req->compound_related &&
+           NT_STATUS_EQUAL(status, NT_STATUS_CANCELLED))
+       {
+               /*
+                * A compound request went async but was cancelled as it was not
+                * one of the allowed async compound requests.
+                */
+               status = NT_STATUS_INTERNAL_ERROR;
+       }
+
        body.data = outhdr + SMB2_HDR_BODY;
        body.length = 8;
        SSVAL(body.data, 0, 9);