vfs_fruit: add check for OS X filler in FinderInfo conversion
authorRalph Boehme <slow@samba.org>
Mon, 8 Oct 2018 10:51:37 +0000 (12:51 +0200)
committerRalph Boehme <slow@samba.org>
Wed, 10 Oct 2018 20:22:15 +0000 (22:22 +0200)
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 <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_fruit.c

index f7cba8a072812fe2ab9f85b67c934286cd2ef9e9..9987f354d2b4defe491f22992e189de36a1198b9 100644 (file)
@@ -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) {