]> granicus.if.org Git - sudo/commitdiff
Fix sudoedit of a non-existent file. From Tilo Stritzky.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 3 Sep 2007 20:28:15 +0000 (20:28 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 3 Sep 2007 20:28:15 +0000 (20:28 +0000)
sudo_edit.c

index 1486da922ddc5f678231e58cd2f1890fc061a8d9..ca67716152fba33e7d5435936dad625d61501463 100644 (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