cap-std
cap-std copied to clipboard
tempfile: add new_with_modes and is_named methods
trafficstars
On filesystems that do not support O_TMPFILE (e.g. vfat), TempFile::new()
automatically falls back to a potentially world readable named temp file.
Add TempFile::new_with_modes() to create temp files with a chosen mode directly.
We pass 2 modes, one for unnamed tempfile (happy path, created with O_TMPFILE),
and one for named tempfile.
The final mode is still restricted by the process umask.
@cgwalters this will help improve cap-std-ext atomic* permissions handling