]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_fruit: don't unlink 0-byte size truncated streams
authorRalph Boehme <slow@samba.org>
Sat, 20 Oct 2018 12:54:48 +0000 (14:54 +0200)
committerKarolin Seeger <kseeger@samba.org>
Tue, 6 Nov 2018 08:10:24 +0000 (09:10 +0100)
This caused all sort of havoc with subsequent SMB request that acted on
the handle of the then deleted backend storage (file or blob, depending
on the used streams module).

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13646

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

source3/modules/vfs_fruit.c

index dfb1ba446e496ac10794d2cfde178dff1ca5cd3f..80b125a30199463765e04b37f968572bf6242ec2 100644 (file)
@@ -5791,13 +5791,6 @@ static int fruit_ftruncate(struct vfs_handle_struct *handle,
                  (intmax_t)offset);
 
        if (fio == NULL) {
-               if (offset == 0 &&
-                   global_fruit_config.nego_aapl &&
-                   is_ntfs_stream_smb_fname(fsp->fsp_name) &&
-                   !is_ntfs_default_stream_smb_fname(fsp->fsp_name))
-               {
-                       return SMB_VFS_NEXT_UNLINK(handle, fsp->fsp_name);
-               }
                return SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset);
        }