zsh-users
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-users@zsh.org
Subject: Re: Unreadable directories aren't included in glob expansion
Date: Fri, 10 Jan 2020 17:09:32 +0000	[thread overview]
Message-ID: <20200110170932.yz5wvd4uzr2taq57@tarpaulin.shahaf.local2> (raw)
In-Reply-To: <20200110072753.yh7qms4w2gb44zcf@chaz.gmail.com>

Stephane Chazelas wrote on Fri, Jan 10, 2020 at 07:27:53 +0000:
> 2020-01-09 17:22:22 +0000, Stephane Chazelas:
> [...]
> > Now, zsh seems to be the only shell where */ excludes the
> > non-*searchable* (it does include the non-readable ones provided
> > you have search access).
> [...]
> 
> And conversely, it doesn't include readable dirs if they are not
> searchable which can be even more surprising:
> 
> $ ls -l
> total 2
> drwxrwxr-x 2 chazelas chazelas 2 Jan  9 17:07 1/
> dr--r--r-- 2 chazelas chazelas 3 Jan  9 17:17 2/
> drwxrwxr-x 2 chazelas chazelas 2 Jan  9 17:07 3/
> $ echo */
> 1/ 3/
> $ echo */*
> 2/file

Thanks, here's an updated test:

diff --git a/Test/D02glob.ztst b/Test/D02glob.ztst
index 5638e1255..22c663260 100644
--- a/Test/D02glob.ztst
+++ b/Test/D02glob.ztst
@@ -728,3 +728,16 @@
 >does/not/exist
 >not/exist
 >exist
+
+ mkdir -m 000 glob.tmp/secret-d000
+ mkdir -m 111 glob.tmp/secret-d111
+ mkdir -m 444 glob.tmp/secret-d444
+ for 1 in 000 111 444 ; do ln -s secret-d$1 glob.tmp/secret-s$1; done
+ print -rC 2 -- glob.tmp/secret-*/ glob.tmp/secret-*(-/)
+-f:unreadable directories can be globbed (users/24619, users/24626)
+>glob.tmp/secret-d000/  glob.tmp/secret-d000
+>glob.tmp/secret-d111/  glob.tmp/secret-d111
+>glob.tmp/secret-d444/  glob.tmp/secret-d444
+>glob.tmp/secret-s000/  glob.tmp/secret-s000
+>glob.tmp/secret-s111/  glob.tmp/secret-s111
+>glob.tmp/secret-s444/  glob.tmp/secret-s444

It passes if the mkdir's are done with the default permissions.

      reply	other threads:[~2020-01-10 17:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200109154313eucas1p13b2e5465f21d059ea08537012e140236@eucas1p1.samsung.com>
2020-01-09 15:41 ` Daniel Shahaf
2020-01-09 15:51   ` Peter Stephenson
2020-01-09 16:10     ` Bart Schaefer
2020-01-09 16:16       ` Daniel Shahaf
     [not found]   ` <1578585101.6028.13.camel__24021.2781982095$1578585228$gmane$org@samsung.com>
2020-01-09 17:22     ` Stephane Chazelas
2020-01-09 23:05       ` Mikael Magnusson
2020-01-10 17:11       ` Daniel Shahaf
     [not found]     ` <20200109172222.uwgyjouab45zk2gf__13897.4118557357$1578604026$gmane$org@chaz.gmail.com>
2020-01-10  7:27       ` Stephane Chazelas
2020-01-10 17:09         ` Daniel Shahaf [this message]

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=20200110170932.yz5wvd4uzr2taq57@tarpaulin.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --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).