mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-05 05:22:58 -05:00
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.