]> git.saurik.com Git - apple/copyfile.git/commitdiff
copyfile-66.1.tar.gz mac-os-x-1067 mac-os-x-1068 v66.1
authorApple <opensource@apple.com>
Mon, 20 Dec 2010 23:23:16 +0000 (23:23 +0000)
committerApple <opensource@apple.com>
Mon, 20 Dec 2010 23:23:16 +0000 (23:23 +0000)
copyfile.c

index aa68b5c27f7d1e755526e5501d453fc3878aea1c..6834f59d809f5e8989510fb96a683abc927e1008 100644 (file)
@@ -1478,10 +1478,11 @@ static int copyfile_open(copyfile_state_t s)
                    }
                case EISDIR:
                    copyfile_debug(3, "open failed because it is a directory (%s)", s->dst);
-                   if ((s->flags & COPYFILE_EXCL) ||
+                   if (((s->flags & COPYFILE_EXCL) ||
                        (!isdir && (s->flags & COPYFILE_DATA)))
+                       && !(s->flags & COPYFILE_UNPACK))
                        break;
-                   oflags = (oflags & ~O_WRONLY) | O_RDONLY;
+                   oflags = (oflags & ~(O_WRONLY|O_CREAT|O_TRUNC)) | O_RDONLY;
                    continue;
            }
            copyfile_warn("open on %s", s->dst);
@@ -2440,7 +2441,7 @@ typedef struct rsrcfork_header {
        u_int16_t       mh_Types;
        u_int16_t       mh_Names;
        u_int16_t       typeCount;
-} rsrcfork_header_t;
+} __attribute__((aligned(2), packed)) rsrcfork_header_t;
 #define RF_FIRST_RESOURCE    256
 #define RF_NULL_MAP_LENGTH    30   
 #define RF_EMPTY_TAG  "This resource fork intentionally left blank   "