]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
5 years agolib-smtp: test-smtp-client-errors - Rename test_servers_kill_all() to test_servers_ki...
Stephan Bosch [Wed, 8 Apr 2020 20:27:46 +0000 (22:27 +0200)] 
lib-smtp: test-smtp-client-errors - Rename test_servers_kill_all() to test_servers_kill_forced().

5 years agolib-smtp: test-smtp-client-errors - Move global initialization to main_init/deinit().
Stephan Bosch [Wed, 8 Apr 2020 20:24:47 +0000 (22:24 +0200)] 
lib-smtp: test-smtp-client-errors - Move global initialization to main_init/deinit().

5 years agolib-smtp: test-smtp-client-errors - Avoid using sleep().
Stephan Bosch [Wed, 8 Apr 2020 19:10:08 +0000 (21:10 +0200)] 
lib-smtp: test-smtp-client-errors - Avoid using sleep().

5 years agolib-smtp: test-smtp-client-errors - Use lib-signals API.
Stephan Bosch [Mon, 13 Apr 2020 12:18:05 +0000 (14:18 +0200)] 
lib-smtp: test-smtp-client-errors - Use lib-signals API.

Using signal() is not portable for installing a signal handler.

5 years agolib-smtp: test-smtp-client-errors - Generally ignore SIGPIPE.
Stephan Bosch [Wed, 8 Apr 2020 19:04:32 +0000 (21:04 +0200)] 
lib-smtp: test-smtp-client-errors - Generally ignore SIGPIPE.

Remove per-process code that achieves the same.

5 years agolib-smtp: test-smtp-client-errors - Don't ignore SIGCHLD.
Stephan Bosch [Mon, 13 Apr 2020 12:12:25 +0000 (14:12 +0200)] 
lib-smtp: test-smtp-client-errors - Don't ignore SIGCHLD.

5 years agolib-smtp: test-smtp-client-errors - Turn server-side payload read error into a debug...
Stephan Bosch [Mon, 13 Apr 2020 12:44:31 +0000 (14:44 +0200)] 
lib-smtp: test-smtp-client-errors - Turn server-side payload read error into a debug message.

This can readily occur during tests and must not issue a real error message.

5 years agolib-smtp: test-smtp-client-errors - Add log prefixes to distinguish client and server...
Stephan Bosch [Wed, 8 Apr 2020 19:02:18 +0000 (21:02 +0200)] 
lib-smtp: test-smtp-client-errors - Add log prefixes to distinguish client and server debug messages.

5 years agolib-smtp: test-smtp-payload - Use the new sub-process test API.
Stephan Bosch [Sun, 5 Apr 2020 00:40:33 +0000 (02:40 +0200)] 
lib-smtp: test-smtp-payload - Use the new sub-process test API.

This makes an effort to terminate server processes gracefully. Killing them
bluntly hampers test coverage measurement and valgrind testing.

5 years agolib-smtp: test-smtp-payload - Split off test_run_client/server() from test_run_client...
Stephan Bosch [Tue, 7 Apr 2020 22:04:05 +0000 (00:04 +0200)] 
lib-smtp: test-smtp-payload - Split off test_run_client/server() from test_run_client_server().

5 years agolib-smtp: test-smtp-payload - Adjust log prefix code to match other similar unit...
Stephan Bosch [Tue, 7 Apr 2020 21:48:44 +0000 (23:48 +0200)] 
lib-smtp: test-smtp-payload - Adjust log prefix code to match other similar unit tests.

5 years agolib-smtp: test-smtp-payload - Rename test_server_kill() to test_server_kill_forced().
Stephan Bosch [Sun, 5 Apr 2020 00:34:29 +0000 (02:34 +0200)] 
lib-smtp: test-smtp-payload - Rename test_server_kill() to test_server_kill_forced().

5 years agolib-smtp: test-smtp-payload - Move global initialization to main_init/deinit().
Stephan Bosch [Sun, 5 Apr 2020 00:32:48 +0000 (02:32 +0200)] 
lib-smtp: test-smtp-payload - Move global initialization to main_init/deinit().

5 years agolib-smtp: test-smtp-payload - Call test_files_init/deinit() in test_run_client_server().
Stephan Bosch [Sun, 5 Apr 2020 00:25:30 +0000 (02:25 +0200)] 
lib-smtp: test-smtp-payload - Call test_files_init/deinit() in test_run_client_server().

5 years agolib-smtp: test-smtp-payload - Use lib-signals API.
Stephan Bosch [Mon, 13 Apr 2020 11:28:51 +0000 (13:28 +0200)] 
lib-smtp: test-smtp-payload - Use lib-signals API.

Using signal() is not portable for installing a signal handler.

5 years agolib-smtp: test-smtp-payload - Properly exit child process.
Stephan Bosch [Mon, 13 Apr 2020 11:26:04 +0000 (13:26 +0200)] 
lib-smtp: test-smtp-payload - Properly exit child process.

5 years agolib-smtp: test-smtp-payload - Don't ignore SIGCHLD.
Stephan Bosch [Mon, 13 Apr 2020 11:23:15 +0000 (13:23 +0200)] 
lib-smtp: test-smtp-payload - Don't ignore SIGCHLD.

5 years agolib-master: master-service - Add master_service_deinit_forked().
Stephan Bosch [Fri, 10 Apr 2020 15:30:51 +0000 (17:30 +0200)] 
lib-master: master-service - Add master_service_deinit_forked().

5 years agolib-smtp: test-smtp-server-errors - Fix "many bad commands" test.
Stephan Bosch [Mon, 25 May 2020 15:16:30 +0000 (17:16 +0200)] 
lib-smtp: test-smtp-server-errors - Fix "many bad commands" test.

It didn't properly handle the two parallel connections. Removed a useless
context struct definition. Modified debug message for easier debugging.

5 years agolib-smtp: Reformat test-smtp-submit.c.
Stephan Bosch [Wed, 8 Apr 2020 23:33:22 +0000 (01:33 +0200)] 
lib-smtp: Reformat test-smtp-submit.c.

5 years agolib-smtp: Reformat test-smtp-server-errors.c.
Stephan Bosch [Wed, 8 Apr 2020 22:07:36 +0000 (00:07 +0200)] 
lib-smtp: Reformat test-smtp-server-errors.c.

5 years agolib-smtp: Reformat test-smtp-client-errors.c.
Stephan Bosch [Wed, 8 Apr 2020 20:05:57 +0000 (22:05 +0200)] 
lib-smtp: Reformat test-smtp-client-errors.c.

5 years agolib-smtp: Reformat test-smtp-payload.c.
Stephan Bosch [Sun, 5 Apr 2020 00:22:50 +0000 (02:22 +0200)] 
lib-smtp: Reformat test-smtp-payload.c.

5 years agolib-program-client: test-program-client-local - Add test for running client without...
Stephan Bosch [Fri, 22 May 2020 22:36:48 +0000 (00:36 +0200)] 
lib-program-client: test-program-client-local - Add test for running client without I/O or timeouts.

5 years agolib: child-wait - Mark the SIGCHLD handler as expected when waiting for child.
Stephan Bosch [Thu, 21 Feb 2019 01:37:41 +0000 (02:37 +0100)] 
lib: child-wait - Mark the SIGCHLD handler as expected when waiting for child.

This alows waiting for a child to be the only activity on the ioloop.

5 years agolib: lib-signals - Implement lib_signals_set_expected().
Stephan Bosch [Thu, 21 Feb 2019 01:34:54 +0000 (02:34 +0100)] 
lib: lib-signals - Implement lib_signals_set_expected().

This is a promise that the indicated delayed signal will occur eventually, so
that the associated ioloop will eventually terminate. This allows the lib-signal
io to be alone on the ioloop.

5 years agolib-program-client: program-client-local - Restructure program_client_local_disconnect().
Stephan Bosch [Thu, 21 Feb 2019 01:40:36 +0000 (02:40 +0100)] 
lib-program-client: program-client-local - Restructure program_client_local_disconnect().

Simplify the handling of the program timeout and improve the debug messages.

5 years agologin-proxy: Add proxy_host_immediate_failure_after=<time> passdb extra field
Timo Sirainen [Wed, 13 May 2020 12:04:45 +0000 (15:04 +0300)] 
login-proxy: Add proxy_host_immediate_failure_after=<time> passdb extra field

If host has only seen connect failures for this long, stop attempting to
connect there (except with one connection) and instead return immediate
failure. This used to be hardcoded to 30 seconds, which can now be
changed. Most importantly 0 means that this functionality is disabled
entirely.

5 years agopop3-proxy: Add [SYS/TEMP] prefix to temporary login failures
Timo Sirainen [Thu, 7 May 2020 09:19:39 +0000 (12:19 +0300)] 
pop3-proxy: Add [SYS/TEMP] prefix to temporary login failures

5 years agologin-proxy: Support retrying reconnection on temporary authentication failures
Timo Sirainen [Wed, 6 May 2020 17:05:02 +0000 (20:05 +0300)] 
login-proxy: Support retrying reconnection on temporary authentication failures

5 years agosubmission-proxy: Add asserts to clarify pending_auth's lifetime
Timo Sirainen [Thu, 7 May 2020 09:58:14 +0000 (12:58 +0300)] 
submission-proxy: Add asserts to clarify pending_auth's lifetime

5 years agosubmission-proxy: Fix internal authentication failure response code
Timo Sirainen [Wed, 6 May 2020 18:31:43 +0000 (21:31 +0300)] 
submission-proxy: Fix internal authentication failure response code

5 years ago*-login: Change proxy_error() API to proxy_failed() API
Timo Sirainen [Wed, 6 May 2020 17:21:15 +0000 (20:21 +0300)] 
*-login: Change proxy_error() API to proxy_failed() API

The protocol-specific code is now able to control better what kind of a
reply is sent to client on proxying failure.

5 years agologin-proxy: client_proxy_failed() - Move line sending to caller
Timo Sirainen [Sun, 3 May 2020 19:28:15 +0000 (22:28 +0300)] 
login-proxy: client_proxy_failed() - Move line sending to caller

5 years agologin-proxy: Support reconnecting on most types of failures
Timo Sirainen [Sun, 3 May 2020 19:24:55 +0000 (22:24 +0300)] 
login-proxy: Support reconnecting on most types of failures

5 years ago*-login: Remove redundant/early freeing of proxy_password
Timo Sirainen [Wed, 6 May 2020 13:26:34 +0000 (16:26 +0300)] 
*-login: Remove redundant/early freeing of proxy_password

The login-common code already does this after the proxying has failed or
succeeded. Having these duplicate frees immediately after sending the
password isn't all that useful, and most importantly they make it
impossible to reconnect after the password has been sent.

5 years agoimap-login: Don't use proxy_password for checking if authentication is still needed
Timo Sirainen [Wed, 6 May 2020 13:52:24 +0000 (16:52 +0300)] 
imap-login: Don't use proxy_password for checking if authentication is still needed

Required for the next commit.

5 years agologin-proxy: Don't reconnect anymore when timeout is too close
Timo Sirainen [Wed, 6 May 2020 13:13:43 +0000 (16:13 +0300)] 
login-proxy: Don't reconnect anymore when timeout is too close

5 years agologin-proxy: Log auth failures centrally in login_proxy_failed()
Timo Sirainen [Sun, 3 May 2020 19:05:39 +0000 (22:05 +0300)] 
login-proxy: Log auth failures centrally in login_proxy_failed()

5 years agologin-proxy: Support reconnecting also when connect() immediately fails
Timo Sirainen [Wed, 29 Apr 2020 09:51:52 +0000 (12:51 +0300)] 
login-proxy: Support reconnecting also when connect() immediately fails

This can happen when connecting to localhost.

5 years agologin-proxy: Change client_proxy_failed() to be static
Timo Sirainen [Wed, 29 Apr 2020 12:23:05 +0000 (15:23 +0300)] 
login-proxy: Change client_proxy_failed() to be static

The other client_proxy_*_failed() should be used instead.

5 years agologin-proxy: Don't call input_callback on destroy
Timo Sirainen [Thu, 30 Apr 2020 09:23:11 +0000 (12:23 +0300)] 
login-proxy: Don't call input_callback on destroy

All the failure code paths now call failure_callback instead.

5 years agologin-proxy: login_proxy_new() - Call login_proxy_failed() also when returning -1
Timo Sirainen [Sun, 3 May 2020 15:41:58 +0000 (18:41 +0300)] 
login-proxy: login_proxy_new() - Call login_proxy_failed() also when returning -1

This also changes login_proxy_new() to internally send the failure message
to client, so caller doesn't have to do it.

5 years agologin-proxy: Replace e_error()+client_proxy_failed() calls with login_proxy_failed()
Timo Sirainen [Sun, 3 May 2020 15:35:57 +0000 (18:35 +0300)] 
login-proxy: Replace e_error()+client_proxy_failed() calls with login_proxy_failed()

The event parameter for login_proxy_failed() allows creating named events
using passthrough events, but for now there aren't any named events.

5 years agologin-proxy: Handle auth failures with login_proxy_failed()
Timo Sirainen [Wed, 29 Apr 2020 10:40:17 +0000 (13:40 +0300)] 
login-proxy: Handle auth failures with login_proxy_failed()

5 years agologin-proxy: login_proxy_connect() - Call login_proxy_free() internally
Timo Sirainen [Thu, 30 Apr 2020 09:20:15 +0000 (12:20 +0300)] 
login-proxy: login_proxy_connect() - Call login_proxy_free() internally

5 years agologin-proxy: login_proxy_new() - Add failure callback
Timo Sirainen [Sun, 3 May 2020 14:42:29 +0000 (17:42 +0300)] 
login-proxy: login_proxy_new() - Add failure callback

5 years agologin-proxy: Rename proxy_callback_t to login_proxy_input_callback_t
Timo Sirainen [Sun, 3 May 2020 14:30:23 +0000 (17:30 +0300)] 
login-proxy: Rename proxy_callback_t to login_proxy_input_callback_t

5 years agologin-proxy: proxy_log_connect_error() - Move the actual logging to callers
Timo Sirainen [Sun, 3 May 2020 14:08:55 +0000 (17:08 +0300)] 
login-proxy: proxy_log_connect_error() - Move the actual logging to callers

5 years agologin-proxy: login_proxy_starttls() - destroy proxy internally on failure
Timo Sirainen [Wed, 29 Apr 2020 12:18:55 +0000 (15:18 +0300)] 
login-proxy: login_proxy_starttls() - destroy proxy internally on failure

5 years agosubmission-login: proxy - Change impossible code path to assert
Timo Sirainen [Wed, 29 Apr 2020 13:14:06 +0000 (16:14 +0300)] 
submission-login: proxy - Change impossible code path to assert

5 years agopop3-login: Move client_proxy_failed() calls next to error logging
Timo Sirainen [Wed, 29 Apr 2020 10:55:59 +0000 (13:55 +0300)] 
pop3-login: Move client_proxy_failed() calls next to error logging

5 years agosubmission-login: proxy - Some code paths were missing client_proxy_failed() calls
Timo Sirainen [Wed, 29 Apr 2020 10:55:42 +0000 (13:55 +0300)] 
submission-login: proxy - Some code paths were missing client_proxy_failed() calls

Move client_proxy_failed() calls right next to the error logging so it's
clearer where they are needed.

5 years agoimap-login: proxy - Some code paths were missing client_proxy_failed() calls
Timo Sirainen [Wed, 29 Apr 2020 10:51:03 +0000 (13:51 +0300)] 
imap-login: proxy - Some code paths were missing client_proxy_failed() calls

Move client_proxy_failed() calls right next to the error logging so it's
clearer where they are needed.

5 years agologin-proxy: Improve logging for successful logins
Timo Sirainen [Wed, 29 Apr 2020 09:52:38 +0000 (12:52 +0300)] 
login-proxy: Improve logging for successful logins

Include how long it took to do the login and how many reconnects.

5 years agologin-proxy: Connect timeout error handling should be the same as elsewhere
Timo Sirainen [Thu, 30 Apr 2020 15:10:44 +0000 (18:10 +0300)] 
login-proxy: Connect timeout error handling should be the same as elsewhere

5 years agologin-proxy: Split off proxy_connect_failed()
Timo Sirainen [Wed, 29 Apr 2020 09:14:57 +0000 (12:14 +0300)] 
login-proxy: Split off proxy_connect_failed()

The bool return value will be used in a later commit.

5 years agologin-proxy: Log a debug message whenever reconnecting after connect failure
Timo Sirainen [Wed, 29 Apr 2020 08:49:59 +0000 (11:49 +0300)] 
login-proxy: Log a debug message whenever reconnecting after connect failure

5 years agologin-proxy: Parse proxy_timeout passdb extra field as milliseconds string
Timo Sirainen [Fri, 24 Apr 2020 12:34:43 +0000 (15:34 +0300)] 
login-proxy: Parse proxy_timeout passdb extra field as milliseconds string

If it's a number, it's still parsed as number of seconds for backwards
compatibility. Otherwise it supports parsing given time unit, including
milliseconds.

5 years agologin-proxy: Add login_proxy_max_reconnects setting
Timo Sirainen [Wed, 6 May 2020 13:18:12 +0000 (16:18 +0300)] 
login-proxy: Add login_proxy_max_reconnects setting

5 years agologin-proxy: Add login_proxy_timeout setting
Timo Sirainen [Fri, 24 Apr 2020 12:17:06 +0000 (15:17 +0300)] 
login-proxy: Add login_proxy_timeout setting

This can be used to overwrite the default 30 seconds. It's still possible
to overwrite this from "proxy_timeout" passdb extra field.

5 years agologin-proxy: client_proxy_failed() - minor code cleanup
Timo Sirainen [Wed, 29 Apr 2020 12:15:27 +0000 (15:15 +0300)] 
login-proxy: client_proxy_failed() - minor code cleanup

The comment wasn't true anymore.

5 years agologin-proxy: proxy_fail_connect() - Add assert
Timo Sirainen [Sun, 3 May 2020 14:16:12 +0000 (17:16 +0300)] 
login-proxy: proxy_fail_connect() - Add assert

5 years agologin-proxy: Fix crash when proxy TTL reaches zero
Timo Sirainen [Sun, 3 May 2020 14:02:34 +0000 (17:02 +0300)] 
login-proxy: Fix crash when proxy TTL reaches zero

The event was being unreferenced too many times.

5 years agolib-http: test-http-server-errors - Use the new sub-process test API.
Stephan Bosch [Mon, 6 Apr 2020 20:28:49 +0000 (22:28 +0200)] 
lib-http: test-http-server-errors - Use the new sub-process test API.

This makes an effort to terminate client processes gracefully. Killing them
bluntly hampers test coverage measurement and valgrind testing.

5 years agolib-http: test-http-server-errors - Split off test_run_client/server() from test_run_...
Stephan Bosch [Mon, 6 Apr 2020 22:49:23 +0000 (00:49 +0200)] 
lib-http: test-http-server-errors - Split off test_run_client/server() from test_run_client_server().

5 years agolib-http: test-http-server-errors - Rename test_clients_kill_all() to test_clients_ki...
Stephan Bosch [Mon, 6 Apr 2020 19:59:55 +0000 (21:59 +0200)] 
lib-http: test-http-server-errors - Rename test_clients_kill_all() to test_clients_kill_forced().

5 years agolib-http: test-http-server-errors - Move global initialization to main_init/deinit().
Stephan Bosch [Mon, 6 Apr 2020 19:57:50 +0000 (21:57 +0200)] 
lib-http: test-http-server-errors - Move global initialization to main_init/deinit().

5 years agolib-http: test-http-server-errors - Use lib-signals API.
Stephan Bosch [Mon, 13 Apr 2020 10:55:57 +0000 (12:55 +0200)] 
lib-http: test-http-server-errors - Use lib-signals API.

Using signal() is not portable for installing a signal handler.

5 years agolib-http: test-http-server-errors - Don't ignore SIGCHLD.
Stephan Bosch [Mon, 13 Apr 2020 10:45:34 +0000 (12:45 +0200)] 
lib-http: test-http-server-errors - Don't ignore SIGCHLD.

5 years agolib-http: test-http-server-errors - Adjust log prefix code to match other similar...
Stephan Bosch [Mon, 11 Nov 2019 22:37:01 +0000 (23:37 +0100)] 
lib-http: test-http-server-errors - Adjust log prefix code to match other similar unit tests.

5 years agolib-http: test-http-client-errors - Use the new sub-process test API.
Stephan Bosch [Mon, 6 Apr 2020 22:14:40 +0000 (00:14 +0200)] 
lib-http: test-http-client-errors - Use the new sub-process test API.

This makes an effort to terminate server processes gracefully. Killing them
bluntly hampers test coverage measurement and valgrind testing.

5 years agolib-http: test-http-client-errors - Split off test_run_server/dns/client() from test_...
Stephan Bosch [Mon, 6 Apr 2020 22:55:36 +0000 (00:55 +0200)] 
lib-http: test-http-client-errors - Split off test_run_server/dns/client() from test_run_client_server().

5 years agolib-http: test-http-client-errors - Rename test_servers_kill_all() to test_servers_ki...
Stephan Bosch [Mon, 6 Apr 2020 21:34:10 +0000 (23:34 +0200)] 
lib-http: test-http-client-errors - Rename test_servers_kill_all() to test_servers_kill_forced().

5 years agolib-http: test-http-client-errors - Move global initialization to main_init/deinit().
Stephan Bosch [Mon, 6 Apr 2020 21:33:02 +0000 (23:33 +0200)] 
lib-http: test-http-client-errors - Move global initialization to main_init/deinit().

5 years agolib-http: test-http-client-errors - Avoid using sleep().
Stephan Bosch [Mon, 6 Apr 2020 22:22:13 +0000 (00:22 +0200)] 
lib-http: test-http-client-errors - Avoid using sleep().

5 years agolib-http: test-http-client-errors - Use lib-signals API.
Stephan Bosch [Mon, 13 Apr 2020 10:21:00 +0000 (12:21 +0200)] 
lib-http: test-http-client-errors - Use lib-signals API.

Using signal() is not portable for installing a signal handler.

5 years agolib-http: test-http-client-errors - Ignore SIGPIPE.
Stephan Bosch [Mon, 6 Apr 2020 22:18:43 +0000 (00:18 +0200)] 
lib-http: test-http-client-errors - Ignore SIGPIPE.

5 years agolib-http: test-http-client-errors - Don't ignore SIGCHLD.
Stephan Bosch [Mon, 13 Apr 2020 10:01:28 +0000 (12:01 +0200)] 
lib-http: test-http-client-errors - Don't ignore SIGCHLD.

5 years agolib-http: test-http-client-errors - Add log prefixes to distinguish client and server...
Stephan Bosch [Mon, 6 Apr 2020 22:17:59 +0000 (00:17 +0200)] 
lib-http: test-http-client-errors - Add log prefixes to distinguish client and server debug messages.

5 years agolib-http: test-http-payload - Use the new sub-process test API.
Stephan Bosch [Fri, 3 Apr 2020 19:14:48 +0000 (21:14 +0200)] 
lib-http: test-http-payload - Use the new sub-process test API.

This makes an effort to terminate server processes gracefully. Killing them
bluntly hampers test coverage measurement and valgrind testing.

5 years agolib-http: test-http-payload - Split off test_run_client/server() from test_run_client...
Stephan Bosch [Tue, 7 Apr 2020 01:07:58 +0000 (03:07 +0200)] 
lib-http: test-http-payload - Split off test_run_client/server() from test_run_client_server().

5 years agolib-http: test-http-payload - Adjust log prefix code to match other similar unit...
Stephan Bosch [Tue, 7 Apr 2020 01:18:33 +0000 (03:18 +0200)] 
lib-http: test-http-payload - Adjust log prefix code to match other similar unit tests.

5 years agolib-http: test-http-payload - Rename test_server_kill() to test_server_kill_forced().
Stephan Bosch [Sat, 4 Apr 2020 10:42:03 +0000 (12:42 +0200)] 
lib-http: test-http-payload - Rename test_server_kill() to test_server_kill_forced().

5 years agolib-http: test-http-payload - Move global initialization to main_init/deinit().
Stephan Bosch [Sat, 4 Apr 2020 10:40:26 +0000 (12:40 +0200)] 
lib-http: test-http-payload - Move global initialization to main_init/deinit().

5 years agolib-http: test-http-payload - Call test_files_init/deinit() in test_run_client_server().
Stephan Bosch [Fri, 3 Apr 2020 19:46:30 +0000 (21:46 +0200)] 
lib-http: test-http-payload - Call test_files_init/deinit() in test_run_client_server().

5 years agolib-http: test-http-payload - Use lib-signals API.
Stephan Bosch [Sun, 12 Apr 2020 16:12:16 +0000 (18:12 +0200)] 
lib-http: test-http-payload - Use lib-signals API.

Using signal() is not portable for installing a signal handler.

5 years agolib-http: test-http-payload - Properly exit child process.
Stephan Bosch [Sun, 12 Apr 2020 17:16:14 +0000 (19:16 +0200)] 
lib-http: test-http-payload - Properly exit child process.

5 years agolib-http: test-http-payload - Don't ignore SIGCHLD.
Stephan Bosch [Sun, 12 Apr 2020 17:13:48 +0000 (19:13 +0200)] 
lib-http: test-http-payload - Don't ignore SIGCHLD.

5 years agolib-test: Implement test API for running sub-processes.
Stephan Bosch [Mon, 4 May 2020 08:20:40 +0000 (10:20 +0200)] 
lib-test: Implement test API for running sub-processes.

This makes an effort to terminate sub-processes gracefully. Killing them bluntly
hampers test coverage measurement and valgrind testing.

5 years agolib-test: test-common - Add test_forked_end().
Stephan Bosch [Fri, 10 Apr 2020 15:32:16 +0000 (17:32 +0200)] 
lib-test: test-common - Add test_forked_end().

5 years agom4: dovecot.m4 - Run valgrind with --error-exitcode=213 parameter in generated run...
Stephan Bosch [Fri, 10 Apr 2020 15:57:54 +0000 (17:57 +0200)] 
m4: dovecot.m4 - Run valgrind with --error-exitcode=213 parameter in generated run-test.sh.

This way, test child processes will indicate valgrind failure with exit code
1000, making unit tests properly fail even though the actual test performed by
the child process succeeded.

5 years agoAdd Valgrind suppression for external problem exposed by src/lib-http/test-http-payload.
Stephan Bosch [Sat, 4 Apr 2020 09:37:55 +0000 (11:37 +0200)] 
Add Valgrind suppression for external problem exposed by src/lib-http/test-http-payload.

There is a memory problem in OpenSSL somewhere.

Valgrind output:

==9380== Invalid read of size 8
==9380==    at 0x48635A5: check_free (dlerror.c:188)
==9380==    by 0x4863AB1: free_key_mem (dlerror.c:221)
==9380==    by 0x4863AB1: __dlerror_main_freeres (dlerror.c:239)
==9380==    by 0x49DEB71: __libc_freeres (in /lib/x86_64-linux-gnu/libc-2.28.so)
==9380==    by 0x482D19E: _vgnU_freeres (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_core-amd64-linux.so)
==9380==    by 0x15C528: test_exit (test-common.c:389)
==9380==    by 0x12D522: test_run_client_server.constprop.11 (test-http-payload.c:1435)
==9380==    by 0x12D904: test_run_sequential (test-http-payload.c:1488)
==9380==    by 0x12E5A6: test_download_server_nonblocking (test-http-payload.c:1579)
==9380==    by 0x15B98D: test_run_funcs (test-common.c:282)
==9380==    by 0x15C2D0: test_run (test-common.c:353)
==9380==    by 0x12C647: main (test-http-payload.c:2075)
==9380==  Address 0x4de7988 is 12 bytes after a block of size 12 alloc'd
==9380==    at 0x483577F: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==9380==    by 0x4C5C328: CRYPTO_zalloc (mem.c:230)
==9380==    by 0x4C5856D: ossl_init_get_thread_local (init.c:66)
==9380==    by 0x4C5856D: ossl_init_get_thread_local (init.c:59)
==9380==    by 0x4C5856D: ossl_init_thread_start (init.c:465)
==9380==    by 0x4C81CB9: RAND_DRBG_get0_public (drbg_lib.c:1118)
==9380==    by 0x4C81CEF: drbg_bytes (drbg_lib.c:963)
==9380==    by 0x486EDF2: ssl_iostream_openssl_init (iostream-openssl.c:928)
==9380==    by 0x12C56A: main_init (test-http-payload.c:2031)
==9380==    by 0x12C56A: main (test-http-payload.c:2058)
==9380==

5 years agolib: lib-signals - Add lib_signals_clear_handlers().
Stephan Bosch [Sat, 11 Apr 2020 17:19:16 +0000 (19:19 +0200)] 
lib: lib-signals - Add lib_signals_clear_handlers().

5 years agolib: lib-signals - Restore default system signal handler once all handlers are removed.
Stephan Bosch [Sun, 12 Apr 2020 15:25:37 +0000 (17:25 +0200)] 
lib: lib-signals - Restore default system signal handler once all handlers are removed.

5 years agolib: lib-signals - Fix assert panic occurring at ioloop switch without delayed handlers.
Stephan Bosch [Sat, 11 Apr 2020 13:11:32 +0000 (15:11 +0200)] 
lib: lib-signals - Fix assert panic occurring at ioloop switch without delayed handlers.

Panic was:

Panic: file ioloop.c: line 86 (io_add_to): assertion failed: (fd >= 0)

5 years agolib: Reformat lib-signals.h.
Stephan Bosch [Sun, 12 Apr 2020 14:40:30 +0000 (16:40 +0200)] 
lib: Reformat lib-signals.h.

5 years agolib: Reformat lib-signals.c.
Stephan Bosch [Sun, 12 Apr 2020 14:40:13 +0000 (16:40 +0200)] 
lib: Reformat lib-signals.c.

5 years agolib: Reverse comment about io_loop_stop() being safe to call in signal handlers
Timo Sirainen [Thu, 9 Apr 2020 12:55:59 +0000 (15:55 +0300)] 
lib: Reverse comment about io_loop_stop() being safe to call in signal handlers

It is not safe. First there's the issue that ioloop.running is a bitmask,
but secondly there's a race condition between io_loop_stop() and the arrival
of the last timeout and/or IO event. It can end up running epoll_wait() with
only a stale IO and no timeouts, which hangs indefinitely.

5 years agolib-smtp: smtp_xtext_parse() - Remove unnecessary NULL check
Timo Sirainen [Thu, 21 May 2020 10:44:21 +0000 (13:44 +0300)] 
lib-smtp: smtp_xtext_parse() - Remove unnecessary NULL check