X-Original-To: alpine-devel@lists.alpinelinux.org Received: from varda.jlyo.net (varda.jlyo.net [69.28.91.113]) by lists.alpinelinux.org (Postfix) with ESMTP id E8D7A5C5589 for ; Mon, 13 Aug 2018 06:02:12 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=jlyo.org; s=varda; t=1534140133; bh=3W8sPSTM2VPEOIYEff9u8lx0CmMiQJ6hn0Xy1sr6cMA=; h=Received:Date:From:To:Subject:Message-ID:MIME-Version: Content-Type:Content-Disposition:User-Agent; b=TtPEIeTorlCvnehj1vkNUhCVGlpGlXnzGF+3iKTJ6MkZ82OyQwkB37luAITlJVPQE 3PNZUchUNCFMwxd8f5rk03j9k7KcQO8v9Yh9BdADTQQ3y5ye26JL+Jsjg5wuwzDuMQ olsrPSzNf63ZACpVriTqlAnTasLWLZlu1bjh0xFHIa+L1OPzFZvs2QcOOy5lekYmqw 4sMclI2Ttw9U6orpqBQCYHfiQwY6l8QbNW1fcl7jIlmCCSqxn2dSo3S7C9ZaFxweKv g6MtWSAC6vIQXYTZvlDHAribcSCESZ4J9dznJVipoYJLUR+ZWr5usGYDySU30ANh6c SszYD7B0RRb0Q== Received: (qmail 6631 invoked by uid 1000); 13 Aug 2018 05:57:52 -0000 Date: Mon, 13 Aug 2018 00:57:52 -0500 From: Jesse Young To: alpine-devel@lists.alpinelinux.org Subject: [alpine-devel] [PATCH] apk-tools: archive: enable FIFO extraction Message-ID: <20180813055752.GA6625@varda.jlyo.org> X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) --- src/archive.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/archive.c b/src/archive.c index 9196cb2..1fc3e57 100644 --- a/src/archive.c +++ b/src/archive.c @@ -300,6 +300,9 @@ int apk_tar_parse(struct apk_istream *is, apk_archive_entry_parser parser, case '5': /* directory */ entry.mode |= S_IFDIR; break; + case '6': /* fifo */ + entry.mode |= S_IFIFO; + break; case 'g': /* global pax header */ break; case 'x': /* file specific pax header */ @@ -431,6 +434,7 @@ int apk_archive_entry_extract(int atfd, const struct apk_file_info *ae, struct apk_xattr *xattr; char *fn = ae->name; int fd, r = -1, atflags = 0, ret = 0; + mode_t nodmask = S_IFBLK | S_IFCHR | S_IFIFO | 07777; if (suffix != NULL) { fn = alloca(PATH_MAX); @@ -477,11 +481,10 @@ int apk_archive_entry_extract(int atfd, const struct apk_file_info *ae, if (r < 0) ret = -errno; atflags |= AT_SYMLINK_NOFOLLOW; break; - case S_IFSOCK: case S_IFBLK: case S_IFCHR: case S_IFIFO: - r = mknodat(atfd, fn, ae->mode & 07777, ae->device); + r = mknodat(atfd, fn, ae->mode & nodmask, ae->device); if (r < 0) ret = -errno; break; } -- 2.18.0 --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---