Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Allow globbing with unreadable parent directories



> On Jan 13, 2021, at 7:27 PM, Devin Hussey <husseydevin@xxxxxxxxx> wrote:
> 
>> On Wed, Jan 13, 2021, 5:28 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>> 
>> As far as I can tell, the patch
>> would only cause globbing to fail in more cases, not succeed where it
>> previously did not.
> 
> No, that is definitely not the case.

But your patch *does* cause globbing to fail in cases for which it
currently doesn't.

	% mkdir -p notsearchable/{dir,DIR}
	% touch notsearchable/{dir,DIR}/file
	% chmod 600 notsearchable
	% zsh -fc 'echo notsearchable/*'
	notsearchable/DIR notsearchable/dir
	% ./zsh-patched -fc 'echo notsearchable/*'
	zsh:1: no matches found: notsearchable/*

> opendir() would fail if either R_OK or X_OK was false, causing unreadable folders to be a false negative. 
> 
> This is allowing certain combinations where opendir() would fail.

If I'm understanding your intention correctly, you would like
"literal" segments (e.g., lacking special characters) of
case-insensitive glob patterns to match literally if the "parent"
lacks read permissions. This doesn't seem to work, though. Am I
missing something?

	% mkdir -p notreadable/dir
	% touch notreadable/dir/file
	% chmod 300 notreadable
	% zsh -f +o CASE_GLOB -c 'echo notreadable/dir/*'          
	zsh:1: no matches found: notreadable/dir/*
	% ./zsh-patched -f +o CASE_GLOB -c 'echo notreadable/dir/*'
	zsh:1: no matches found: notreadable/dir/*

vq



Messages sorted by: Reverse Date, Date, Thread, Author