From: Apple Date: Mon, 20 Dec 2010 23:23:16 +0000 (+0000) Subject: copyfile-66.1.tar.gz X-Git-Tag: mac-os-x-1067^0 X-Git-Url: https://git.saurik.com/apple/copyfile.git/commitdiff_plain/31f0c9c4888672dde921143037bf8abea0323a72?hp=659640e4eb4c4d74a1ac49f001c306d34c892759 copyfile-66.1.tar.gz --- diff --git a/copyfile.c b/copyfile.c index aa68b5c..6834f59 100644 --- a/copyfile.c +++ b/copyfile.c @@ -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 "