From: Volker Lendecke Date: Thu, 10 Nov 2022 16:40:22 +0000 (+0100) Subject: libsmb: Fix removing a rogue reparse point X-Git-Tag: talloc-2.4.0~518 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4c45decd410c6012b21eebb786bf252665570ad;p=thirdparty%2Fsamba.git libsmb: Fix removing a rogue reparse point 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 Reviewed-by: Jeremy Allison --- diff --git a/source3/libsmb/cli_smb2_fnum.c b/source3/libsmb/cli_smb2_fnum.c index c7d5ac70dcd..561ea527fc4 100644 --- a/source3/libsmb/cli_smb2_fnum.c +++ b/source3/libsmb/cli_smb2_fnum.c @@ -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