From: aland Date: Wed, 29 Mar 2006 19:56:00 +0000 (+0000) Subject: Port dictionary file sanity checks from the head X-Git-Tag: release_1_1_2~85 X-Git-Url: http://www.project-moonshot.org/gitweb/?a=commitdiff_plain;h=926b99df8a43791e2d89428b5e8677eccfedca40;p=freeradius.git Port dictionary file sanity checks from the head --- diff --git a/src/lib/dict.c b/src/lib/dict.c index 30d2b7d..4d4024e 100644 --- a/src/lib/dict.c +++ b/src/lib/dict.c @@ -882,6 +882,12 @@ static int my_dict_init(const char *dir, const char *fn, } stat(fn, &statbuf); /* fopen() guarantees this will succeed */ + if (!S_ISREG(statbuf.st_mode)) { + fclose(fp); + librad_log("dict_init: Dictionary \"%s\" is not a regular file", + fn); + return -1; + } dict_stat_add(fn, &statbuf); /*