diff options
| author | Chris Webb <chris@arachsys.com> | 2023-11-26 18:12:52 +0000 |
|---|---|---|
| committer | Chris Webb <chris@arachsys.com> | 2023-11-26 18:12:52 +0000 |
| commit | d3af9b57d46cd5a7b0a4688c161b18b4b8d40a28 (patch) | |
| tree | a09dd6a9d01037fb2108fe5c50aa3e9dda5e7dcc /src/input_handler.cc | |
| parent | 05bbdb27c944f6669fdd973a3b75afdb21550298 (diff) | |
Restore file ownership when editing with root privilege
When a privileged :write is used with -method replace, it silently resets
the ownership of files to root:root. Restore the original owner and group
in the same way we restore the original permissions. Ownership needs to
be restored before permissions to avoid setuid and setgid bits being set
while the file is still owned by root, and to avoid them being subsequently
lost again on chmod(2).
Diffstat (limited to 'src/input_handler.cc')
0 files changed, 0 insertions, 0 deletions
