ndk-busybox/testsuite/cp/cp-does-not-copy-unreadable-file
Denis Vlasenko b9ad75fa60 copy_file: handle "cp /dev/foo file" (almost) compatibly to coreutils.
(almost because we do not copy mode, which is probably wasn't intended).
+61 bytes.
2008-03-28 17:49:31 +00:00

12 lines
179 B
Plaintext

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