mkdir -p $tmp || framework_failure=1
cd $tmp || framework_failure=1
-: ${NON_ROOT_USERNAME=nobody}
-
-# Ensure that the supplied username is valid and with UID != 0.
-setuidgid $NON_ROOT_USERNAME id -u > id || \
- {
- echo "$0: Skipping this test. To enable it, set the envvar" 1>&2
- echo "$0: NON_ROOT_USERNAME to a non-root user name." 1>&2
- (exit 77); exit 77
- }
-test `cat id` = 0 && \
- {
- echo "$0: The specified NON_ROOT_USERNAME ($NON_ROOT_USERNAME)" 1>&2
- echo "$0: is invalid because its UID is 0." 1>&2
- (exit 1); exit 1
- }
-
# The containing directory must be owned by the user who eventually runs rm.
chown $NON_ROOT_USERNAME .