zsh-users
 help / color / mirror / code / Atom feed
From: Oliver Freyermuth <o.freyermuth@googlemail.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: zsh expansion fails if nocaseglob and not all directory components are listable
Date: Mon, 22 Aug 2022 20:02:35 +0200	[thread overview]
Message-ID: <b2e9d528-62e2-6d0e-9d14-03128cdb5110@googlemail.com> (raw)

Dear zsh'ers,

I'm not sure if this is a bug or a feature — but I have seen some zsh scripts break when the top level home directory (/home) is set to mode 711 and owned by root
(as is common for shared home directories offered via network at our site), when nocaseglob is active.

To reproduce locally, see the following example:

1) Prepare directory:

mkdir foo
chmod 711 foo
mkdir foo/test
sudo chown root:root foo
cd foo/test

2) Test with caseglob:
setopt caseglob
echo $(pwd)(N)

=> Output is returned just fine.

3) Test with nocaseglob:
setopt nocaseglob
echo $(pwd)(N)

=> No output is returned.

Of course, zsh can not exclude there are other directories directly inside "foo/" matching the given pattern (but with different case) since "foo/" can not be listed. However, at least the explicit match with case is known,
so I'm astonished zero matches are returned.

Is this expected, or a bug?

Cheers,
	Oliver

             reply	other threads:[~2022-08-22 18:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-22 18:02 Oliver Freyermuth [this message]
2022-08-22 19:05 ` Daniel Shahaf
2022-08-22 20:14 ` Lawrence Velázquez
2022-08-22 20:59   ` Bart Schaefer
2022-08-22 21:36     ` Oliver Freyermuth
2022-08-22 21:56       ` Dominik Vogt
2022-08-22 22:01         ` Oliver Freyermuth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b2e9d528-62e2-6d0e-9d14-03128cdb5110@googlemail.com \
    --to=o.freyermuth@googlemail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).