From: Ralph Boehme Date: Mon, 8 Oct 2018 16:47:32 +0000 (+0200) Subject: vfs_fruit: make call to ad_convert_truncate() optional X-Git-Tag: samba-4.8.8~115 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3ab52d3f482272adb83b5058dfb1b7dce9070b4;p=thirdparty%2Fsamba.git vfs_fruit: make call to ad_convert_truncate() optional Call ad_convert_truncate() based on whether the previous call ad_convert_xattr() returned converted_xattr=true. Upcoming fixes for a different Samba bug (#13642) will hook into calling ad_convert_truncate() in other cases, this also prepares for that. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13649 Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison (cherry picked from commit 9cf087a474bb2d7d29ca0daeaef412f6b545d0e0) --- diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index dd312da895b..26d75d61196 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -1305,9 +1305,11 @@ static int ad_convert(struct adouble *ad, return -1; } - ok = ad_convert_truncate(ad, smb_fname); - if (!ok) { - return -1; + if (converted_xattr) { + ok = ad_convert_truncate(ad, smb_fname); + if (!ok) { + return -1; + } } ok = ad_convert_finderinfo(ad, smb_fname);