summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/sudo/visudo.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/sudo/visudo.c b/usr.bin/sudo/visudo.c
index 4117615b137..ba8fa565174 100644
--- a/usr.bin/sudo/visudo.c
+++ b/usr.bin/sudo/visudo.c
@@ -310,7 +310,9 @@ main(argc, argv)
switch (whatnow()) {
case 'Q' : parse_error = FALSE; /* ignore parse error */
break;
- case 'x' : Exit(0);
+ case 'x' : if (sudoers_sb.st_size == 0)
+ unlink(sudoers);
+ Exit(0);
break;
}
yyrestart(yyin); /* reset lexer */