2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

Fix sudoedit of a non-existent file. From Tilo Stritzky.

This commit is contained in:
Todd C. Miller
2007-09-03 20:28:15 +00:00
parent 2bff032c9f
commit 32403a2d83

View File

@@ -130,7 +130,7 @@ int sudo_edit(argc, argv, envp)
}
}
set_perms(PERM_ROOT);
if (error || !S_ISREG(sb.st_mode)) {
if (error || (ofd != -1 && !S_ISREG(sb.st_mode))) {
if (error)
warning("%s", *ap);
else