summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2000-12-15 14:35:59 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2000-12-15 14:35:59 +0000
commitb82df945ea8eead73355210cbd6bb3c310dde16d (patch)
tree7589db4a7e0b7b54ef622417ef06d292f23b3a30
parent0e856aa76e21bda83ba7ce860f2054e52afa2794 (diff)
Give sensible error messaage for a zero-length sudoers file.
From the sudo cvs repo.
-rw-r--r--usr.bin/sudo/sudo.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.bin/sudo/sudo.c b/usr.bin/sudo/sudo.c
index 3f6fa8f2e9e..1ba3e6003b8 100644
--- a/usr.bin/sudo/sudo.c
+++ b/usr.bin/sudo/sudo.c
@@ -826,6 +826,8 @@ check_sudoers()
log_error(USE_ERRNO, "can't stat %s", _PATH_SUDOERS);
else if (!S_ISREG(statbuf.st_mode))
log_error(0, "%s is not a regular file", _PATH_SUDOERS);
+ else if (statbuf.st_size == 0)
+ log_error(0, "%s is zero length", _PATH_SUDOERS);
else if ((statbuf.st_mode & 07777) != SUDOERS_MODE)
log_error(0, "%s is mode 0%o, should be 0%o", _PATH_SUDOERS,
(statbuf.st_mode & 07777), SUDOERS_MODE);