From 2afc40a88856ba00c517ca9d58ec834a3492aa91 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 4 Jul 1997 05:05:23 +0000 Subject: Remodularize so the parser is more self-contained. svn path=/trunk/; revision=1150 --- rcfile_y.y | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'rcfile_y.y') diff --git a/rcfile_y.y b/rcfile_y.y index 4b95d5f9..ce46e64c 100644 --- a/rcfile_y.y +++ b/rcfile_y.y @@ -22,12 +22,19 @@ #include "fetchmail.h" -struct query cmd_opts; /* where to put command-line info */ +/* parser reads these */ +char *rcfile; /* path name of rc file */ +struct query cmd_opts; /* where to put command-line info */ + +/* parser sets these */ +int poll_interval; /* poll interval in seconds */ +char *logfile; /* log file for daemon mode */ +bool use_syslog; /* if syslog was set */ struct query *querylist; /* head of server list (globally visible) */ -int yydebug; /* in case we didn't generate with -- debug */ +int yydebug; /* in case we didn't generate with -- debug */ -static struct query current; /* current server record */ +static struct query current; /* current server record */ static int prc_errflag; static void record_current(); @@ -256,7 +263,7 @@ const char *pathname; /* pathname for the configuration file */ errno = 0; /* special cases useful for debugging purposes */ - if (strcmp("/dev/null", pathname) == 0 || versioninfo) + if (strcmp("/dev/null", pathname) == 0) return(0); /* the run control file must have the same uid as the REAL uid of this @@ -291,15 +298,18 @@ const char *pathname; /* pathname for the configuration file */ return(0); } -int prc_parse_file (pathname) +int prc_parse_file (pathname, securecheck) /* digest the configuration into a linked list of host records */ const char *pathname; /* pathname for the configuration file */ +const bool securecheck; /* check for a secure rc file? */ { prc_errflag = 0; querylist = hosttail = (struct query *)NULL; + errno = 0; + /* Check that the file is secure */ - if ((prc_errflag = prc_filecheck(pathname)) != 0) + if (securecheck && (prc_errflag = prc_filecheck(pathname)) != 0) return(prc_errflag); if (errno == ENOENT) -- cgit v1.2.3