From: Timo Sirainen Date: Mon, 12 Aug 2024 08:56:10 +0000 (+0300) Subject: lib-program-client, global: Remove program_client_parameters.debug X-Git-Tag: 2.4.0~435 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0f7702b256bebd96246a8cb746bfa3a60b72c42f;p=thirdparty%2Fdovecot%2Fcore.git lib-program-client, global: Remove program_client_parameters.debug Just inherit it from the parent event. --- diff --git a/src/lib-program-client/program-client.c b/src/lib-program-client/program-client.c index 59720b18cc..6fd76e8e48 100644 --- a/src/lib-program-client/program-client.c +++ b/src/lib-program-client/program-client.c @@ -477,13 +477,11 @@ void program_client_init(struct program_client *pclient, pool_t pool, pclient->event = event_create(NULL); else { pclient->params = *params; - pclient->debug = params->debug; pclient->params.dns_client_socket_path = p_strdup(pool, params->dns_client_socket_path); pclient->params.home = p_strdup(pool, params->home); pclient->event = event_create(params->event); - event_set_forced_debug(pclient->event, params->debug); } program_client_set_label(pclient, initial_label); diff --git a/src/lib-program-client/program-client.h b/src/lib-program-client/program-client.h index 7dcdb1488b..d424c27425 100644 --- a/src/lib-program-client/program-client.h +++ b/src/lib-program-client/program-client.h @@ -26,7 +26,6 @@ struct program_client_parameters { struct event *event; bool allow_root:1; - bool debug:1; bool drop_stderr:1; /* use o_stream_dot, which is mainly useful to make sure that an unexpectedly closed connection doesn't cause the partial input to diff --git a/src/lib-program-client/test-program-client-local.c b/src/lib-program-client/test-program-client-local.c index 6aaed792db..b680819cd5 100644 --- a/src/lib-program-client/test-program-client-local.c +++ b/src/lib-program-client/test-program-client-local.c @@ -26,7 +26,6 @@ static const char *pclient_test_io_string = static struct program_client_parameters pc_params = { .client_connect_timeout_msecs = 10000, .input_idle_timeout_msecs = 5000, - .debug = FALSE, .restrict_set = { .uid = (uid_t)-1, .gid = (gid_t)-1, @@ -268,10 +267,11 @@ int main(int argc, char *argv[]) lib_init(); + pc_params.event = event_create(NULL); while ((c = getopt(argc, argv, "D")) > 0) { switch (c) { case 'D': - pc_params.debug = TRUE; + event_set_forced_debug(pc_params.event, TRUE); break; default: i_fatal("Usage: %s [-D]", argv[0]); @@ -284,6 +284,7 @@ int main(int argc, char *argv[]) lib_signals_deinit(); io_loop_destroy(&ioloop); + event_unref(&pc_params.event); lib_deinit(); return ret; } diff --git a/src/lib-program-client/test-program-client-net.c b/src/lib-program-client/test-program-client-net.c index c7743ed176..b3d0114e4e 100644 --- a/src/lib-program-client/test-program-client-net.c +++ b/src/lib-program-client/test-program-client-net.c @@ -30,7 +30,6 @@ static const char *pclient_test_io_string = static struct program_client_parameters pc_params = { .client_connect_timeout_msecs = 5000, .input_idle_timeout_msecs = 10000, - .debug = FALSE, }; static struct test_server { @@ -530,10 +529,11 @@ int main(int argc, char *argv[]) lib_init(); + pc_params.event = event_create(NULL); while ((c = getopt(argc, argv, "D")) > 0) { switch (c) { case 'D': - pc_params.debug = TRUE; + event_set_forced_debug(pc_params.event, TRUE); break; default: i_fatal("Usage: %s [-D]", argv[0]); @@ -542,6 +542,7 @@ int main(int argc, char *argv[]) ret = test_run(tests); + event_unref(&pc_params.event); lib_deinit(); return ret; } diff --git a/src/lib-program-client/test-program-client-unix.c b/src/lib-program-client/test-program-client-unix.c index e9a58bf4f6..94ba3700f0 100644 --- a/src/lib-program-client/test-program-client-unix.c +++ b/src/lib-program-client/test-program-client-unix.c @@ -29,7 +29,6 @@ static const char *pclient_test_io_string = static struct program_client_parameters pc_params = { .client_connect_timeout_msecs = 1000, .input_idle_timeout_msecs = 5000, - .debug = FALSE, }; static struct test_server { @@ -478,10 +477,11 @@ int main(int argc, char *argv[]) lib_init(); + pc_params.event = event_create(NULL); while ((c = getopt(argc, argv, "D")) > 0) { switch (c) { case 'D': - pc_params.debug = TRUE; + event_set_forced_debug(pc_params.event, TRUE); break; default: i_fatal("Usage: %s [-D]", argv[0]); @@ -490,6 +490,7 @@ int main(int argc, char *argv[]) ret = test_run(tests); + event_unref(&pc_params.event); lib_deinit(); return ret; } diff --git a/src/lib-smtp/smtp-submit.c b/src/lib-smtp/smtp-submit.c index 7537ed424d..5b58c7da58 100644 --- a/src/lib-smtp/smtp-submit.c +++ b/src/lib-smtp/smtp-submit.c @@ -84,6 +84,7 @@ smtp_submit_session_init(const struct smtp_submit_input *input, session->allow_root = input->allow_root; session->event = event_create(input->event_parent); + event_set_forced_debug(session->event, set->mail_debug); event_add_category(session->event, &event_category_smtp_submit); return session; @@ -412,8 +413,8 @@ smtp_submit_send_sendmail(struct smtp_submit *subm) i_zero(&pc_params); pc_params.client_connect_timeout_msecs = set->submission_timeout * 1000; pc_params.input_idle_timeout_msecs = set->submission_timeout * 1000; - pc_params.debug = set->mail_debug; pc_params.event = subm->event; + pc_params.allow_root = subm->session->allow_root; restrict_access_init(&pc_params.restrict_set); diff --git a/src/plugins/quota/quota.c b/src/plugins/quota/quota.c index 48f1e93916..aecc0d24d8 100644 --- a/src/plugins/quota/quota.c +++ b/src/plugins/quota/quota.c @@ -1010,7 +1010,7 @@ static void quota_warning_execute(struct quota_root *root, const char *cmd, struct program_client_parameters params = { .client_connect_timeout_msecs = 1000, - .debug = event_want_debug(root->quota->event), + .event = root->quota->event, }; struct program_client *pc; diff --git a/src/plugins/welcome/welcome-plugin.c b/src/plugins/welcome/welcome-plugin.c index 44f1c9b236..0b2fea8b74 100644 --- a/src/plugins/welcome/welcome-plugin.c +++ b/src/plugins/welcome/welcome-plugin.c @@ -55,7 +55,6 @@ static void script_execute(struct mail_user *user, const char *cmd, bool wait) struct program_client_parameters params = { .client_connect_timeout_msecs = 1000, .event = user->event, - .debug = event_want_debug(user->event), .home = home, };