You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "casaroli (via GitHub)" <gi...@apache.org> on 2026/10/17 22:30:34 UTC
[PR] nshlib: Keep the execute permission of the source in cp. [nuttx-apps]
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] nshlib: Keep the execute permission of the source in cp. [nuttx-apps]
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis merged PR #3866:
URL: https://github.com/apache/nuttx-apps/pull/3866
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org