mirror / busybox

BusyBox mirror
https://www.busybox.net/
Other
1.61k stars 605 forks source link

'cp' doesn't keep destination permission #79

Open fulalas opened 10 months ago

fulalas commented 10 months ago

How to replicate:

  1. have a 644 permission test.txt file in /etc/xdg/autostart
  2. have a 755 permission test.txt file in /tmp
  3. call busybox using: busybox cp /tmp/test.txt /etc/xdg/autostart

Expected behavior: the new file should replace the original one and keep the original (destiny) permission.

Current behavior: the new file replaces the original one but it also replaces its permission, and that's not the behavior of cp from coreutils (https://www.gnu.org/software/coreutils/), which requires additional parameters (--preserve=all) to achieve that.

I'm using busybox 1.36.1

P.S.: is busybox bug track working? I reported this issue there one week ago and didn't see any reply.

ljf75 commented 9 months ago

Who can tell me cal cmd's source code?