Edit changelog a little for clarity and conciseness
[tor.git] / src / test / test_switch_id.sh
blob79c44f2eb1ec518f7a3d52778f2b996da9e563f0
1 #!/bin/sh
3 if test "`id -u`" != '0'; then
4 echo "This test only works when run as root. Skipping." >&2
5 exit 77
6 fi
8 if test "`id -u nobody`" = ""; then
9 echo "This test requires that your system have a 'nobody' user. Sorry." >&2
10 exit 1
13 if test "$OVERRIDE_GCDA_PERMISSIONS_HACK" = "yes"; then
14 find src -type f -name '*gcda' -print0 | xargs -0 chmod 0666
17 "${builddir:-.}/src/test/test-switch-id" nobody setuid || exit 1
18 "${builddir:-.}/src/test/test-switch-id" nobody root-bind-low || exit 1
19 "${builddir:-.}/src/test/test-switch-id" nobody setuid-strict || exit 1
20 "${builddir:-.}/src/test/test-switch-id" nobody built-with-caps || exit 0
21 # ... Go beyond this point only if we were built with capability support.
23 "${builddir:-.}/src/test/test-switch-id" nobody have-caps || exit 1
24 "${builddir:-.}/src/test/test-switch-id" nobody setuid-keepcaps || exit 1
26 if test "$OVERRIDE_GCDA_PERMISSIONS_HACK" = "yes"; then
27 find src -type f -name '*gcda' -print0 | xargs -0 chmod 0644
30 echo "All okay"
32 exit 0