Do not remove sudoedit temporary files if we cannot overwrite the real file.
The warning message says the files were preserved but they actually got removed.
This commit is contained in:
@@ -1110,8 +1110,10 @@ sudo_edit(struct command_details *command_details)
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
errors = sudo_edit_copy_tfiles(command_details, tf, nfiles, times);
|
errors = sudo_edit_copy_tfiles(command_details, tf, nfiles, times);
|
||||||
if (errors)
|
if (errors) {
|
||||||
goto cleanup;
|
/* Preserve the edited temporary files. */
|
||||||
|
rc = W_EXITCODE(1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < nfiles; i++)
|
for (i = 0; i < nfiles; i++)
|
||||||
free(tf[i].tfile);
|
free(tf[i].tfile);
|
||||||
|
Reference in New Issue
Block a user