1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-15 05:57:49 +03:00

vfs_fruit: use ADEDOFF_RFORK_DOT_UND offset macro in ad_convert_truncate()

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>
(cherry picked from commit b948681b2bbaba202843858857fb9edbb543bdf2)
This commit is contained in:
Ralph Boehme 2018-10-05 19:15:04 +02:00 committed by Karolin Seeger
parent 5c79f7c1ce
commit 1a67acfe25

View 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;
}