]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libsmb: Fix removing a rogue reparse point
authorVolker Lendecke <vl@samba.org>
Thu, 10 Nov 2022 16:40:22 +0000 (17:40 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 22 Nov 2022 18:27:33 +0000 (18:27 +0000)
If you set a reparse point for which Windows server does not have a
handler, it returns NT_STATUS_IO_REPARSE_TAG_NOT_HANDLED when you
later open it without FILE_OPEN_REPARSE_POINT.

See the discussion thread starting with
https://lists.samba.org/archive/cifs-protocol/2022-November/003888.html

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/libsmb/cli_smb2_fnum.c

index c7d5ac70dcd536e6f4d5ac62445adddc9e874bb5..561ea527fc4830e6c74944b293dec62776a72c07 100644 (file)
@@ -1101,7 +1101,8 @@ static void cli_smb2_unlink_opened1(struct tevent_req *subreq)
        status = cli_smb2_create_fnum_recv(subreq, &fnum, NULL, NULL, NULL);
        TALLOC_FREE(subreq);
 
-       if (NT_STATUS_EQUAL(status, NT_STATUS_STOPPED_ON_SYMLINK)) {
+       if (NT_STATUS_EQUAL(status, NT_STATUS_STOPPED_ON_SYMLINK) ||
+           NT_STATUS_EQUAL(status, NT_STATUS_IO_REPARSE_TAG_NOT_HANDLED)) {
                /*
                 * Naive option to match our SMB1 code. Assume the
                 * symlink path that tripped us up was the last