summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2021-12-07 22:19:29 -0800
committerJule Anger <janger@samba.org>2022-01-31 12:23:53 +0100
commite7d0d40e684702d7fcbb781e0f6c072be86a1386 (patch)
tree35a5a2850a3ec943a24563645c3d1718231576fc
parentd46ffccc0780b9ef6b5a49e3e17b665345bd4362 (diff)
downloadsamba-e7d0d40e684702d7fcbb781e0f6c072be86a1386.tar.gz
CVE-2021-44141: s3: smbd: Inside rename_internals_fsp(), we must use vfs_stat() for existence, not SMB_VFS_STAT().
We need to take SMB1+POSIX into account here and do an LSTAT if it's a POSIX name. Remove knownfail.d/posix_sylink_rename BUG: https://bugzilla.samba.org/show_bug.cgi?id=14911 Signed-off-by: Jeremy Allison <jra@samba.org>
-rw-r--r--selftest/knownfail.d/posix_sylink_rename1
-rw-r--r--source3/smbd/reply.c2
2 files changed, 1 insertions, 2 deletions
diff --git a/selftest/knownfail.d/posix_sylink_rename b/selftest/knownfail.d/posix_sylink_rename
deleted file mode 100644
index 9c3cc0a41ba..00000000000
--- a/selftest/knownfail.d/posix_sylink_rename
+++ /dev/null
@@ -1 +0,0 @@
-^samba3.blackbox.test_symlink_rename.SMB1.posix.symlink_rename_SMB1_posix\(fileserver_smb1_done\)
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index cc95bfa3af0..69278a1da87 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -7266,7 +7266,7 @@ NTSTATUS rename_internals_fsp(connection_struct *conn,
goto out;
}
- dst_exists = SMB_VFS_STAT(conn, smb_fname_dst) == 0;
+ dst_exists = vfs_stat(conn, smb_fname_dst) == 0;
if(!replace_if_exists && dst_exists) {
DEBUG(3, ("rename_internals_fsp: dest exists doing rename "