From: Ralph Boehme Date: Mon, 8 Oct 2018 10:51:37 +0000 (+0200) Subject: vfs_fruit: add check for OS X filler in FinderInfo conversion X-Git-Tag: samba-4.8.8~117 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85519ed98181dd2631d82095a0c508092b19963a;p=thirdparty%2Fsamba.git vfs_fruit: add check for OS X filler in FinderInfo conversion This ensures that the function only acts on AppleDouble files created by macOS and not AppleDouble files created by us that are already in the correct format (only using the Resource Fork). Bug: https://bugzilla.samba.org/show_bug.cgi?id=13649 Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison (cherry picked from commit 5598e6bc3583a88f474afa2996d1f9362d1bd9fb) --- diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index 8e486c20ec4..9126e1237db 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -1169,6 +1169,12 @@ static bool ad_convert_finderinfo(struct adouble *ad, ssize_t nwritten; NTSTATUS status; int saved_errno = 0; + int cmp; + + cmp = memcmp(ad->ad_filler, AD_FILLER_TAG_OSX, ADEDLEN_FILLER); + if (cmp != 0) { + return true; + } p_ad = ad_get_entry(ad, ADEID_FINDERI); if (p_ad == NULL) {