Files
vectorcraft/crates/format/src
dotCooCoo 9d7d310e83 Save: a checked save opens an existing file without creating one
When the rename is refused, a checked save on Unix copied the new content
into the existing file, opened with `O_CREAT` after a separate check that
the file was there. A file removed between the check and the open was
created again before the final check of the folder, so a folder moved out
of the write root could be left holding an empty file.

The existing file is now opened without `O_CREAT`; a missing one is created
only after the final check, as before. The open is non-blocking and only a
regular file is written, so a FIFO at the name fails at once. The rule that
Linux's `fs.protected_regular` applied to the `O_CREAT` open is kept: in a
sticky folder that the group or others can write to, a file owned by
neither this user nor the folder's owner is refused.
2026-12-03 03:31:08 -08:00
..