aboutsummaryrefslogtreecommitdiff
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-file11
1 files changed, 11 insertions, 0 deletions
diff --git a/testsuite/cp/cp-does-not-copy-unreadable-file b/testsuite/cp/cp-does-not-copy-unreadable-file
new file mode 100644
index 0000000..e17e8e6
--- /dev/null
+++ b/testsuite/cp/cp-does-not-copy-unreadable-file
@@ -0,0 +1,11 @@
+touch foo
+chmod a-r foo
+set +e
+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