X-Original-To: alpine-devel@lists.alpinelinux.org Received: from mail-qt0-f194.google.com (mail-qt0-f194.google.com [209.85.216.194]) by lists.alpinelinux.org (Postfix) with ESMTP id 203965C5596 for ; Tue, 14 Aug 2018 14:51:20 +0000 (GMT) Received: by mail-qt0-f194.google.com with SMTP id y5-v6so21336900qti.12 for ; Tue, 14 Aug 2018 07:51:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+PnTA/t7IqAe78ka79el2aNHf3IJIJhU8kSYH91gCqg=; b=XiAP/fr+KT7Coo5htWhr0oeT2b2+gpttGtE7jx5gra2IY9i8N71yOkriJrTcAMalGB +hLTsIWNDNDwi5ubucP1//015oS4NIrS7naCq0g1WBmjZjI3x6pwX2Taia3na2+uHsoe 79d9Vcy60XBlYa7CjVLAMdAFYw2k2OHGI56VbN+v3lRmMf/qG0dfSdhU5nfioTI3bSxU WvW5olc53uHnnoDO2cd97Tl2QSdGs+YWrKPDDp0TL6KqWxOi7SG3mo3fUrIl3iiiOu8y u8AgYpA3vspf0FlT3kL6Lboh0//R9Os3ohkC+EWHXtDJqxGaDiv5PvgjPYkfG3BbtMgY YkqA== X-Gm-Message-State: AOUpUlHUXC6U1hWU4JW07o/mRtMNyCxte18t8LB0tNLPrg7zHX1dYll6 kIoLEhihpcauWjTLKpi+8Ok= X-Google-Smtp-Source: AA+uWPwg1/fGQy97FF1Ut4MqEeQlp2YmGRDp9KYtOeNcOFrFdp31ePnAWgJ15gAzNr6zxAGKGiuFMA== X-Received: by 2002:ac8:21c8:: with SMTP id 8-v6mr20444575qtz.171.1534258279751; Tue, 14 Aug 2018 07:51:19 -0700 (PDT) Received: from vostro ([208.74.142.117]) by smtp.gmail.com with ESMTPSA id e1-v6sm13482531qkd.15.2018.08.14.07.51.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 Aug 2018 07:51:19 -0700 (PDT) Date: Tue, 14 Aug 2018 17:51:17 +0300 From: Timo Teras To: Jesse Young Cc: alpine-devel@lists.alpinelinux.org Subject: Re: [alpine-devel] [PATCH] apk-tools: archive: enable FIFO extraction Message-ID: <20180814175117.250dc182@vostro> In-Reply-To: <20180813055752.GA6625@varda.jlyo.org> References: <20180813055752.GA6625@varda.jlyo.org> X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.31; x86_64-alpine-linux-musl) 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-Transfer-Encoding: 7bit Hi, On Mon, 13 Aug 2018 00:57:52 -0500 Jesse Young wrote: > src/archive.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > >[...] > > @@ -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; > } The mode masking for mknodat() is an old bug. Let's just remove it. It was added when the mask for other creation syscalls was changed from 0777 to 07777 to support setuid/setgid, but mknodat() really needs the whole thing to create right type node. Can you resubmit, or would you like me to amend your patch? Thanks! Timo --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---