vfs_fruit: use ADEDOFF_RFORK_DOT_UND offset macro in ad_convert_truncate()
authorRalph Boehme <slow@samba.org>
Fri, 5 Oct 2018 17:15:04 +0000 (19:15 +0200)
committerRalph Boehme <slow@samba.org>
Wed, 10 Oct 2018 20:22:14 +0000 (22:22 +0200)
We really want the fixed size offset here, not a calculated one. Note
that "ad_getentryoff(ad, ADEID_RFORK)" is equal to ADEDOFF_RFORK_DOT_UND
in this case.

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

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

index 41476625b33706d895c87a06c8fd793fc924d644..02db5923c6a35d25b87e8e98134236ea6cfae6aa 100644 (file)
@@ -1161,8 +1161,8 @@ static bool ad_convert_truncate(struct adouble *ad,
         * FIXME: direct ftruncate(), but we don't have a fsp for the
         * VFS call
         */
-       rc = ftruncate(ad->ad_fd, ad_getentryoff(ad, ADEID_RFORK)
-                      ad_getentrylen(ad, ADEID_RFORK));
+       rc = ftruncate(ad->ad_fd, ADEDOFF_RFORK_DOT_UND +
+                      ad_getentrylen(ad, ADEID_RFORK));
        if (rc != 0) {
                return false;
        }