summaryrefslogtreecommitdiffstats
path: root/cfg_file.y
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2008-06-30 16:11:54 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2008-06-30 16:11:54 +0400
commit5014f7e7cbddb7890502bdf6ee53c7be60124f60 (patch)
tree81b22423c28e8eac8cd4d42bca44c7a92e384e73 /cfg_file.y
parenteab76d300da4e6d5712efd1db68e40cb1fc86a2c (diff)
downloadrspamd-5014f7e7cbddb7890502bdf6ee53c7be60124f60.tar.gz
rspamd-5014f7e7cbddb7890502bdf6ee53c7be60124f60.zip
* Add checking of tempdir (ported from rpop)
Diffstat (limited to 'cfg_file.y')
-rw-r--r--cfg_file.y10
1 files changed, 10 insertions, 0 deletions
diff --git a/cfg_file.y b/cfg_file.y
index 26b97871a..2af513eb6 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;
}
;