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)
committerRalph Boehme <slow@samba.org>
Wed, 10 Oct 2018 20:22:14 +0000 (22:22 +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>
source3/modules/vfs_fruit.c

index 5706ed1eae2f038cf76ecb510bc2305a0b820ea3..73605c63445e9fcd81d419b7b8a083c24ff64499 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.