4 TESTDIR
="$(readlink -f "$(dirname "$0")")"
8 configarchitecture 'amd64'
10 aptdropprivs() { runapt "${APTTESTHELPERSBINDIR}/aptdropprivs
" "$@
"; }
12 testsuccess aptdropprivs -- /bin/true
13 testsuccess aptdropprivs --user "$USER" -- /bin/true
14 testsuccess aptdropprivs --user 'nobody' -- /bin/true
15 testsuccess aptdropprivs --user '_apt' -- /bin/true
18 testsuccessequal "$("$IDBIN")" aptdropprivs --user "$USER" -- "$IDBIN"
20 SUDOBIN='/usr/bin/sudo'
21 testequal "sudo
: effective uid is not
0, is
/usr
/bin
/sudo on a
file system with the
'nosuid' option
set or an NFS
file system without root privileges?
" aptdropprivs --user 'nobody' -- "$SUDOBIN" "$IDBIN"
23 if [ "$(id -u)" = '0' ]; then
24 testsuccessequal '_apt' aptdropprivs --user '_apt' -- "$IDBIN" '-un'
25 testsuccess aptdropprivs --user '_apt' -- '/bin/sh' '-c' 'export'
26 cp rootdir/tmp/testsuccess.output apt.env
27 testsuccessequal "export HOME
='/nonexistent'" grep '^export HOME' apt.env
28 testsuccessequal "export USER
='_apt'
29 export USERNAME
='_apt'" grep '^export USER' apt.env
30 testsuccessequal "export LOGNAME
='_apt'" grep '^export LOGNAME' apt.env
31 testsuccessequal "export SHELL
='/bin/sh'" grep '^export SHELL=' apt.env