aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2025-01-01 12:19:06 +0100
committerGuilhem Moulin <guilhem@fripost.org>2025-01-01 12:19:08 +0100
commit2bbabd3515cf709bed612ba50b3f50089ad099aa (patch)
tree9c46fedbbc3b1131c54407809970baa313067bfb
parent601398e92f99a159fcb5ffc0764950ae5c60d096 (diff)
Fix 'drop-privileges' test.HEADmaster
Apparently `readlink -e …/fd/2` doesn't work anymore so we don't check existence anymore extistence of the last component, and instead merely check that the output is not empty.
-rw-r--r--tests/drop-privileges15
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/drop-privileges b/tests/drop-privileges
index 8deb8f1..3589ee3 100644
--- a/tests/drop-privileges
+++ b/tests/drop-privileges
@@ -81,7 +81,8 @@ check_accountd() {
USER=lacme-account
EOF
- stderr="$(readlink -e "/proc/$$/fd/2")"
+ stderr="$(readlink -f "/proc/$$/fd/2")"
+ test -n "$stderr" || return -1
socket_ino="$(sed -rn '/^0 .* socket:\[([0-9]+)\]$/ {s//\1/p;q}' "$prefix/fd")"
[ -n "$socket_ino" ] || return 1
grep -Fxq "0 0700 $UID:$GID socket:[$socket_ino]" "$prefix/fd" || return 1
@@ -106,8 +107,10 @@ check_client() {
USER=_lacme-client
EOF
- stdout="$(readlink -e "/proc/$$/fd/1")"
- stderr="$(readlink -e "/proc/$$/fd/2")"
+ stdout="$(readlink -f "/proc/$$/fd/1")"
+ stderr="$(readlink -f "/proc/$$/fd/2")"
+ test -n "$stdout" || return -1
+ test -n "$stderr" || return -1
if [ "$command" = "account" ]; then # no pipe
grep -Fxq "0 0500 $UID:$GID /dev/null" "$prefix/fd" || return 1
grep -Fxq "1 0700 $UID:$GID $stdout" "$prefix/fd" || return 1
@@ -143,8 +146,10 @@ check_webserver() {
USER=_lacme-www
EOF
- stdout="$(readlink -e "/proc/$$/fd/1")"
- stderr="$(readlink -e "/proc/$$/fd/2")"
+ stdout="$(readlink -f "/proc/$$/fd/1")"
+ stderr="$(readlink -f "/proc/$$/fd/2")"
+ test -n "$stdout" || return -1
+ test -n "$stderr" || return -1
grep -Fxq "0 0500 $UID:$GID /dev/null" "$prefix/fd" || return 1
grep -Fxq "1 0700 $UID:$GID $stdout" "$prefix/fd" || return 1
grep -Fxq "2 0700 $UID:$GID $stderr" "$prefix/fd" || return 1