From: Jim Meyering Date: Sun, 5 Aug 2001 08:42:53 +0000 (+0000) Subject: Renamed from root-only. X-Git-Tag: TEXTUTILS-2_0_15~496 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=273c2c5fbc2a5d59aa73ec7423ab244b289b765b;p=thirdparty%2Fcoreutils.git Renamed from root-only. --- diff --git a/tests/priv-check b/tests/priv-check new file mode 100644 index 0000000000..31e60dcbdb --- /dev/null +++ b/tests/priv-check @@ -0,0 +1,27 @@ +# -*- sh -*- +# Source this file at the beginning of a test that works +# only when run as root or as non-root. + +case $1 in + require-root) who='as root';; + require-non-root) who='by an unprivileged user';; + *) echo "Usage: $0 require-root|require-non-root" 1>&2; exit 1;; +esac + +root_check_temp=root-check.$$ +touch $root_check_temp || framework_failure=1 +chmod a-w $root_check_temp || framework_failure=1 + +(echo foo >> $root_check_temp) >/dev/null 2>&1 || { + cat <