zsh-workers
 help / color / mirror / code / Atom feed
* 5.8.1.2-test - test failures running as root
@ 2022-04-11 21:14 Bart Schaefer
  2022-04-11 22:38 ` [PATCH] " Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Bart Schaefer @ 2022-04-11 21:14 UTC (permalink / raw)
  To: Zsh hackers list

These are probably not new; found while experimenting with reproducing
Axel's test fails.

The first is obviously because of root's expanded privileges.  The
second probably also so, just not immediately clear why.

./D02glob.ztst: starting.
--- /tmp/zsh.ztst.65749/ztst.out    2022-04-11 12:33:35.043329191 -0700
+++ /tmp/zsh.ztst.65749/ztst.tout    2022-04-11 12:33:35.063328833 -0700
@@ -1,3 +1,9 @@
+glob.tmp/secret-d000/dir   glob.tmp/secret-d000/file
+glob.tmp/secret-d111/dir   glob.tmp/secret-d111/file
 glob.tmp/secret-d444/dir   glob.tmp/secret-d444/file
+glob.tmp/secret-s000/dir   glob.tmp/secret-s000/file
+glob.tmp/secret-s111/dir   glob.tmp/secret-s111/file
 glob.tmp/secret-s444/dir   glob.tmp/secret-s444/file
-glob.tmp/secret-d111/file  glob.tmp/secret-s111/file
+glob.tmp/secret-d000/file  glob.tmp/secret-d111/file
+glob.tmp/secret-d444/file  glob.tmp/secret-s000/file
+glob.tmp/secret-s111/file  glob.tmp/secret-s444/file
Test ./D02glob.ztst failed: output differs from expected as shown above for:
 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
Was testing: names inside unreadable directories can be globbed if searchable
./D02glob.ztst: test failed.


./E03posix.ztst: starting.
Test ./E03posix.ztst was expected to fail, but passed.
Was testing: EUID is not a special variable
./E03posix.ztst: test XPassed.


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

* [PATCH] Re: 5.8.1.2-test - test failures running as root
  2022-04-11 21:14 5.8.1.2-test - test failures running as root Bart Schaefer
@ 2022-04-11 22:38 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2022-04-11 22:38 UTC (permalink / raw)
  To: Zsh hackers list

On Mon, Apr 11, 2022 at 2:14 PM Bart Schaefer <schaefer@brasslantern.com> wrote:
>
> These are probably not new; found while experimenting with reproducing
> Axel's test fails.
>
> The first is obviously because of root's expanded privileges.  The
> second probably also so, just not immediately clear why.

Fixed the first by just skipping the test.  Fixed the second by
dropping privilege and then attempting to escalate again.

diff --git a/Test/D02glob.ztst b/Test/D02glob.ztst
index 72891a2a7..850a535e5 100644
--- a/Test/D02glob.ztst
+++ b/Test/D02glob.ztst
@@ -748,13 +748,21 @@
   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
+ if (( EUID == 0 )); then
+   ZTST_skip='Not testing unreadable directories (root reads anything)'
+ else
+   print -raC 2 -- glob.tmp/secret-*/* glob.tmp/secret-*/file
+ fi
 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/*
+ if (( EUID == 0 )); then
+   ZTST_skip='Not testing unreadable directories (root reads anything)'
+ else
+   print -rC 2 -- glob.tmp/secret-*/dir/*
+ fi
 0:glob files in readable directories inside unreadable directories
 >glob.tmp/secret-d111/dir/file  glob.tmp/secret-s111/dir/file

diff --git a/Test/E03posix.ztst b/Test/E03posix.ztst
index caab97ab6..6ac4d1732 100644
--- a/Test/E03posix.ztst
+++ b/Test/E03posix.ztst
@@ -153,7 +153,7 @@ F:This may also need to apply to multibyte whitespace
 F:POSIX has neither math functions nor floating point
 >42

-  ARGV0=sh $ZTST_testdir/../Src/zsh -c 'EUID=10; echo "$EUID"'
+  ARGV0=sh $ZTST_testdir/../Src/zsh -c 'EUID=1; EUID=10; echo $EUID'
 -f:EUID is not a special variable
 >10


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

end of thread, other threads:[~2022-04-11 22:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-11 21:14 5.8.1.2-test - test failures running as root Bart Schaefer
2022-04-11 22:38 ` [PATCH] " Bart Schaefer

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