]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_fruit: move check in ad_convert() to ad_convert_*() subfunctions
authorRalph Boehme <slow@samba.org>
Tue, 9 Oct 2018 08:15:37 +0000 (10:15 +0200)
committerKarolin Seeger <kseeger@samba.org>
Thu, 18 Oct 2018 15:37:52 +0000 (17:37 +0200)
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 <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
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 <kseeger@samba.org>
Autobuild-Date(v4-8-test): Thu Oct 18 17:37:52 CEST 2018 on sn-devel-144

selftest/knownfail.d/samba3.vfs.fruit
source3/modules/vfs_fruit.c

index bc46c2f4922ed44b7aef494b0df1198ea8423604..6307e2b34043b5f960a67ad7861eeb004b5bed3e 100644 (file)
@@ -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\)
index 26d75d61196863d6ef40fc2ef0ae58c29630caab..200ef4a99f5909a245b77a7d46e8f2c7bbb868eb 100644 (file)
@@ -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;