https://bugs.documentfoundation.org/show_bug.cgi?id=162868

--- Comment #1 from Mike Kaganski <[email protected]> ---
I am unsure if this could be improved, given the logic of the save. It is not
"open the file, then edit bytes in it": for safety, it is "create a new file
next to the opened file, named something like tmp1234; write bytes there; then,
after successful write, so that we know that no failure happened in the middle
of write, remove or rename the first file (the rename can be when backups are
kept), and rename the tmp1234 to the old name".

There is ReplaceFileW API *on Windows* to "impersonate" the file in such a
situation; its use was implemented in commit
c9343988204ee3e9889f3cc833adbbaca83e53e6 "tdf#119238: keep replaced file's
identity when renaming docfile". I don't know if there is something similar on
Linux, or if it's even possible with the remote filesystems (the Windows API
also actually works locally; it would be a vulnerability to allow a remote
process to impersonate other users on file server).

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to