The current code that checks whether the client is allowed to use
pathnames starting with ._ checks whether the file is an AppleDouble
file, and if it is and the filler does not contain the magic string
"Mac OS X", access to the file is denied. This results in the
following sequence of steps:
* client created empty file "._NAME"
* client wants to stat the newly created file "._NAME"
* server checks whether access to the file is allowed
* check fails
Modify check in ad_valid_header_osx() to allow access to all .-
AppleDouble files where the filler string is not "Netatalk", which is
the magic string Netatalk puts there.
Signed-off-by: Ralph Boehme <rb@sernet.de>
* UPD: Spotlight: more SPARQL query optimisations
* UPD: Spotlight: new options "sparql results limit", "spotlight
attributes" and "spotlight expr"
* UPD: Spotlight: more SPARQL query optimisations
* UPD: Spotlight: new options "sparql results limit", "spotlight
attributes" and "spotlight expr"
+* FIX: afpd: Unarchiving certain ZIP archives fails, bug #569
Changes in 3.1.2
================
Changes in 3.1.2
================
#define AD_AFPFILEI_GROUP (1 << 1) /* ignore group */
#define AD_AFPFILEI_BLANKACCESS (1 << 2) /* blank access permissions */
#define AD_AFPFILEI_GROUP (1 << 1) /* ignore group */
#define AD_AFPFILEI_BLANKACCESS (1 << 2) /* blank access permissions */
+/*
+ * String identifiers for the 16 AppleDouble filler bytes
+ */
+#define AD_FILLER_NETATALK "Netatalk "
+#define AD_FILLER_OSX "Mac OS X"
+
#define ad_data_fileno(ad) ((ad)->ad_data_fork.adf_fd)
#define ad_reso_fileno(ad) ((ad)->ad_rfp->adf_fd)
#define ad_meta_fileno(ad) ((ad)->ad_mdp->adf_fd)
#define ad_data_fileno(ad) ((ad)->ad_data_fork.adf_fd)
#define ad_reso_fileno(ad) ((ad)->ad_rfp->adf_fd)
#define ad_meta_fileno(ad) ((ad)->ad_mdp->adf_fd)
memcpy(buf, &temp, sizeof( temp ));
buf += sizeof( temp );
memcpy(buf, &temp, sizeof( temp ));
buf += sizeof( temp );
- memcpy(buf, "Netatalk ", 16);
+ memcpy(buf, AD_FILLER_NETATALK, strlen(AD_FILLER_NETATALK));
buf += sizeof( ad->ad_filler );
nent = htons(ADEID_NUM_OSX);
buf += sizeof( ad->ad_filler );
nent = htons(ADEID_NUM_OSX);
- 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.
/*
* It's a split fork created by OS X, it's not our "own" ._ file
* and thus not a valid header in this context.