vfs_fruit: Don't unlink the main file
authorVolker Lendecke <vl@samba.org>
Tue, 7 Aug 2018 13:10:31 +0000 (15:10 +0200)
committerVolker Lendecke <vl@samba.org>
Thu, 23 Aug 2018 13:28:47 +0000 (15:28 +0200)
The original fix for bug 13441 was missing a check that verifies that
fruit_ftruncate() is actually called on a stream.

Follow-up to

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

Pair-Programmed-With: Volker Lendecke <vl@samba.org>

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Aug 23 15:28:48 CEST 2018 on sn-devel-144

selftest/knownfail.d/samba3.vfs.fruit
source3/modules/vfs_fruit.c

index d858452eb522d4d0823056ba1109ac425662ba52..8df25bccb79b6474aac2a6faab4df7495336612f 100644 (file)
@@ -1,2 +1 @@
 ^samba3.vfs.fruit streams_depot.OS X AppleDouble file conversion\(nt4_dc\)
-^samba3.vfs.fruit .*.setinfo eof stream\(nt4_dc\)
index ebf0f9842f008277cfca6991af0d72ca7225a5cb..1102059bbee90a74cb49e6434a1d55f7858a81cc 100644 (file)
@@ -5570,7 +5570,11 @@ static int fruit_ftruncate(struct vfs_handle_struct *handle,
                  (intmax_t)offset);
 
        if (fio == NULL) {
-               if (offset == 0 && global_fruit_config.nego_aapl) {
+               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);