]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_fruit: move FinderInfo lenght check to ad_convert()
authorRalph Boehme <slow@samba.org>
Fri, 5 Oct 2018 14:26:46 +0000 (16:26 +0200)
committerKarolin Seeger <kseeger@samba.org>
Thu, 18 Oct 2018 11:00:10 +0000 (13:00 +0200)
The final step in consolidating all conversion related work in
ad_convert(). No change in behaviour.

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 4f1174b6eb2257d789a1eb9c925ccc561bab2f16)

source3/modules/vfs_fruit.c

index 3acd43698d0b572ec8247c591d0a6a7dbfe1f757..aa49422ee67ef4ae8de6b35493d990f961a496c3 100644 (file)
@@ -1170,6 +1170,10 @@ static int ad_convert(struct adouble *ad,
        ssize_t len;
        bool ok;
 
+       if (ad_getentrylen(ad, ADEID_FINDERI) == ADEDLEN_FINDERI) {
+               return 0;
+       }
+
        origlen = ad_getentryoff(ad, ADEID_RFORK) +
                ad_getentrylen(ad, ADEID_RFORK);
 
@@ -1485,10 +1489,6 @@ static ssize_t ad_read_rsrc_adouble(struct adouble *ad,
                return -1;
        }
 
-       if (ad_getentrylen(ad, ADEID_FINDERI) == ADEDLEN_FINDERI) {
-               return len;
-       }
-
        /*
         * Try to fixup AppleDouble files created by OS X with xattrs
         * appended to the ADEID_FINDERI entry.