]> arthur.barton.de Git - netatalk.git/blobdiff - libatalk/adouble/ad_open.c
Unarchiving certain ZIP archives fails, bug #569
[netatalk.git] / libatalk / adouble / ad_open.c
index ea221ff4ec62964f827a8e2e8771a945d18c8b27..85a32a11518f9296c56cdec84f912aa763286498 100644 (file)
@@ -540,7 +540,9 @@ int ad_valid_header_osx(const char *path)
         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.
@@ -1927,7 +1929,7 @@ int ad_metadataat(int dirfd, const char *name, int flags, struct adouble *adp)
     int cwdfd = -1;
 
     if (dirfd != -1) {
-        if ((cwdfd = open(".", O_RDONLY) == -1) || (fchdir(dirfd) != 0)) {
+        if (((cwdfd = open(".", O_RDONLY)) == -1) || (fchdir(dirfd) != 0)) {
             ret = -1;
             goto exit;
         }