]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
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.
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.
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.
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.
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.
Timo Sirainen [Wed, 29 Apr 2020 10:40:17 +0000 (13:40 +0300)]
login-proxy: Handle auth failures with login_proxy_failed()
Timo Sirainen [Thu, 30 Apr 2020 09:20:15 +0000 (12:20 +0300)]
login-proxy: login_proxy_connect() - Call login_proxy_free() internally
Timo Sirainen [Sun, 3 May 2020 14:42:29 +0000 (17:42 +0300)]
login-proxy: login_proxy_new() - Add failure callback
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
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
Timo Sirainen [Wed, 29 Apr 2020 12:18:55 +0000 (15:18 +0300)]
login-proxy: login_proxy_starttls() - destroy proxy internally on failure
Timo Sirainen [Wed, 29 Apr 2020 13:14:06 +0000 (16:14 +0300)]
submission-login: proxy - Change impossible code path to assert
Timo Sirainen [Wed, 29 Apr 2020 10:55:59 +0000 (13:55 +0300)]
pop3-login: Move client_proxy_failed() calls next to error logging
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.
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.
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.
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
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.
Timo Sirainen [Wed, 29 Apr 2020 08:49:59 +0000 (11:49 +0300)]
login-proxy: Log a debug message whenever reconnecting after connect failure
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.
Timo Sirainen [Wed, 6 May 2020 13:18:12 +0000 (16:18 +0300)]
login-proxy: Add login_proxy_max_reconnects 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.
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.
Timo Sirainen [Sun, 3 May 2020 14:16:12 +0000 (17:16 +0300)]
login-proxy: proxy_fail_connect() - Add assert
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.
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.
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().
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().
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().
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.
Stephan Bosch [Mon, 13 Apr 2020 10:45:34 +0000 (12:45 +0200)]
lib-http: test-http-server-errors - Don't ignore SIGCHLD.
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.
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.
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().
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().
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().
Stephan Bosch [Mon, 6 Apr 2020 22:22:13 +0000 (00:22 +0200)]
lib-http: test-http-client-errors - Avoid using sleep().
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.
Stephan Bosch [Mon, 6 Apr 2020 22:18:43 +0000 (00:18 +0200)]
lib-http: test-http-client-errors - Ignore SIGPIPE.
Stephan Bosch [Mon, 13 Apr 2020 10:01:28 +0000 (12:01 +0200)]
lib-http: test-http-client-errors - Don't ignore SIGCHLD.
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.
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.
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().
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.
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().
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().
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().
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.
Stephan Bosch [Sun, 12 Apr 2020 17:16:14 +0000 (19:16 +0200)]
lib-http: test-http-payload - Properly exit child process.
Stephan Bosch [Sun, 12 Apr 2020 17:13:48 +0000 (19:13 +0200)]
lib-http: test-http-payload - Don't ignore SIGCHLD.
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.
Stephan Bosch [Fri, 10 Apr 2020 15:32:16 +0000 (17:32 +0200)]
lib-test: test-common - Add test_forked_end().
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.
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==
Stephan Bosch [Sat, 11 Apr 2020 17:19:16 +0000 (19:19 +0200)]
lib: lib-signals - Add lib_signals_clear_handlers().
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.
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)
Stephan Bosch [Sun, 12 Apr 2020 14:40:30 +0000 (16:40 +0200)]
lib: Reformat lib-signals.h.
Stephan Bosch [Sun, 12 Apr 2020 14:40:13 +0000 (16:40 +0200)]
lib: Reformat lib-signals.c.
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.
Timo Sirainen [Thu, 21 May 2020 10:44:21 +0000 (13:44 +0300)]
lib-smtp: smtp_xtext_parse() - Remove unnecessary NULL check
Timo Sirainen [Mon, 11 May 2020 16:00:25 +0000 (19:00 +0300)]
pop3: Use separate search queries for expunging and setting \Seen flags
Using a single shared search query causes mail prefetching to behave
inefficiently. Especially lazy_expunge plugin could have done refcount
prefetch for non-deleted mails as well.
Timo Sirainen [Mon, 11 May 2020 16:00:04 +0000 (19:00 +0300)]
pop3: Split off pop3_search_build_seqset()
Timo Sirainen [Mon, 11 May 2020 15:50:18 +0000 (18:50 +0300)]
pop3: Minor optimization to unexpected client disconnections
There's no need to build deleted messages seqset if it's not used.
Timo Sirainen [Thu, 14 May 2020 19:55:05 +0000 (22:55 +0300)]
dict: When client is disconnected, make sure its input IO is removed
Just in case it takes a while to fully unreference the client, make sure its
input callback won't be called rapidly.
Timo Sirainen [Thu, 14 May 2020 19:52:34 +0000 (22:52 +0300)]
dict: Fix deinitializing dict iteration if client disconnects
If the client's ostream was full at the disconnection time, the iteration
wasn't aborted. Instead, the connection was kept forever and its input
callback was kept being called rapidly, causing 100% CPU usage.
Timo Sirainen [Thu, 14 May 2020 19:52:08 +0000 (22:52 +0300)]
dict: Split off cmd_iterate_flush_finish()
Stephan Bosch [Fri, 20 Mar 2020 12:38:41 +0000 (13:38 +0100)]
lmtp: lmtp-commands - Explicity prohibit empty RCPT path.
The empty path <""> will yield an empty username.
Stephan Bosch [Fri, 20 Mar 2020 12:37:04 +0000 (13:37 +0100)]
lib-smtp: smtp-address - Only produce a <> address in smtp_address_clone() when that is the input.
It also produced an effective null address when the localpart was empty.
Stephan Bosch [Fri, 20 Mar 2020 12:35:19 +0000 (13:35 +0100)]
lib-smtp: smtp-address - Don't recognize an address with empty localpart as <>.
Depending on context, the addresses <""@domain.tld> and <""> are potentially
valid non-null addresses.
Stephan Bosch [Sun, 22 Mar 2020 17:14:44 +0000 (18:14 +0100)]
lib-smtp: smtp-address - Don't return NULL from smtp_address_clone*() unless the input is NULL.
Stephan Bosch [Tue, 24 Mar 2020 11:59:15 +0000 (12:59 +0100)]
lib-smtp: test-smtp-server-errors - Add tests for large series of empty and bad commands.
Stephan Bosch [Tue, 24 Mar 2020 11:25:03 +0000 (12:25 +0100)]
lib-smtp: smtp-server-connection - Hold a command reference while executing a command.
This fixes a use-after-free problem at the end of
smtp_server_connection_handle_command().
Stephan Bosch [Tue, 24 Mar 2020 11:23:32 +0000 (12:23 +0100)]
lib-smtp: smtp-server-command - Perform initial command execution in separate function.
Stephan Bosch [Tue, 24 Mar 2020 11:13:43 +0000 (12:13 +0100)]
lib-smtp: smtp-server-command - Guarantee that non-destroy hooks aren't called for an ended command.
Stephan Bosch [Tue, 24 Mar 2020 21:33:45 +0000 (22:33 +0100)]
lib-smtp: test-smtp-server-errors - Add tests for VRFY and NOOP commands with invalid parameters.
Stephan Bosch [Tue, 24 Mar 2020 21:24:20 +0000 (22:24 +0100)]
lib-smtp: Add tests for smtp_string_parse() and smtp_string_write().
Stephan Bosch [Tue, 24 Mar 2020 21:42:15 +0000 (22:42 +0100)]
lib-smtp: smtp-syntax - Return 0 for smtp_string_parse() with empty input.
This is what the current users of this function actually expect.
Stephan Bosch [Tue, 24 Mar 2020 20:14:34 +0000 (21:14 +0100)]
lib-smtp: smtp-syntax - Do not allow NULL return parameters for smtp_ehlo_line_parse().
Stephan Bosch [Tue, 24 Mar 2020 20:11:01 +0000 (21:11 +0100)]
lib-smtp: smtp-syntax - Do not allow NULL return parameters for smtp_xtext_parse().
Stephan Bosch [Tue, 24 Mar 2020 19:57:03 +0000 (20:57 +0100)]
lib-smtp: smtp-syntax - Do not allow NULL return parameters for smtp_string_parse().
Stephan Bosch [Tue, 24 Mar 2020 20:05:17 +0000 (21:05 +0100)]
lib-smtp: smtp-server-cmd-vrfy - Restructure parameter parsing.
Stephan Bosch [Tue, 24 Mar 2020 20:00:19 +0000 (21:00 +0100)]
lib-smtp: Reformat smtp-server-cmd-vrfy.c.
Stephan Bosch [Tue, 24 Mar 2020 20:08:37 +0000 (21:08 +0100)]
lib-smtp: Reformat smtp-server-cmd-noop.c.
Stephan Bosch [Tue, 24 Mar 2020 19:51:24 +0000 (20:51 +0100)]
lib-smtp: Reformat smtp-syntax.c.
Stephan Bosch [Tue, 24 Mar 2020 19:45:21 +0000 (20:45 +0100)]
lib-smtp: Reformat smtp-syntax.h.
Aki Tuomi [Wed, 13 May 2020 07:52:50 +0000 (10:52 +0300)]
auth: test-mech - Remove auth-token-secret.dat after test suite
Aki Tuomi [Tue, 12 May 2020 06:48:06 +0000 (09:48 +0300)]
auth: mech-digest-md5 - Do not read past buffer on right trim
If the string does not have comma at the end, do not progress
the pointer past buffer end.
Aki Tuomi [Tue, 12 May 2020 06:22:20 +0000 (09:22 +0300)]
auth: test-mech - Fix memory leaks
Forgotten in
f6bb82a222e7973e9f9b7056dfe015fe3d8632f7
Timo Sirainen [Mon, 11 May 2020 14:25:41 +0000 (17:25 +0300)]
lib-index: Index rebuilding lost fields in cache
Regression caused by
5f6d2134690e4b84d38d556e3086668e32f30b50
Timo Sirainen [Mon, 11 May 2020 14:23:19 +0000 (17:23 +0300)]
lib-index: Fix setting initial last_used for fields in mail_[always_]cache_fields
These fields had last_used=0 until the field was accessed. If cache was
purged before this access, the field was dropped. Fixed by assuming
(last_used=0, decision!=NO) is still the first time the field is being
used. This also causes it to trigger mail_cache_decision_changed event.
Timo Sirainen [Tue, 12 May 2020 08:23:23 +0000 (11:23 +0300)]
lib-index: mail_cache_decision_add() - Add priv helper variable
Timo Sirainen [Tue, 12 May 2020 08:20:57 +0000 (11:20 +0300)]
lib-index: Make mail_cache_decision_to_string() public
Timo Sirainen [Fri, 24 Apr 2020 14:17:46 +0000 (17:17 +0300)]
auth: auth_request_finished event - policy_result=delayed didn't work
It was returned as "ok" instead of "delayed".
Stephan Bosch [Fri, 8 May 2020 14:18:29 +0000 (16:18 +0200)]
lib-http: test-http-client-errors: "reply payload" test - Make server announce that connection is closed.
This prevents race condition between connection closure and client trying to reuse the connection.
Stephan Bosch [Fri, 8 May 2020 14:22:48 +0000 (16:22 +0200)]
lib-http: test-http-client-errors: "reply payload" test - Fix name of server context struct.
Aki Tuomi [Thu, 7 May 2020 10:57:14 +0000 (13:57 +0300)]
auth: test-mech - Rewrote test
Aki Tuomi [Fri, 8 May 2020 10:12:39 +0000 (13:12 +0300)]
auth: test-mock - Add credentials lookup support
Aki Tuomi [Fri, 8 May 2020 10:08:19 +0000 (13:08 +0300)]
auth: test - Export passdb mock settings
Aki Tuomi [Thu, 7 May 2020 11:15:14 +0000 (14:15 +0300)]
auth: Move auth_request_fail_on_nuls to auth-request.c
Where is belongs to