From: Vsevolod Stakhov Date: Mon, 30 Jun 2008 12:11:54 +0000 (+0400) Subject: * Add checking of tempdir (ported from rpop) X-Git-Tag: 0.2.7~395 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5014f7e7cbddb7890502bdf6ee53c7be60124f60;p=thirdparty%2Frspamd.git * Add checking of tempdir (ported from rpop) --- diff --git a/cfg_file.y b/cfg_file.y index 26b97871a2..2af513eb66 100644 --- a/cfg_file.y +++ b/cfg_file.y @@ -80,6 +80,16 @@ command : tempdir : TEMPDIR EQSIGN QUOTEDSTRING { + struct stat st; + + if (stat ($3, &st) == -1) { + yyerror ("yyparse: cannot stat directory \"%s\": %s", $3, strerror (errno)); + YYERROR; + } + if (!S_ISDIR (st.st_mode)) { + yyerror ("yyparse: \"%s\" is not a directory", $3); + YYERROR; + } cfg->temp_dir = $3; } ;