]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Allow SMB1+UNIX extensions rename of dangling symlink.
authorJeremy Allison <jra@samba.org>
Fri, 21 May 2021 17:53:49 +0000 (10:53 -0700)
committerNoel Power <npower@samba.org>
Mon, 24 May 2021 17:47:40 +0000 (17:47 +0000)
Remove knownfail. Only in master, so no bug number needed.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Mon May 24 17:47:40 UTC 2021 on sn-devel-184

selftest/knownfail.d/posix_symlink_rename [deleted file]
source3/smbd/reply.c

diff --git a/selftest/knownfail.d/posix_symlink_rename b/selftest/knownfail.d/posix_symlink_rename
deleted file mode 100644 (file)
index b0889e7..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-^samba3.smbtorture_s3.plain.POSIX-SYMLINK-RENAME.smbtorture\(nt4_dc_smb1\)
-^samba3.smbtorture_s3.crypt.POSIX-SYMLINK-RENAME.smbtorture\(nt4_dc_smb1\)
index 27e9b5f904f77a07656742b4d42de5700d9e5914..1b670020143408933201dcc25d9265682aed3f1c 100644 (file)
@@ -8044,7 +8044,19 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx,
 
                status = openat_pathref_fsp(conn->cwd_fsp, smb_fname_src);
                if (!NT_STATUS_IS_OK(status)) {
-                       goto out;
+                       if (!NT_STATUS_EQUAL(status,
+                                       NT_STATUS_OBJECT_NAME_NOT_FOUND)) {
+                               goto out;
+                       }
+                       /*
+                        * Possible symlink src.
+                        */
+                       if (!(smb_fname_src->flags & SMB_FILENAME_POSIX_PATH)) {
+                               goto out;
+                       }
+                       if (!S_ISLNK(smb_fname_src->st.st_ex_mode)) {
+                               goto out;
+                       }
                }
 
                if (S_ISDIR(smb_fname_src->st.st_ex_mode)) {