vfs_fruit: use VFS function in ad_convert_truncate()
authorRalph Boehme <slow@samba.org>
Fri, 24 May 2019 10:07:55 +0000 (12:07 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 30 May 2019 20:19:27 +0000 (20:19 +0000)
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_fruit.c

index f7fc4feedbb48d1f8c9979523d05a3e6a1b95f5a..0502dd51b2f46e63b3d2cd61c30e5bfa8e80b107 100644 (file)
@@ -1314,13 +1314,11 @@ static bool ad_convert_truncate(vfs_handle_struct *handle,
                                const struct smb_filename *smb_fname)
 {
        int rc;
+       off_t newlen;
 
-       /*
-        * FIXME: direct ftruncate(), but we don't have a fsp for the
-        * VFS call
-        */
-       rc = ftruncate(ad->ad_fsp->fh->fd, ADEDOFF_RFORK_DOT_UND +
-                      ad_getentrylen(ad, ADEID_RFORK));
+       newlen = ADEDOFF_RFORK_DOT_UND + ad_getentrylen(ad, ADEID_RFORK);
+
+       rc = SMB_VFS_FTRUNCATE(ad->ad_fsp, newlen);
        if (rc != 0) {
                return false;
        }