mirror of
git://git.sv.gnu.org/coreutils
synced 2026-05-06 07:06:38 -04:00
tests: reinstate logname error verification
* tests/misc/user.sh: Modify the "unshare -U logname" test, so that it does not fail on glibc versions (< 2.28, >= 2.38) that do a fallback lookup based on the tty.
This commit is contained in:
committed by
Pádraig Brady
parent
15211db43f
commit
46f856156f
+4
-3
@@ -25,8 +25,9 @@ overflow_uid=$(cat /proc/sys/kernel/overflowuid) ||
|
||||
|
||||
test "$(unshare -U whoami)" = "$(id -un $overflow_uid)" || fail=1
|
||||
|
||||
# FIXME: Fails with Manjaro Linux
|
||||
#returns_ 1 unshare -U logname 2>err || fail=1
|
||||
#test "$(cat err)" = "logname: no login name" || fail=1
|
||||
# The "</dev/null" disables a fallback lookup via utmp/utmpx,
|
||||
# that existed in glibc < 2.28 and exists again in glibc >= 2.38.
|
||||
returns_ 1 unshare -U logname </dev/null 2>err || fail=1
|
||||
test "$(cat err)" = "logname: no login name" || fail=1
|
||||
|
||||
Exit $fail
|
||||
|
||||
Reference in New Issue
Block a user