s3:smbd: don't allow renaming basefile if streams are open
authorRalph Boehme <slow@samba.org>
Sat, 26 May 2018 16:32:21 +0000 (18:32 +0200)
committerKarolin Seeger <kseeger@samba.org>
Thu, 12 Jul 2018 11:10:26 +0000 (13:10 +0200)
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13451

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 465b7d07e5db787c3d6330371e5e42ecbb1b57b9)

selftest/knownfail.d/samba3.smb2.streams [deleted file]
selftest/knownfail.d/samba3.vfs.fruit
source3/smbd/reply.c

diff --git a/selftest/knownfail.d/samba3.smb2.streams b/selftest/knownfail.d/samba3.smb2.streams
deleted file mode 100644 (file)
index 26d40a6..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-samba3.smb2.streams.basefile-rename-with-open-stream\(.*\)
-samba3.smb2.streams streams_xattr.basefile-rename-with-open-stream\(nt4_dc\)
index bf97dbc5822f9bd25d52ba00548ba86b5416c8ef..8df25bccb79b6474aac2a6faab4df7495336612f 100644 (file)
@@ -1,4 +1 @@
 ^samba3.vfs.fruit streams_depot.OS X AppleDouble file conversion\(nt4_dc\)
-^samba3.vfs.fruit metadata_netatalk.read open rsrc after rename\(nt4_dc\)
-^samba3.vfs.fruit metadata_stream.read open rsrc after rename\(nt4_dc\)
-^samba3.vfs.fruit streams_depot.read open rsrc after rename\(nt4_dc\)
index 623f83b1250e787b4d363cd4382abe72f836913b..2b5bb8f1ed6469dce6feaa21f76470388f2ffb27 100644 (file)
@@ -6642,6 +6642,10 @@ NTSTATUS rename_internals_fsp(connection_struct *conn,
                return status;
        }
 
+       if (file_has_open_streams(fsp)) {
+               return NT_STATUS_ACCESS_DENIED;
+       }
+
        /* Make a copy of the dst smb_fname structs */
 
        smb_fname_dst = cp_smb_filename(ctx, smb_fname_dst_in);