casaroli opened a new pull request, #20798:
URL: https://github.com/apache/nuttx/pull/20798
## Summary
POSIX: `mkfifo()` clears the bits of the file mode creation mask in the
permissions of the new FIFO. NuttX gave the mode to `nx_mkfifo()` unchanged:
after `umask(077)`, `mkfifo(path, 0666)` made a FIFO with the permissions 0666.
`mknod()` with `S_IFIFO` calls `mkfifo()` and had the same problem.
`mkfifo()` in libc now clears the bits of `getumask()` in the mode. The
reference documentation said that the mode is ignored; NuttX keeps it with
`CONFIG_PSEUDOFS_ATTRIBUTES`, so the documentation now says that
(`Documentation/reference/user/10_filesystem.rst`, same commit).
## Impact
FIFOs made with `mkfifo()` or `mknod(S_IFIFO)` get the permissions that
POSIX requires. Internal FIFOs (`nx_mkfifo()` from `net/local`) do not change.
No new configuration option.
## Testing
`umaskk.c`: `umask(077)`, then `mkfifo("/um_fifo", 0666)` and
`mknod("/um_fifo2", S_IFIFO | 0666, 0)`, then `stat()`.
`CONFIG_PSEUDOFS_ATTRIBUTES` and `CONFIG_PIPES` on.
| | master | this PR |
|---|---|---|
| `qemu-armv8a:knsh` (HVF): `mkfifo()` | 0666 | 0600 |
| `qemu-armv8a:knsh` (HVF): `mknod(S_IFIFO)` | 0666 | 0600 |
| `qemu-armv8a:nsh` (HVF): `mkfifo()` | 0666 | 0600 |
| `qemu-armv8a:nsh` (HVF): `mknod(S_IFIFO)` | 0666 | 0600 |
ostest passes on `qemu-armv8a:knsh` and `qemu-armv8a:nsh`.
`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]