From 31f0c9c4888672dde921143037bf8abea0323a72 Mon Sep 17 00:00:00 2001 From: Apple Date: Mon, 20 Dec 2010 23:23:16 +0000 Subject: [PATCH] copyfile-66.1.tar.gz --- copyfile.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 " -- 2.45.2