From: Philip Hazel Date: Mon, 1 Aug 2005 15:01:12 +0000 (+0000) Subject: The use of forbid_filter_existstest now also locks out ${stat: X-Git-Tag: exim-4_53~76 X-Git-Url: https://git.exim.org/exim.git/commitdiff_plain/254e032f97775a5331fdeb3ba0df9a96f52494d7 The use of forbid_filter_existstest now also locks out ${stat: expansions. --- diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index d2600f969..99ebabc3e 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -1,4 +1,4 @@ -$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.187 2005/08/01 14:41:25 ph10 Exp $ +$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.188 2005/08/01 15:01:12 ph10 Exp $ Change log file for Exim from version 4.21 ------------------------------------------- @@ -25,6 +25,9 @@ PH/05 Replaced all Tom's calls to snprintf() with calls to the internal string_format() function, because snprintf() does not exist on all operating systems. +PH/06 The use of forbid_filter_existstest now also locks out the use of the + ${stat: expansion item. + Exim version 4.52 ----------------- diff --git a/doc/doc-txt/NewStuff b/doc/doc-txt/NewStuff index 976a1e89e..f358f7a48 100644 --- a/doc/doc-txt/NewStuff +++ b/doc/doc-txt/NewStuff @@ -1,4 +1,4 @@ -$Cambridge: exim/doc/doc-txt/NewStuff,v 1.58 2005/08/01 14:00:34 ph10 Exp $ +$Cambridge: exim/doc/doc-txt/NewStuff,v 1.59 2005/08/01 15:01:12 ph10 Exp $ New Features in Exim -------------------- @@ -50,6 +50,9 @@ PH/01 Support for SQLite database lookups has been added. This is another PH/02 The variable $message_id is now deprecated, to be replaced by $message_exim_id, which makes it clearer which ID is being referenced. +PH/03 The use of forbid_filter_existstest now also locks out the use of the + ${stat: expansion item. + Exim version 4.52 ----------------- diff --git a/src/src/expand.c b/src/src/expand.c index 86d410499..92e342d37 100644 --- a/src/src/expand.c +++ b/src/src/expand.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/expand.c,v 1.38 2005/08/01 14:00:35 ph10 Exp $ */ +/* $Cambridge: exim/src/src/expand.c,v 1.39 2005/08/01 15:01:12 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -4846,6 +4846,12 @@ while (*s != 0) mode_t mode; struct stat st; + if ((expand_forbid & RDO_EXISTS) != 0) + { + expand_string_message = US"Use of the stat() expansion is not permitted"; + goto EXPAND_FAILED; + } + if (stat(CS sub, &st) < 0) { expand_string_message = string_sprintf("stat(%s) failed: %s",