]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_fruit: make call to ad_convert_truncate() optional
authorRalph Boehme <slow@samba.org>
Mon, 8 Oct 2018 16:47:32 +0000 (18:47 +0200)
committerKarolin Seeger <kseeger@samba.org>
Thu, 18 Oct 2018 11:00:11 +0000 (13:00 +0200)
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 <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 9cf087a474bb2d7d29ca0daeaef412f6b545d0e0)

source3/modules/vfs_fruit.c

index dd312da895be0f1a4850e0bcf9d18aa5b438da39..26d75d61196863d6ef40fc2ef0ae58c29630caab 100644 (file)
@@ -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);