From 066d0ee3c9ab97ac263e4c1b88d02ac0e9f339d6 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Tue, 9 Oct 2018 10:15:37 +0200 Subject: [PATCH] vfs_fruit: move check in ad_convert() to ad_convert_*() subfunctions MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Currently the whole conversion is skipped if the FinderInfo entry in the AppleDouble file is of the default size (ie not containing xattrs). That also means we never converted FinderInfo from the AppleDouble file to stream format. This change finally fixes this. Note that this keeps failing with streams_depot, much like the existing known-fail of "samba3.vfs.fruit streams_depot.OS X AppleDouble file conversion". Fixing the conversion to work with vfs_streams_depot is a task for another day. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13649 Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison Autobuild-User(master): Ralph Böhme Autobuild-Date(master): Thu Oct 11 01:30:13 CEST 2018 on sn-devel-144 (cherry picked from commit 31daab88e6a415e72ead69844e3eccf5dc02e53c) Autobuild-User(v4-8-test): Karolin Seeger Autobuild-Date(v4-8-test): Thu Oct 18 17:37:52 CEST 2018 on sn-devel-144 --- selftest/knownfail.d/samba3.vfs.fruit | 2 -- source3/modules/vfs_fruit.c | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/selftest/knownfail.d/samba3.vfs.fruit b/selftest/knownfail.d/samba3.vfs.fruit index bc46c2f4922..6307e2b3404 100644 --- a/selftest/knownfail.d/samba3.vfs.fruit +++ b/selftest/knownfail.d/samba3.vfs.fruit @@ -1,4 +1,2 @@ ^samba3.vfs.fruit streams_depot.OS X AppleDouble file conversion\(nt4_dc\) -^samba3.vfs.fruit metadata_netatalk.OS X AppleDouble file conversion without embedded xattr\(nt4_dc\) -^samba3.vfs.fruit metadata_stream.OS X AppleDouble file conversion without embedded xattr\(nt4_dc\) ^samba3.vfs.fruit streams_depot.OS X AppleDouble file conversion without embedded xattr\(nt4_dc\) diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index 26d75d61196..200ef4a99f5 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -1010,6 +1010,10 @@ static bool ad_convert_xattr(struct adouble *ad, *converted_xattr = false; + if (ad_getentrylen(ad, ADEID_FINDERI) == ADEDLEN_FINDERI) { + return true; + } + if (ad->adx_header.adx_num_attrs == 0) { return true; } @@ -1296,10 +1300,6 @@ static int ad_convert(struct adouble *ad, bool ok; bool converted_xattr = false; - if (ad_getentrylen(ad, ADEID_FINDERI) == ADEDLEN_FINDERI) { - return 0; - } - ok = ad_convert_xattr(ad, smb_fname, &converted_xattr); if (!ok) { return -1; -- 2.47.2