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

   ## Summary
   
   `mount -o` passed the whole option list to the file system as data, and the 
mount flags were always 0. So `mount -o ro` or `mount -o noexec` did not set 
`MS_RDONLY` or `MS_NOEXEC`.
   
   This PR takes the generic options out of the list and passes them as mount 
flags: `ro`, `rw`, `noexec`, `exec`, `nosuid`, `suid`, `nodev`, `dev`, `sync`, 
`async`, `noatime` and `atime`. A later option wins (`ro,rw` gives no flag). 
The other options go to the file system as before, in the same order. If no 
option is left, the data is NULL, as without `-o`.
   
   The NSH command page is updated in apache/nuttx#NNNNN.
   
   ## Impact
   
   Only commands that use `-o` with a generic option change: the option now 
sets the flag instead of going to the file system.
   
   ## Testing
   
   On `qemu-armv8a:knsh` (QEMU 11 with HVF on an Apple M4), with 
apache/nuttx#20762: after `mount -t tmpfs -o noexec /nx3`, a program copied 
there is listed without execute bits, and with the execute permission check it 
fails with "Permission denied". The same program on a tmpfs mount without `-o` 
runs.
   
   The option parsing compiled on the host with 12 cases: options before, 
between and after file system options (`noexec,trans=virtio,tag=system`, 
`trans=virtio,tag=system,ro`), only generic options, `ro,rw`, empty items, and 
names that only start like an option (`noexecx`).
   
   `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