vfs_fruit: update rfork size in AppleDouble header
authorRalph Boehme <rb@sernet.de>
Mon, 15 Sep 2014 11:53:22 +0000 (13:53 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 25 Sep 2014 21:43:35 +0000 (23:43 +0200)
Update the AppleDouble entry with the new size when ftruncating a
resource fork.

Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Sep 25 23:43:35 CEST 2014 on sn-devel-104

source3/modules/vfs_fruit.c

index 458904edc9acb7ca5cb429577caf020b5cc99083..0441d5ebd48501fb969fa76f14ed0e512d1d6709 100644 (file)
@@ -2824,6 +2824,14 @@ static int fruit_ftruncate(struct vfs_handle_struct *handle,
                        rc = SMB_VFS_NEXT_FTRUNCATE(
                                handle, fsp,
                                offset + ad_getentryoff(ad, ADEID_RFORK));
+                       if (rc != 0) {
+                               return -1;
+                       }
+                       ad_setentrylen(ad, ADEID_RFORK, offset);
+                       rc = ad_write(ad, NULL);
+                       if (rc != 0) {
+                               return -1;
+                       }
                }
                break;
        default: