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