From: Jeff King Date: Wed, 28 Mar 2012 19:39:09 GMT Subject: Re: [PATCH 2/2] git: continue alias lookup on EACCES errors Message-ID: <20120328193909.GB29019@sigill.intra.peff.net> In-Reply-To: <20120328184014.GA8982@burratino> On Wed, Mar 28, 2012 at 01:40:14PM -0500, Jonathan Nieder wrote: > On Wed, Mar 28, 2012 at 11:31:10AM -0700, Junio C Hamano wrote: > > Jonathan Nieder writes: > > >> Example: when I try > >> > >> :; mkdir $HOME/cannotread > >> :; chmod -x $HOME/cannotread > >> :; echo nonsense >$HOME/bin/cat > >> :; chmod -x $HOME/bin/cat > >> :; PATH=$HOME/cannotread:$HOME/bin:/usr/local/bin:/usr/bin:/bin > >> :; cat /etc/fstab > >> > >> the shell uses /bin/cat without complaint. > > > > Yeah, but I think that the case Peff is worried about is: > > > > $ >~/bin/nosuch > > $ nosuch > > nosuch: Permission denied > > Just remembering the EACCES and reporting it when no alias exists > would take care of that, no? In other words, this seems analogous > to the example of a non-executable "cat" that is reported if no > other cat exists but does not prevent /bin/cat from being run. That's what the patch I posted earlier does. But it means we _also_ report "permission denied" for inaccessible directories, which is needlessly confusing (and much more common, I would think). -Peff