From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id B1F61246B5 for ; Thu, 1 Feb 2024 00:32:49 +0100 (CET) Received: (qmail 1206 invoked by uid 550); 31 Jan 2024 23:30:20 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 1165 invoked from network); 31 Jan 2024 23:30:19 -0000 Date: Wed, 31 Jan 2024 18:32:51 -0500 From: Rich Felker To: Tim Cuthbertson Cc: musl@lists.openwall.com Message-ID: <20240131233251.GZ22081@brightrain.aerifal.cx> References: <20240131134710.GU4163@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] Bug: installed symlinks are unreadable on MacOS On Thu, Feb 01, 2024 at 09:39:56AM +1100, Tim Cuthbertson wrote: > Yeah, setting it to `chmod 000` in just the symlink branch seems good to me > too. > > Looking at the script more closely, `mode` is always set and so I'm unclear > why there is also a `umask 077` at all. Whatever permissions we create the > file with, we `chmod` it explicitly before doing anything else. > > Is that line just there to undo the potential change to `umask` in the > mkdirp branch? If so, maybe that should be done explicitly by capturing the > old umask? e.g: No, it's so that the install.sh never exposes a file to users who should not have access to it via the existing umask being more permissive than the requested install mode. Normally this does not matter for use as part of musl's install process, but the script is written to be general and not have security bugs like that. Rich