summaryrefslogtreecommitdiffstats
path: root/Test/E01options.ztst
diff options
context:
space:
mode:
authorDaniel Shahaf <danielsh@apache.org>2019-12-26 09:16:19 +0000
committerdana <dana@dana.is>2020-02-14 16:06:57 -0600
commit8250c5c168f07549ed646e6848e6dda118271e23 (patch)
tree79531be561ec805243af8db67e1fc93c4d4b2904 /Test/E01options.ztst
parentDrop privileges securely (diff)
downloadzsh-8250c5c168f07549ed646e6848e6dda118271e23.tar
zsh-8250c5c168f07549ed646e6848e6dda118271e23.tar.gz
zsh-8250c5c168f07549ed646e6848e6dda118271e23.tar.bz2
zsh-8250c5c168f07549ed646e6848e6dda118271e23.tar.lz
zsh-8250c5c168f07549ed646e6848e6dda118271e23.tar.xz
zsh-8250c5c168f07549ed646e6848e6dda118271e23.tar.zst
zsh-8250c5c168f07549ed646e6848e6dda118271e23.zip
Improve PRIVILEGED fixes
- Fix retval handling in bin_setopt() - Don't skip_setuid / skip_setgid. It's not our place to optimize away noops (that might not even _be_ noops; they might change the saved uid…). - Remove HAVE_* guard checks around functions that are used unguarded elsewhere. - Use bsd-setres_id.c from OpenSSH to provide setresuid() / setresgid() everywhere, and thus simplify the ifdef soup. Fix some preëxisting bugs in the macro definitions of setuid() (do we still need that one?). - Fix zwarning() format codes for variadic arguments type safety - Restored a comment from HEAD - Fix failure modes around initgroups() - Compared privilege restoration code with OpenSSH's permanently_drop_uid() and updated as needed - Add E01 PRIVILEGED sanity checks
Diffstat (limited to 'Test/E01options.ztst')
-rw-r--r--Test/E01options.ztst15
1 files changed, 15 insertions, 0 deletions
diff --git a/Test/E01options.ztst b/Test/E01options.ztst
index c4b101bdb..680f49082 100644
--- a/Test/E01options.ztst
+++ b/Test/E01options.ztst
@@ -1391,3 +1391,18 @@ F:Regression test for workers/41811
?(anon):4: `break' active at end of function scope
?(anon):4: `break' active at end of function scope
?(anon):4: `break' active at end of function scope
+
+# There are further tests for PRIVILEGED in P01privileged.ztst.
+ if [[ -o privileged ]]; then
+ unsetopt privileged
+ fi
+ unsetopt privileged
+0:PRIVILEGED sanity check: unsetting is idempotent
+F:If this test fails at the first unsetopt, refer to P01privileged.ztst.
+
+ if [[ -o privileged ]]; then
+ (( UID != EUID ))
+ else
+ (( UID == EUID ))
+ fi
+0:PRIVILEGED sanity check: default value is correct