From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14475 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Re: [PATCH] In glob(), do not require that the target of a symlink exists. Date: Tue, 30 Jul 2019 12:13:36 -0400 Message-ID: <20190730161336.GA1506@brightrain.aerifal.cx> References: Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="50011"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-14491-gllmg-musl=m.gmane.org@lists.openwall.com Tue Jul 30 18:13:52 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1hsUl5-000CvK-S1 for gllmg-musl@m.gmane.org; Tue, 30 Jul 2019 18:13:51 +0200 Original-Received: (qmail 1187 invoked by uid 550); 30 Jul 2019 16:13:49 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 1169 invoked from network); 30 Jul 2019 16:13:49 -0000 Content-Disposition: inline In-Reply-To: Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:14475 Archived-At: On Tue, Jul 30, 2019 at 12:04:57PM -0400, James Y Knight wrote: > Ping -- is this patch ok? I think the logic is right, but I need to look again. I was confused by the comment changes of the patch. Rich > On Mon, Jul 22, 2019 at 8:37 PM James Y Knight wrote: > > > > Previously, when given a trailing path component with no > > metacharacters, glob would call stat to check if the provided filename > > existed, which would fail on a broken symlink. When expanding a > > pattern however, glob would trust the list of files returned by > > readdir, and thus would return broken symlinks. > > > > Now, be consistent and allow broken symlinks in both cases, by using > > lstat to determine file existence. > > > > If GLOB_MARK is specified, stat must still be used to determine > > whether a given name refers to a directory or file. But if that fails, > > a symlink is simply considered to be a file for marking purposes.