zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] Tests for globbing below protected directories
@ 2021-01-25  0:15 Bart Schaefer
  2021-01-26 23:56 ` Daniel Shahaf
  0 siblings, 1 reply; 9+ messages in thread
From: Bart Schaefer @ 2021-01-25  0:15 UTC (permalink / raw)
  To: Zsh hackers list

Does this test look as expected?  Note there are trailing spaces on
the "print -raC 2" output, which surprised me but has nothing to do
with the test itself.

This doesn't test for the CASEGLOB issue last mentioned in workers/47832.

diff --git a/Test/D02glob.ztst b/Test/D02glob.ztst
index 176846d46..d3b2e9ec2 100644
--- a/Test/D02glob.ztst
+++ b/Test/D02glob.ztst
@@ -741,6 +741,23 @@
 >glob.tmp/secret-s111/  glob.tmp/secret-s111
 >glob.tmp/secret-s444/  glob.tmp/secret-s444

+ for 1 in 000 111 444 ; do
+  chmod 777 glob.tmp/secret-d$1
+  touch glob.tmp/secret-d$1/file
+  mkdir -m 777 glob.tmp/secret-d$1/dir
+  touch glob.tmp/secret-d$1/dir/file
+  chmod $1 glob.tmp/secret-d$1
+ done
+ print -raC 2 -- glob.tmp/secret-*/* glob.tmp/secret-*/file
+0:names inside unreadable directories can be globbed if searchable
+>glob.tmp/secret-d444/dir   glob.tmp/secret-d444/file
+>glob.tmp/secret-s444/dir   glob.tmp/secret-s444/file
+>glob.tmp/secret-d111/file  glob.tmp/secret-s111/file
+
+ print -rC 2 -- glob.tmp/secret-*/dir/*
+0:glob files in readable directories inside unreadable directories
+>glob.tmp/secret-d111/dir/file  glob.tmp/secret-s111/dir/file
+
  # On macOS, stat(2) allows files to be treated as directories if the calling
  # process has super-user privileges. e.g., stat() on /my/regular/file/. will
  # succeed as root but (correctly) fail otherwise. This can produce strange


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-02-06 12:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-25  0:15 [PATCH] Tests for globbing below protected directories Bart Schaefer
2021-01-26 23:56 ` Daniel Shahaf
2021-02-02  2:45   ` Bart Schaefer
2021-02-03 11:22     ` Daniel Shahaf
2021-02-03 22:33       ` Bart Schaefer
2021-02-03 23:06         ` Bart Schaefer
2021-02-04 13:09           ` Daniel Shahaf
2021-02-04 21:34             ` Bart Schaefer
2021-02-06 12:15               ` Daniel Shahaf

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).