Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Allow globbing with unreadable parent directories
- X-seq: zsh-workers 47825
- From: Lawrence Velázquez <vq@xxxxxxxxx>
- To: Devin Hussey <husseydevin@xxxxxxxxx>
- Cc: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, zsh-workers@xxxxxxx
- Subject: Re: [PATCH] Allow globbing with unreadable parent directories
- Date: Wed, 13 Jan 2021 20:32:58 -0500
- Archived-at: <https://zsh.org/workers/47825>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2021-01/8563F702-5AC3-42C7-9FF9-B736A11B1A0D%40larryv.me>
- In-reply-to: <CAEtFKssJVz9mr3vA_vY77m2bsrXWBKHz1qgv83jzeY0jLXzPjQ@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAEtFKssJf-cN_EM+=5_10seY58jqALV-YH8+z5+Lm-04v493Nw@mail.gmail.com> <CAH+w=7bn8JYPx29LPGnT4ughEt-z+-rUokUz739foP=JCY9B7g@mail.gmail.com> <CAEtFKssJVz9mr3vA_vY77m2bsrXWBKHz1qgv83jzeY0jLXzPjQ@mail.gmail.com>
> 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