3
0

cp-does-not-copy-unreadable-file 179 B

1234567891011
  1. touch foo
  2. chmod a-r foo
  3. set +e
  4. if test `id -u` = 0; then
  5. # run as user with nonzero uid
  6. setuidgid 1 busybox cp foo bar
  7. else
  8. busybox cp foo bar
  9. fi
  10. set -e
  11. test ! -f bar