aboutsummaryrefslogtreecommitdiffstats
path: root/rcfile_y.y
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-07-04 05:05:23 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-07-04 05:05:23 +0000
commit2afc40a88856ba00c517ca9d58ec834a3492aa91 (patch)
tree91a1adb2293e3468da140cfb2031568eca886928 /rcfile_y.y
parentd2fa025b2f64bd04e19d192051463d336bb8fdd1 (diff)
downloadfetchmail-2afc40a88856ba00c517ca9d58ec834a3492aa91.tar.gz
fetchmail-2afc40a88856ba00c517ca9d58ec834a3492aa91.tar.bz2
fetchmail-2afc40a88856ba00c517ca9d58ec834a3492aa91.zip
Remodularize so the parser is more self-contained.
svn path=/trunk/; revision=1150
Diffstat (limited to 'rcfile_y.y')
-rw-r--r--rcfile_y.y22
1 files changed, 16 insertions, 6 deletions
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)