summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalph Boehme <rb@sernet.de>2014-08-30 10:24:05 +0200
committerJeremy Allison <jra@samba.org>2014-09-25 21:19:12 +0200
commitef4b4155107927c7ee4e2bd370d9e6fd8cbb6f00 (patch)
treec8bef9ef375512e4d6d320b436850b9687d28b13
parent5e5f060907a2de0c0de3f8bde4656610c48d81e0 (diff)
downloadsamba-ef4b4155107927c7ee4e2bd370d9e6fd8cbb6f00.tar.gz
samba-ef4b4155107927c7ee4e2bd370d9e6fd8cbb6f00.tar.xz
samba-ef4b4155107927c7ee4e2bd370d9e6fd8cbb6f00.zip
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 <rb@sernet.de> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
-rw-r--r--source3/modules/vfs_fruit.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
index 1226dc0e75..bdb068a7e2 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;