Panic-die if .include specifies a non-absolute path.
authorPhilip Hazel <ph10@hermes.cam.ac.uk>
Thu, 16 Feb 2006 14:54:15 +0000 (14:54 +0000)
committerPhilip Hazel <ph10@hermes.cam.ac.uk>
Thu, 16 Feb 2006 14:54:15 +0000 (14:54 +0000)
doc/doc-txt/ChangeLog
src/src/readconf.c
test/confs/0290
test/paniclog/0290 [new file with mode: 0644]
test/scripts/0000-Basic/0290
test/stderr/0290 [new file with mode: 0644]

index ca8f59ac2d26ffd1437aeac18dba236216b9a349..c0df4a91f186b1ecb4428b912ae6739147f0eed0 100644 (file)
@@ -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
 -------------------------------------------
 
 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.
 
       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
 -----------------
 
 Exim version 4.60
 -----------------
index 62b6d5b8572a4848a9074b93b76a7dc54290e8be..37df2464e98b6cc5edbd4d9a7a108aa460176d40 100644 (file)
@@ -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    *
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -812,6 +812,10 @@ for (;;)
       }
     *t = 0;
 
       }
     *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));
     if (include_if_exists != 0 && (Ustat(ss, &statbuf) != 0)) continue;
 
     save = store_get(sizeof(config_file_item));
index 312aacd9b2d09c54096833ca5efc3811d13913bd..929a907408f2a3d2a3c04ddb266d6e88e6fa459f 100644 (file)
@@ -4,6 +4,7 @@ FOOBAR=
 FOO=inc1
 BAR=.include "DIR/aux-fixed/TESTNUM.inc2"
 RT = receive_timeout = 1s
 FOO=inc1
 BAR=.include "DIR/aux-fixed/TESTNUM.inc2"
 RT = receive_timeout = 1s
+INC=
 
 C1=#
 C2=#
 
 C1=#
 C2=#
@@ -22,8 +23,8 @@ trusted_users = CALLER
 # ----- Main settings -----
 
 FOOBAR  .include DIR/aux-fixed/TESTNUM.FOO
 # ----- Main settings -----
 
 FOOBAR  .include DIR/aux-fixed/TESTNUM.FOO
-
 RT
 RT
+INC
 
 remote_sort_domains = a:b:c
 
 
 remote_sort_domains = a:b:c
 
diff --git a/test/paniclog/0290 b/test/paniclog/0290
new file mode 100644 (file)
index 0000000..24b6854
--- /dev/null
@@ -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"
index 48907f4fc9cc24e86eb20309b29560c5f2ce4c4a..f2d69e1d0025490b24774da1af504668382a6d8f 100644 (file)
@@ -7,3 +7,6 @@ exim -DRT -bP receive_timeout
 ****
 exim '-D RT = receive_timeout = 4s ' -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 (file)
index 0000000..cd1712e
--- /dev/null
@@ -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"