diff options
-rw-r--r-- | src/src/readconf.c | 5 | ||||
-rw-r--r-- | test/confs/0907 | 3 | ||||
-rw-r--r-- | test/confs/0908 | 1 | ||||
-rw-r--r-- | test/scripts/0000-Basic/0907 | 4 | ||||
l--------- | test/scripts/0000-Basic/0908 | 1 | ||||
-rw-r--r-- | test/stderr/0907 | 2 | ||||
-rw-r--r-- | test/stderr/0908 | 2 |
7 files changed, 18 insertions, 0 deletions
diff --git a/src/src/readconf.c b/src/src/readconf.c index 95abaf5be..fd9657e0e 100644 --- a/src/src/readconf.c +++ b/src/src/readconf.c @@ -3469,6 +3469,11 @@ a macro definition. */ while ((s = get_config_line()) != NULL) { + + if (config_lineno == 1 && Ustrstr(s, "\xef\xbb\xbf") == s) + log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, + "found unexpected BOM (Byte Order Mark)"); + if (isupper(s[0])) read_macro_assignment(s); else if (Ustrncmp(s, "domainlist", 10) == 0) diff --git a/test/confs/0907 b/test/confs/0907 new file mode 100644 index 000000000..8cb2b1b6d --- /dev/null +++ b/test/confs/0907 @@ -0,0 +1,3 @@ +# This file contains a BOM at the very beginning +tls_advertise_hosts = +keep_environment = diff --git a/test/confs/0908 b/test/confs/0908 new file mode 100644 index 000000000..27af1d5f2 --- /dev/null +++ b/test/confs/0908 @@ -0,0 +1 @@ +.include DIR/confs/0907 diff --git a/test/scripts/0000-Basic/0907 b/test/scripts/0000-Basic/0907 new file mode 100644 index 000000000..341a63f48 --- /dev/null +++ b/test/scripts/0000-Basic/0907 @@ -0,0 +1,4 @@ +# check for BOM in an included config file (0908) +# +1 +exim -bP config diff --git a/test/scripts/0000-Basic/0908 b/test/scripts/0000-Basic/0908 new file mode 120000 index 000000000..8cc1a8c6e --- /dev/null +++ b/test/scripts/0000-Basic/0908 @@ -0,0 +1 @@ +0907
\ No newline at end of file diff --git a/test/stderr/0907 b/test/stderr/0907 new file mode 100644 index 000000000..fe9ba7150 --- /dev/null +++ b/test/stderr/0907 @@ -0,0 +1,2 @@ +1999-03-02 09:44:33 Exim configuration error in line 1 of TESTSUITE/test-config: + found unexpected BOM (Byte Order Mark) diff --git a/test/stderr/0908 b/test/stderr/0908 new file mode 100644 index 000000000..ad35a1ae6 --- /dev/null +++ b/test/stderr/0908 @@ -0,0 +1,2 @@ +1999-03-02 09:44:33 Exim configuration error in line 1 of TESTSUITE/confs/0907: + found unexpected BOM (Byte Order Mark) |