Bugzilla – Bug 929
sudoedit leaves temporary files in /var/tmp
Last modified: 2020-06-19 05:59:51 MDT
Steps to reproduce: 1. Use sudoedit to edit a file, like "sudoedit foo". 2. Edit the file in the editor, save and exit. 3. A temporary file named like "foo.XXvWEXok" will be left in /var/tmp. This bug only occurs if the file is modified by the editor, that is, if sudoedit thinks the file is changed. This bug does not occur with 1.8.31. I believe this bug occurs because in 1.9.0, sudo_edit.c's sudo_edit_copy_tfiles() no longer unlinks the temporary file after a success operation, so the temporary file will not be removed. The same function in 1.8.31 does have an unlink() call after success.
Thanks for reporting this. It is fixed by https://www.sudo.ws/repos/sudo/rev/2bc4822b7382 which will be in sudo 1.9.1.
Fixed in sudo 1.9.1