[exim-cvs] Logging: specific error for tainted tag in debug …

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Exim Git Commits Mailing List
Datum:  
To: exim-cvs
Betreff: [exim-cvs] Logging: specific error for tainted tag in debug filename
Gitweb: https://git.exim.org/exim.git/commitdiff/87f15ee4412890d4e6e93a3aa6a37697dc0912e3
Commit:     87f15ee4412890d4e6e93a3aa6a37697dc0912e3
Parent:     8de97e5b7dddd2f033d8c9d531b11eece8af3cc6
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Thu Aug 19 11:23:08 2021 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Thu Aug 19 11:23:08 2021 +0100


    Logging: specific error for tainted tag in debug filename
---
 src/src/log.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)


diff --git a/src/src/log.c b/src/src/log.c
index 1b77f98..a7ef3d8 100644
--- a/src/src/log.c
+++ b/src/src/log.c
@@ -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();