]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
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)
committerKarolin Seeger <kseeger@samba.org>
Fri, 21 Jun 2019 07:56:20 +0000 (07:56 +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>
(cherry picked from commit 3739ad90cf2bbaa2094a34197c894363d2e24a5a)

source3/modules/vfs_fruit.c

index 79a7f5ca2a9dd2a6335f4a3e799a79271fd39715..2fd40338b71f405e34ec0d48a90c4771729b31f8 100644 (file)
@@ -1312,13 +1312,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;
        }