From ef4b4155107927c7ee4e2bd370d9e6fd8cbb6f00 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Sat, 30 Aug 2014 10:24:05 +0200 Subject: [PATCH] vfs_fruit: fix unpacking of AppleDouble files OS X AppleDouble files may contain a FinderInfo AppleDouble entry larger then 32 bytes containing additional packed xattrs. ad_unpack() must deal with this in a way that allows callers to possibly fixup the entry. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison Reviewed-by: Volker Lendecke --- source3/modules/vfs_fruit.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index 1226dc0e753..bdb068a7e26 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -596,12 +596,14 @@ static bool ad_unpack(struct adouble *ad, const int nentries) return false; } - if (off > bufsize) { + if ((off > bufsize) && (eid != ADEID_RFORK)) { DEBUG(1, ("bogus eid %d: off: %" PRIu32 ", len: %" PRIu32 "\n", eid, off, len)); return false; } - if ((eid != ADEID_RFORK) && ((off + len) > bufsize)) { + if ((eid != ADEID_RFORK) && + (eid != ADEID_FINDERI) && + ((off + len) > bufsize)) { DEBUG(1, ("bogus eid %d: off: %" PRIu32 ", len: %" PRIu32 "\n", eid, off, len)); return false; -- 2.11.4.GIT