Files
vectorcraft/crates/format
dotCooCoo 6cf9145890 Save: checked writes check the open folder's path as it is
The second check of a checked write passed the open folder's path as
text and looked it up again. A path that was not valid UTF-8 was refused,
and a folder on that path replaced by a link into an allowed folder
between the two lookups could let a place outside pass.
check_write_real compares the open folder's real path with the write
roots and the script's grants as it is, without looking it up again.

- The folder is opened with O_PATH on Linux, Android and FreeBSD, so a
  folder that can be written and searched but not listed takes the file.
  The folder flush opens it for reading, and an error there still
  reports the completed write.
- The replaced file's permissions are read after the new content is
  written, as write_atomic_with reads them, so permissions taken away
  meanwhile stay taken away. Its ACL is read only from the same file.
- A folder that changed while it was opened is no longer reported as a
  read-only location.
- Errors name the kept temporary file where its folder is now, after
  the folder moved.
- A file already at the name the old content is copied to is left as it
  is: only a copy this save made and could not finish is removed.
2026-12-01 23:24:20 -08:00
..