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.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user