aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-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