From 99f3b480230cdc38b91dec08b361a97cc8c13b8d Mon Sep 17 00:00:00 2001
From: "Eric S. Raymond" <esr@thyrsus.com>
Date: Fri, 22 May 1998 21:39:15 +0000
Subject: Gunther Leber's patch.

svn path=/trunk/; revision=1796
---
 fetchmail.c | 2 +-
 fetchmail.h | 2 +-
 rcfile_y.y  | 7 +++++--
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/fetchmail.c b/fetchmail.c
index dccf84cf..9d1c3f1e 100644
--- a/fetchmail.c
+++ b/fetchmail.c
@@ -828,7 +828,7 @@ static int load_params(int argc, char **argv, int optind)
     }
 
     /* initialize UID handling */
-    if (!versioninfo && (st = prc_filecheck(idfile)) != 0)
+    if (!versioninfo && (st = prc_filecheck(idfile, !versioninfo)) != 0)
 	exit(st);
 #ifdef POP3_ENABLE
     else
diff --git a/fetchmail.h b/fetchmail.h
index 6a9c47d1..f45d6741 100644
--- a/fetchmail.h
+++ b/fetchmail.h
@@ -329,7 +329,7 @@ void write_saved_lists(struct query *, const char *);
 
 /* rcfile_y.y */
 int prc_parse_file(const char *, const flag);
-int prc_filecheck(const char *);
+int prc_filecheck(const char *, const flag);
 
 /* base64.c */
 void to64frombits(unsigned char *, const unsigned char *, int);
diff --git a/rcfile_y.y b/rcfile_y.y
index 2427459b..4b25404b 100644
--- a/rcfile_y.y
+++ b/rcfile_y.y
@@ -319,9 +319,10 @@ void yyerror (const char *s)
     prc_errflag++;
 }
 
-int prc_filecheck(pathname)
+int prc_filecheck(pathname, securecheck)
 /* check that a configuration file is secure */
 const char *pathname;		/* pathname for the configuration file */
+const flag securecheck;
 {
 #ifndef __EMX__
     struct stat statbuf;
@@ -345,6 +346,8 @@ const char *pathname;		/* pathname for the configuration file */
 	}
     }
 
+    if (!securecheck)	return 0;
+
     if ((statbuf.st_mode & S_IFLNK) == S_IFLNK) {
 	fprintf(stderr, "File %s must not be a symbolic link.\n", pathname);
 	return(PS_AUTHFAIL);
@@ -373,7 +376,7 @@ int prc_parse_file (const char *pathname, const flag securecheck)
     errno = 0;
 
     /* Check that the file is secure */
-    if (securecheck && (prc_errflag = prc_filecheck(pathname)) != 0)
+    if ( (prc_errflag = prc_filecheck(pathname, securecheck)) != 0 )
 	return(prc_errflag);
 
     if (errno == ENOENT)
-- 
cgit v1.2.3