summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2010-05-04 22:08:46 +0200
committerAndreas Gruenbacher <agruen@suse.de>2010-05-04 22:12:00 +0200
commitad76f672858d3c566035eee6390382d717775b3b (patch)
treed1cd14b2ca580bf91ec828a5ff9b87db8c9fa4b3 /tests
parent9dbdc0e748837620dcdd63978e4232c8be1f0566 (diff)
downloadpatch-ad76f672858d3c566035eee6390382d717775b3b.tar.gz
tests/read-only-files: Replace the superuser test
* tests/read-only-files: Remove the superuser test, and instead try out if a read-only file can be written to.
Diffstat (limited to 'tests')
-rw-r--r--tests/read-only-files10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/read-only-files b/tests/read-only-files
index df4f7f0..172a0bd 100644
--- a/tests/read-only-files
+++ b/tests/read-only-files
@@ -12,10 +12,16 @@ require_cat
use_local_patch
use_tmpdir
-if test `id -u` = 0; then
- echo "This test must not be run as superuser" >&2
+# --------------------------------------------------------------
+
+: > read-only
+chmod a-w read-only
+if : 2> /dev/null > read-only; then
+ echo "Files with read-only permissions are writable" \
+ "(probably running as superuser)" >&2
exit 77
fi
+rm -f read-only
# ==============================================================