2 # This script must be run as superuser.
7 # A POSIX compliant 'id' program.
8 if test -f /usr
/xpg
4/bin
/id
; then
14 if test `$ID -u` != 0; then
15 echo "Skipping test: not superuser"
19 ${CHECKER} .
/test-idpriv-droptemp
${EXEEXT} ||
exit 13 # normal
21 chown root
:root test-idpriv-droptemp
${EXEEXT} 2>/dev
/null || \
22 chown root
:wheel test-idpriv-droptemp
${EXEEXT} 2>/dev
/null || \
23 { echo "Skipping test: root privilege not sufficient on this file system"
26 chmod 4755 test-idpriv-droptemp
${EXEEXT}
27 .
/test-idpriv-droptemp
${EXEEXT} ||
exit 13 # setuid root
28 chmod 2755 test-idpriv-droptemp
${EXEEXT}
29 .
/test-idpriv-droptemp
${EXEEXT} ||
exit 13 # setgid root
30 chmod 6755 test-idpriv-droptemp
${EXEEXT}
31 .
/test-idpriv-droptemp
${EXEEXT} ||
exit 13 # setuid and setgid root
33 if chown nobody test-idpriv-droptemp
${EXEEXT} 2>/dev
/null
; then
34 chmod 4755 test-idpriv-droptemp
${EXEEXT}
35 .
/test-idpriv-droptemp
${EXEEXT} ||
exit 13 # setuid nobody
36 chmod 2755 test-idpriv-droptemp
${EXEEXT}
37 .
/test-idpriv-droptemp
${EXEEXT} ||
exit 13 # setgid root
38 chmod 6755 test-idpriv-droptemp
${EXEEXT}
39 .
/test-idpriv-droptemp
${EXEEXT} ||
exit 13 # setuid nobody and setgid root
42 if chown root
:nobody test-idpriv-droptemp
${EXEEXT} 2>/dev
/null
; then
43 chmod 4755 test-idpriv-droptemp
${EXEEXT}
44 .
/test-idpriv-droptemp
${EXEEXT} ||
exit 13 # setuid root
45 chmod 2755 test-idpriv-droptemp
${EXEEXT}
46 .
/test-idpriv-droptemp
${EXEEXT} ||
exit 13 # setgid nobody
47 chmod 6755 test-idpriv-droptemp
${EXEEXT}
48 .
/test-idpriv-droptemp
${EXEEXT} ||
exit 13 # setuid root and setgid nobody
51 chown
"$origuid:$origgid" test-idpriv-droptemp
${EXEEXT}
52 chmod 755 test-idpriv-droptemp
${EXEEXT}