]> granicus.if.org Git - sudo/commitdiff
sudoers file open is now done only in check_sudoers() so
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 21 Jan 1998 05:02:59 +0000 (05:02 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 21 Jan 1998 05:02:59 +0000 (05:02 +0000)
we just do a rewind() instead of an open.  May help people on
solaris who were getting EAGAIN.

parse.c

diff --git a/parse.c b/parse.c
index a3373c4ab28bd4d97856e09a9e15ec128899eeff..fff6bb9811ecbea7960e7033ad179084fb1c5b73 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -105,17 +105,13 @@ static int has_meta       __P((char *));
 int validate(check_cmnd)
     int check_cmnd;
 {
-    FILE *sudoers_fp;
     int return_code;
 
     /* become sudoers file owner */
     set_perms(PERM_SUDOERS, 0);
 
-    if ((sudoers_fp = fopen(_PATH_SUDO_SUDOERS, "r")) == NULL) {
-       perror(_PATH_SUDO_SUDOERS);
-       log_error(NO_SUDOERS_FILE);
-       exit(1);
-    }
+    /* we opened _PATH_SUDO_SUDOERS in check_sudoers() so just rewind it */
+    rewind(sudoers_fp);
     yyin = sudoers_fp;
     yyout = stdout;