X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/7a33a3fc2c1ae4df30eaabaf25fc59e2d6ab5d6c..5732024c9991f1e220ad203087997ca467a5cef7:/src/src/log.c diff --git a/src/src/log.c b/src/src/log.c index 1b77f98fa..b085e9ee2 100644 --- a/src/src/log.c +++ b/src/src/log.c @@ -3,7 +3,7 @@ *************************************************/ /* Copyright (c) University of Cambridge 1995 - 2018 */ -/* Copyright (c) The Exim Maintainers 2020 */ +/* Copyright (c) The Exim Maintainers 2020 - 2021 */ /* See the file NOTICE for conditions of use and distribution. */ /* Functions for writing log files. The code for maintaining datestamped @@ -518,6 +518,10 @@ switch (type) Ustrcpy(debuglog_name, buffer); if (tag) { + if (is_tainted(tag)) + die(US"exim: tainted tag for debug log filename", + US"Logging failure; please try later"); + /* this won't change the offset of the datestamp */ ok2 = string_format(buffer, sizeof(buffer), "%s%s", debuglog_name, tag); @@ -558,9 +562,7 @@ if (!ok) /* We now have the file name. After a successful open, return. */ -*fd = log_open_as_exim(buffer); - -if (*fd >= 0) +if ((*fd = log_open_as_exim(buffer)) >= 0) return; euid = geteuid();