mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-02 14:51:20 -05:00
39c0f35f22
A checked save (`write_atomic_checked`, used by the engine's file writes while automation write roots are set) opens the destination folder once and puts the file in place through that open folder. A folder moved after it was opened still received the file, so moving it out of the write root while the file was written placed the file outside the root. After the file is written, before it takes the old file's permissions and again right before it is renamed into place, the folder's current path is checked again with the same check. The copy fallback checks it before the target is opened and again before the target is created or overwritten. A folder moved outside the root, or one whose current path the system does not report (FreeBSD), is refused: the temporary file and any copy of the old content are removed, and the error names the original destination. A move within the root keeps working as before. Follows the checked-write work in4cb6f8f152and6cf9145890.