summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2022-01-25 19:46:22 +0000
committerJeremy Harris <jgh146exb@wizmail.org>2022-01-27 13:12:36 +0000
commit9f691660159a9279353a99fca776c7687faaae26 (patch)
treed407e259bcd380c78c8eed23c1892c0968ef6cec /src
parentdad53f7da826ea1199cf0b3b63e33e852373b084 (diff)
Stop option for ACL control of debug logging
Diffstat (limited to 'src')
-rw-r--r--src/src/acl.c11
-rw-r--r--src/src/functions.h2
-rw-r--r--src/src/log.c4
3 files changed, 12 insertions, 5 deletions
diff --git a/src/src/acl.c b/src/src/acl.c
index c55a42b6f..19c1bbbd9 100644
--- a/src/src/acl.c
+++ b/src/src/acl.c
@@ -3481,7 +3481,7 @@ for (; cb; cb = cb->next)
{
uschar * debug_tag = NULL;
uschar * debug_opts = NULL;
- BOOL kill = FALSE;
+ BOOL kill = FALSE, stop = FALSE;
while (*p == '/')
{
@@ -3501,13 +3501,20 @@ for (; cb; cb = cb->next)
for (pp += 4; *pp && *pp != '/';) pp++;
kill = TRUE;
}
+ else if (Ustrncmp(pp, "stop", 4) == 0)
+ {
+ for (pp += 4; *pp && *pp != '/';) pp++;
+ stop = TRUE;
+ }
else
while (*pp && *pp != '/') pp++;
p = pp;
}
if (kill)
- debug_logging_stop();
+ debug_logging_stop(TRUE);
+ else if (stop)
+ debug_logging_stop(FALSE);
else
debug_logging_activate(debug_tag, debug_opts);
break;
diff --git a/src/src/functions.h b/src/src/functions.h
index 39dfc46fe..2a1142b35 100644
--- a/src/src/functions.h
+++ b/src/src/functions.h
@@ -186,7 +186,7 @@ extern int dcc_process(uschar **);
#endif
extern void debug_logging_activate(uschar *, uschar *);
-extern void debug_logging_stop(void);
+extern void debug_logging_stop(BOOL);
extern void debug_print_argv(const uschar **);
extern void debug_print_ids(uschar *);
extern void debug_printf_indent(const char *, ...) PRINTF_FUNCTION(1,2);
diff --git a/src/src/log.c b/src/src/log.c
index 2c82ee0a4..fe9bd0c9f 100644
--- a/src/src/log.c
+++ b/src/src/log.c
@@ -1510,14 +1510,14 @@ else
void
-debug_logging_stop(void)
+debug_logging_stop(BOOL kill)
{
if (!debug_file || !debuglog_name[0]) return;
debug_selector = 0;
fclose(debug_file);
debug_file = NULL;
-unlink_log(lt_debug);
+if (kill) unlink_log(lt_debug);
}
/* Called from the appendfile transport setup. */