From 9f913fdad8cce170031738c1fbe70f51d80f533c Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Fri, 5 Oct 2018 16:26:46 +0200 Subject: [PATCH] vfs_fruit: move FinderInfo lenght check to ad_convert() 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 Reviewed-by: Jeremy Allison (cherry picked from commit 4f1174b6eb2257d789a1eb9c925ccc561bab2f16) --- source3/modules/vfs_fruit.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index 3acd43698d0..aa49422ee67 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -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. -- 2.47.2