EC_FAIL;
}
- if (strncmp(buf + ADEDOFF_FILLER, "Mac OS X", strlen("Mac OS X")) == 0)
+ if (strncmp(buf + ADEDOFF_FILLER,
+ AD_FILLER_NETATALK,
+ strlen(AD_FILLER_NETATALK)) != 0)
/*
* It's a split fork created by OS X, it's not our "own" ._ file
* and thus not a valid header in this context.
origlen = ad_getentryoff(ad, ADEID_RFORK) + ad_getentrylen(ad, ADEID_RFORK);
- map = mmap(NULL, origlen, PROT_WRITE, MAP_SHARED, ad_reso_fileno(ad), 0);
+ map = mmap(NULL, origlen, PROT_READ | PROT_WRITE, MAP_SHARED, ad_reso_fileno(ad), 0);
if (map == MAP_FAILED) {
LOG(log_error, logtype_ad, "mmap AppleDouble: %s\n", strerror(errno));
EC_FAIL;
{
EC_INIT;
struct adouble adosx;
- char *buf = &adosx.ad_data[0];
+ char *buf;
uint16_t nentries;
int len;
ssize_t header_len;
reread:
LOG(log_debug, logtype_ad, "ad_header_read_osx: %s", path ? fullpathname(path) : "");
ad_init_old(&adosx, AD_VERSION_EA, ad->ad_options);
+ buf = &adosx.ad_data[0];
memset(buf, 0, sizeof(adosx.ad_data));
adosx.ad_rfp->adf_fd = ad_reso_fileno(ad);