summaryrefslogtreecommitdiff
path: root/testsuite/cp/cp-does-not-copy-unreadable-file
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/cp/cp-does-not-copy-unreadable-file')
-rw-r--r--testsuite/cp/cp-does-not-copy-unreadable-file7
1 files changed, 6 insertions, 1 deletions
diff --git a/testsuite/cp/cp-does-not-copy-unreadable-file b/testsuite/cp/cp-does-not-copy-unreadable-file
index ce11bfa..e17e8e6 100644
--- a/testsuite/cp/cp-does-not-copy-unreadable-file
+++ b/testsuite/cp/cp-does-not-copy-unreadable-file
@@ -1,6 +1,11 @@
touch foo
chmod a-r foo
set +e
-busybox cp foo bar
+if test `id -u` = 0; then
+ # run as user with nonzero uid
+ setuidgid 1 busybox cp foo bar
+else
+ busybox cp foo bar
+fi
set -e
test ! -f bar