diff options
author | Philip Hazel <ph10@hermes.cam.ac.uk> | 2006-02-16 14:54:15 +0000 |
---|---|---|
committer | Philip Hazel <ph10@hermes.cam.ac.uk> | 2006-02-16 14:54:15 +0000 |
commit | 145396a644de3d31ed90104fd29bcd795e9ccad1 (patch) | |
tree | c0215c0d2bb14904303d1caae2cc9cc06c15fb20 | |
parent | 11b3bc4dfd112747273573c2e895021398959d23 (diff) |
Panic-die if .include specifies a non-absolute path.
-rw-r--r-- | doc/doc-txt/ChangeLog | 4 | ||||
-rw-r--r-- | src/src/readconf.c | 6 | ||||
-rw-r--r-- | test/confs/0290 | 3 | ||||
-rw-r--r-- | test/paniclog/0290 | 2 | ||||
-rw-r--r-- | test/scripts/0000-Basic/0290 | 3 | ||||
-rw-r--r-- | test/stderr/0290 | 3 |
6 files changed, 18 insertions, 3 deletions
diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index ca8f59ac2..c0df4a91f 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -1,4 +1,4 @@ -$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.304 2006/02/16 10:05:33 ph10 Exp $ +$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.305 2006/02/16 14:54:15 ph10 Exp $ Change log file for Exim from version 4.21 ------------------------------------------- @@ -191,6 +191,8 @@ PH/37 When running in the test harness, use -odi for submitted messages (e.g. bounces) except when queue_only is set, to avoid logging races between the different processes. +PH/38 Panic-die if .include specifies a non-absolute path. + Exim version 4.60 ----------------- diff --git a/src/src/readconf.c b/src/src/readconf.c index 62b6d5b85..37df2464e 100644 --- a/src/src/readconf.c +++ b/src/src/readconf.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/readconf.c,v 1.19 2006/02/13 12:02:59 ph10 Exp $ */ +/* $Cambridge: exim/src/src/readconf.c,v 1.20 2006/02/16 14:54:15 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -812,6 +812,10 @@ for (;;) } *t = 0; + if (*ss != '/') + log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, ".include specifies a non-" + "absolute path \"%s\"", ss); + if (include_if_exists != 0 && (Ustat(ss, &statbuf) != 0)) continue; save = store_get(sizeof(config_file_item)); diff --git a/test/confs/0290 b/test/confs/0290 index 312aacd9b..929a90740 100644 --- a/test/confs/0290 +++ b/test/confs/0290 @@ -4,6 +4,7 @@ FOOBAR= FOO=inc1 BAR=.include "DIR/aux-fixed/TESTNUM.inc2" RT = receive_timeout = 1s +INC= C1=# C2=# @@ -22,8 +23,8 @@ trusted_users = CALLER # ----- Main settings ----- FOOBAR .include DIR/aux-fixed/TESTNUM.FOO - RT +INC remote_sort_domains = a:b:c diff --git a/test/paniclog/0290 b/test/paniclog/0290 new file mode 100644 index 000000000..24b6854cc --- /dev/null +++ b/test/paniclog/0290 @@ -0,0 +1,2 @@ +1999-03-02 09:44:33 Exim configuration error in line 27 of TESTSUITE/test-config: + .include specifies a non-absolute path "non/absolute" diff --git a/test/scripts/0000-Basic/0290 b/test/scripts/0000-Basic/0290 index 48907f4fc..f2d69e1d0 100644 --- a/test/scripts/0000-Basic/0290 +++ b/test/scripts/0000-Basic/0290 @@ -7,3 +7,6 @@ exim -DRT -bP receive_timeout **** exim '-D RT = receive_timeout = 4s ' -bP receive_timeout **** +1 +exim -DINC='.include non/absolute' -bP receive_timeout +**** diff --git a/test/stderr/0290 b/test/stderr/0290 new file mode 100644 index 000000000..cd1712e9f --- /dev/null +++ b/test/stderr/0290 @@ -0,0 +1,3 @@ +LOG: PANIC DIE + Exim configuration error in line 27 of TESTSUITE/test-config: + .include specifies a non-absolute path "non/absolute" |