mirror of
https://github.com/makecindy/cindy.git
synced 2026-12-06 19:17:46 +08:00
writeFile always staged content at the fixed path <target>.xdt-tmp and opened it with 'w'. A symlink planted at that path inside the workdir made the save write outside the workdir, and the final rename moved the symlink itself into the target's place. Stage at a random <target>.<hex>.xdt-tmp created exclusively with 'wx', and remove it if the write or rename fails. The name still ends in .xdt-tmp, so list and watcher filtering are unchanged. Signed-off-by: Zhao Dengfeng <2370187+zhaodengfeng@users.noreply.github.com>