mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
vfs_fruit: store filler bytes from AppleDouble file header in struct adouble
This can later be used to distinguish between macOS created AppleDouble files and AppleDouble files created by Samba or Netatalk. macOS: "Mac OS X " Samba: "Netatalk " Netatalk: "Netatalk " 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>
This commit is contained in:
parent
7e010abbaa
commit
8ee7e6135e
@ -262,6 +262,7 @@ typedef enum {ADOUBLE_META, ADOUBLE_RSRC} adouble_type_t;
|
||||
#define ADEDLEN_VERSION 4
|
||||
#define ADEDLEN_FILLER 16
|
||||
#define AD_FILLER_TAG "Netatalk " /* should be 16 bytes */
|
||||
#define AD_FILLER_TAG_OSX "Mac OS X " /* should be 16 bytes */
|
||||
#define ADEDLEN_NENTRIES 2
|
||||
#define AD_HEADER_LEN (ADEDLEN_MAGIC + ADEDLEN_VERSION + \
|
||||
ADEDLEN_FILLER + ADEDLEN_NENTRIES) /* 26 */
|
||||
@ -414,6 +415,7 @@ struct adouble {
|
||||
adouble_type_t ad_type;
|
||||
uint32_t ad_magic;
|
||||
uint32_t ad_version;
|
||||
uint8_t ad_filler[ADEDLEN_FILLER];
|
||||
struct ad_entry ad_eid[ADEID_MAX];
|
||||
char *ad_data;
|
||||
struct ad_xattr_header adx_header;
|
||||
@ -837,6 +839,8 @@ static bool ad_unpack(struct adouble *ad, const size_t nentries,
|
||||
return false;
|
||||
}
|
||||
|
||||
memcpy(ad->ad_filler, ad->ad_data + ADEDOFF_FILLER, ADEDLEN_FILLER);
|
||||
|
||||
adentries = RSVAL(ad->ad_data, ADEDOFF_NENTRIES);
|
||||
if (adentries != nentries) {
|
||||
DEBUG(1, ("invalid number of entries: %zu\n",
|
||||
|
Loading…
Reference in New Issue
Block a user