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

Re: Unreadable directories aren't included in glob expansion



(moved from users/24633⁩)

> 2020/01/11 2:09, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> 
> diff --git a/Test/D02glob.ztst b/Test/D02glob.ztst
(snip)
> + 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)
(snip)

This test fails on Cygwin, i.e., does not fail as expected.

This is because stat("glob.tmp/secret-d000/.") succeeds on Cygwin.
I asked about this in the cygwin mailing list and learned that
this is the default behavior of Windows and it is not easy for
Cygwin to override it.
I think just skipping this test on Cygwin is enough for now.



diff --git a/Test/D02glob.ztst b/Test/D02glob.ztst
index b0650c8c8..973dc2207 100644
--- a/Test/D02glob.ztst
+++ b/Test/D02glob.ztst
@@ -729,11 +729,15 @@
 >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-*(-/)
+ if [[ $OSTYPE = cygwin* ]]; then
+   ZTST_skip='Cygwin ignores search permission of directories'
+ else
+   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-*(-/)
+ fi
 -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





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