casaroli opened a new pull request, #3866:
URL: https://github.com/apache/nuttx-apps/pull/3866

   ## Summary
   
   `cp` created the new file with mode `0666`. On a file system that keeps the 
mode, a copied program lost its execute permission.
   
   This PR creates the new file with `0666` plus the execute bits of the 
source. The mode of an existing destination file does not change. Only the 
execute bits are copied, so a copy of a read-only file is still writable, as 
before.
   
   The NSH command page is updated in apache/nuttx#NNNNN.
   
   ## Impact
   
   A copy of a file with execute bits now has execute bits too.
   
   ## Testing
   
   On `qemu-armv8a:knsh` (QEMU 11 with HVF on an Apple M4) with 
`CONFIG_SCHED_USER_IDENTITY`, `CONFIG_FS_PERMISSION` and tmpfs (which keeps the 
mode): `cp` of a program with mode `0755` gives `-rwxrwxrwx`; `cp` of a file 
with mode `0644` gives `-rw-rw-rw-`. Before this change both were `-rw-rw-rw-`.
   
   `tools/checkpatch.sh -c -u -m -g` passes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to