]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
Timo Sirainen [Fri, 8 Oct 2021 13:02:04 +0000 (16:02 +0300)]
imap: Move client_add_input() content to calling functions
Timo Sirainen [Fri, 8 Oct 2021 12:57:50 +0000 (15:57 +0300)]
imap: Move IMAPLOGINTAG environment handling
It can only happen with stdio clients when they don't have CLIENT_INPUT,
so it makes more sense to exist in the calling function.
Timo Sirainen [Wed, 6 Oct 2021 12:43:09 +0000 (15:43 +0300)]
imap-login: proxy: Don't forward untagged BYE responses to the client
It will just cause confusion, especially when connections are retried.
It could end up looking like:
x login user pass
* BYE Internal error occurred. Refer to server log for more information.
* BYE Internal error occurred. Refer to server log for more information.
* BYE Internal error occurred. Refer to server log for more information.
* BYE Internal error occurred. Refer to server log for more information.
x NO [UNAVAILABLE] Account is temporarily unavailable.
Timo Sirainen [Fri, 8 Oct 2021 12:53:21 +0000 (15:53 +0300)]
lib-storage: mail_storage_service_lookup() - Fix memory leak when returning -2
This was also visible as event leaks.
Timo Sirainen [Tue, 28 Sep 2021 17:46:54 +0000 (20:46 +0300)]
lib-index: Fix potential crash with debug logging when looking up cache
Timo Sirainen [Tue, 28 Sep 2021 17:45:47 +0000 (20:45 +0300)]
lib-index: mail_cache_lookup_iter_next() - Add a warning comment about re-reading fields
Marco Bettini [Thu, 7 Oct 2021 13:52:28 +0000 (15:52 +0200)]
mail-crypt: mail_crypt_load_global_private_key() - Drop unnecessary NULL check
Timo Sirainen [Tue, 28 Sep 2021 15:13:12 +0000 (18:13 +0300)]
lib, global: i_stream_create_chain() - Add max_buffer_size
This makes sure that the istream size can't grow too large and waste memory.
Previously the istream max_buffer_size was dynamically changed to be the
smallest seen max_buffer_size in chained istreams. This mostly worked, but
sometimes the istream-chain's max_buffer_size was requested before even the
first istream was added to it.
Having an explicit max_buffer_size avoids all the problems of it being
dynamic, and there's not really any need for it anyway.
Timo Sirainen [Thu, 7 Oct 2021 11:52:12 +0000 (14:52 +0300)]
virtual: Fix assert-crash when backend mbox mailbox is deleted while virtual mailbox is open
The code wrongly thought that metadata lookup couldn't fail because it was
already successfully looked up. But the backend storage could still try to
refresh the mailbox to verify whether it still exists or not, and fail if
it was deleted.
This seems to have affected only the mbox mailbox format.
Broken by
710346bcb884b464c8ed128870fdc1999c13dfd3
Timo Sirainen [Mon, 4 Oct 2021 23:03:00 +0000 (02:03 +0300)]
lib: istream-concat - Add a comment about explicit snapshot function
Timo Sirainen [Mon, 4 Oct 2021 22:39:50 +0000 (01:39 +0300)]
lib: test-istream-concat - Unref child istreams immediately
This doesn't currently make a difference, since istream-concat keeps them
internally referenced. In case this changes and snapshot handling isn't
fixed similarly to istream-chain, the unit test should now fail.
Timo Sirainen [Mon, 4 Oct 2021 15:25:40 +0000 (18:25 +0300)]
lib: istream-concat - Fix snapshot handling when combining two istreams
Snapshotting wasn't handled correctly when two (or more) istreams' contents
were combined into the same buffer.
Timo Sirainen [Mon, 4 Oct 2021 21:55:57 +0000 (00:55 +0300)]
lib: istream-chain - Optimize snapshot handling
Timo Sirainen [Mon, 4 Oct 2021 22:32:22 +0000 (01:32 +0300)]
lib: istream-chain - Fix snapshot handling when link istream is destroyed
Timo Sirainen [Mon, 4 Oct 2021 15:17:49 +0000 (18:17 +0300)]
lib: istream-chain - Fix snapshot handling when combining two istreams
Snapshotting wasn't handled correctly when two (or more) istreams' contents
were combined into the same buffer.
Timo Sirainen [Mon, 4 Oct 2021 22:00:38 +0000 (01:00 +0300)]
lib: Add i_stream_memarea_detach()
Timo Sirainen [Mon, 4 Oct 2021 14:41:27 +0000 (17:41 +0300)]
lib: test-istream-chain - Use more unique strings for testing
DEBUG checks don't work well if the input repeats the same character.
Timo Sirainen [Sat, 14 Sep 2019 21:08:57 +0000 (00:08 +0300)]
lib: istream-seekable - Fix crash after write to temp file failed
Fixes:
Panic: file istream-seekable.c: line 230 (read_from_buffer): assertion failed: (*ret_r > 0)
Timo Sirainen [Sat, 14 Sep 2019 21:06:58 +0000 (00:06 +0300)]
lib: istream-seekable - Don't double-close temp file fd on errors
Closing the fd_input stream already auto-closes the fd.
Timo Sirainen [Sat, 14 Sep 2019 20:53:35 +0000 (23:53 +0300)]
lib: istream-seekable - Fix crash if writing to temp file fails
Timo Sirainen [Wed, 29 Sep 2021 10:13:53 +0000 (13:13 +0300)]
lib: i_stream_try_alloc() - Add sanity check asserts
Timo Sirainen [Wed, 6 Oct 2021 14:37:40 +0000 (17:37 +0300)]
lib-imap-client: test-imapc-client - Increase connect timeout for most tests
The 500ms timeout could have been too short when running with valgrind on an
overloaded system. Increase it to 5 seconds, but keep 500ms for the tests
that expect a timeout.
Marco Bettini [Wed, 6 Oct 2021 09:03:08 +0000 (05:03 -0400)]
lib-master: master_login_auth_callback() - Add assert to guard for both errormsg and auth_args being NULL
Timo Sirainen [Thu, 7 Oct 2021 00:55:59 +0000 (03:55 +0300)]
auth: db-passwd-file - Fix using paths with %% escaped characters but no %variables
full_key might not have been NULL, causing var_expand() to read past the
array and possibly crash.
Timo Sirainen [Thu, 7 Oct 2021 00:46:29 +0000 (03:46 +0300)]
lib: t_get_bytes_available() - Move code inside DEBUG to avoid dead code warning
Timo Sirainen [Thu, 7 Oct 2021 00:44:46 +0000 (03:44 +0300)]
lib-index: mail_index_sync_init_expunge_handlers() - Simplify and remove dead code
Timo Sirainen [Thu, 7 Oct 2021 00:37:29 +0000 (03:37 +0300)]
lib-index: test-mail-index-write - Fix initializing map.hdr_copy_buf
Timo Sirainen [Thu, 7 Oct 2021 00:29:09 +0000 (03:29 +0300)]
lib-settings: test-settings-parser - Check settings_parser_check() return value
Timo Sirainen [Thu, 7 Oct 2021 00:28:56 +0000 (03:28 +0300)]
auth: Make sure auth_request_import() doesn't unexpectedly fail
Timo Sirainen [Thu, 7 Oct 2021 00:10:28 +0000 (03:10 +0300)]
lib: Change i_unreached() to be a function
This allows overriding the function in a Coverity model, so it can
understand that i_unreached() is intended to be unreachable code.
Timo Sirainen [Wed, 6 Oct 2021 23:32:26 +0000 (02:32 +0300)]
lib: base64 - Add asserts to check max_line_len is in valid range
Timo Sirainen [Mon, 4 Oct 2021 11:32:51 +0000 (13:32 +0200)]
ipc: Disable connecting to stats
This avoids reconnect errors if stats process crashes.
Timo Sirainen [Thu, 30 Sep 2021 22:44:35 +0000 (01:44 +0300)]
master: Use relative path for stats_writer_socket_path for chrooted services
This allows login process to reconnect to stats-writer if it gets
disconnected.
Timo Sirainen [Thu, 30 Sep 2021 22:42:43 +0000 (01:42 +0300)]
stats: Add login/stats-writer socket
Stephan Bosch [Mon, 4 Oct 2021 00:58:15 +0000 (02:58 +0200)]
lmtp: lmtp-proxy - Use the per-recipient session ID for the "Saved" message.
Stephan Bosch [Mon, 4 Oct 2021 00:57:25 +0000 (02:57 +0200)]
lmtp: Move session_id field to generic recipient struct.
Stephan Bosch [Fri, 1 Oct 2021 22:21:40 +0000 (00:21 +0200)]
lmtp: lmtp-proxy - Forward session ID towards backend.
Stephan Bosch [Fri, 1 Oct 2021 22:21:06 +0000 (00:21 +0200)]
lmtp: lmtp-local - Always add RCPT index to session ID for delivery.
Even when it is 1.
Stephan Bosch [Fri, 1 Oct 2021 22:36:09 +0000 (00:36 +0200)]
lib-smtp: smtp-server-transaction - Base transaction ID on connection session ID.
Composed as "<connection session ID>:<trasaction sequence>".
Stephan Bosch [Fri, 1 Oct 2021 22:32:05 +0000 (00:32 +0200)]
lib-smtp: smtp-server-connection - Manage session ID for the connection.
Stephan Bosch [Fri, 1 Oct 2021 22:29:29 +0000 (00:29 +0200)]
lib-smtp: smtp-server-cmd-xclient - Parse XCLIENT SESSION field.
Stephan Bosch [Fri, 1 Oct 2021 22:16:22 +0000 (00:16 +0200)]
lib-smtp: smtp-client-connection - Send new SESSION field with XCLIENT command.
Stephan Bosch [Mon, 4 Oct 2021 00:02:21 +0000 (02:02 +0200)]
lib-smtp: smtp-client - Use smtp_proxy_data_merge() to copy proxy data in smtp_client_init().
Stephan Bosch [Fri, 1 Oct 2021 22:15:07 +0000 (00:15 +0200)]
lib-smtp: smtp-common - Add SESSION field to proxy data.
Stephan Bosch [Fri, 1 Oct 2021 22:25:50 +0000 (00:25 +0200)]
lib: connection - Add debug message for when property label (peer address) changes.
Stephan Bosch [Fri, 1 Oct 2021 22:26:28 +0000 (00:26 +0200)]
lib: connection - Make connection_update_properties() public.
Stephan Bosch [Fri, 1 Oct 2021 22:24:35 +0000 (00:24 +0200)]
lib: connection - Drop useless newlines.
Aki Tuomi [Thu, 21 Feb 2019 16:50:10 +0000 (18:50 +0200)]
lib-program-client: test-program-client-local - Use dd instead of head
`head -c n` is only guaranteed to print n bytes, but it may consume more.
FreeBSD's implementation of head(1) uses buffered stdio, which did just that.
`dd` consumes exactly the specified number of bytes.
Timo Sirainen [Tue, 10 Aug 2021 11:38:39 +0000 (13:38 +0200)]
login-proxy: Fix potential memory leak if backend login fails
It also needs an abnormal way of destroying the client for the leak to
happen. For example if the login process is being killed.
Stephan Bosch [Mon, 19 Apr 2021 15:36:02 +0000 (17:36 +0200)]
lib-test: fuzzer - Disable error handling for output stream towards program.
Fixes:
Panic: output stream is missing error handling
Stephan Bosch [Mon, 19 Apr 2021 15:34:58 +0000 (17:34 +0200)]
lib-test: fuzzer - Provide names for fuzzer streams.
Stephan Bosch [Sun, 18 Apr 2021 10:33:01 +0000 (12:33 +0200)]
lib-smtp: smtp-server-cmd-helo - Fix crash occurring upon pipelined EHLO with invalid domain.
Failed to check for NULL in domain value for a pipelined EHLO/HELO command.
Timo Sirainen [Wed, 6 Oct 2021 10:20:12 +0000 (13:20 +0300)]
lib: Fix data_stack_get_alloc_size() and data_stack_get_used_size()
It only worked correctly if data stack hadn't been grown. This resulted
in wrong numbers in the data_stack_grow event.
Timo Sirainen [Fri, 1 Oct 2021 12:08:45 +0000 (15:08 +0300)]
virtual: Fix leaking mailboxes if virtual mailbox can't be opened
Fixes also a crash at deinit:
Panic: file mail-user.c: line 232 (mail_user_deinit): assertion failed: ((*user)->refcount == 1)
Timo Sirainen [Mon, 4 Oct 2021 14:25:05 +0000 (17:25 +0300)]
mdbox: Avoid calling container_of() with a NULL pointer
Timo Sirainen [Mon, 4 Oct 2021 12:20:17 +0000 (15:20 +0300)]
sdbox: Avoid calling container_of() with a NULL pointer
Timo Sirainen [Mon, 4 Oct 2021 11:42:54 +0000 (14:42 +0300)]
lib: buffer_free() - Check for buf==NULL before using container_of()
Helps with static analyzer complaints.
Timo Sirainen [Mon, 4 Oct 2021 11:42:14 +0000 (14:42 +0300)]
lib: lib-event - Assert-crash if attempting to use NULL passthrough event
Fixes also complaints from static analyzer.
Timo Sirainen [Mon, 4 Oct 2021 11:22:22 +0000 (14:22 +0300)]
lib: container_of() - Don't check for NULL after all
Adding the explicit NULL checks for container_of() caused caused static
analyzers to think that NULL could be returned at any time. This caused
unnecessary warnings in various places.
Reverts
b178d0792b6335277f7fa831fd7e5403105abd04
Timo Sirainen [Mon, 4 Oct 2021 11:35:03 +0000 (14:35 +0300)]
lib: macros.h - Fix #endif position
Timo Sirainen [Fri, 24 Sep 2021 13:36:41 +0000 (16:36 +0300)]
lib-index: Add more mail_index_ext_name_is_valid() asserts
Timo Sirainen [Fri, 24 Sep 2021 13:35:39 +0000 (16:35 +0300)]
lib-index: Handle invalid extension header names without assert-crashing
Fixes:
Panic: mail_index_ext_register(...): Invalid name
Timo Sirainen [Fri, 24 Sep 2021 13:27:40 +0000 (16:27 +0300)]
lib-index: Add and use mail_index_ext_name_is_valid()
Use it in mail_index_ext_register() instead of the more relaxed
str_sanitize() check.
Timo Sirainen [Fri, 24 Sep 2021 13:32:26 +0000 (16:32 +0300)]
lib-index: Remove unused mail_index_sync_ext_init()
It doesn't look like this was ever used for anything. The initial commit
used only mail_index_sync_ext_init_new().
Timo Sirainen [Thu, 29 Jul 2021 08:37:23 +0000 (11:37 +0300)]
zlib: Handle empty zlib_save_level the same as if it doesn't exist
Timo Sirainen [Thu, 29 Jul 2021 08:29:37 +0000 (11:29 +0300)]
zlib: Fix crash when zlib_save_level is set, but zlib_save is unset
Siavash Tavakoli [Mon, 4 Oct 2021 10:14:04 +0000 (11:14 +0100)]
driver-pgsql: Fix error leak
Timo Sirainen [Mon, 4 Oct 2021 10:37:11 +0000 (12:37 +0200)]
lib-compression: ostream-zlib - Fix non-blocking gz header write
Broken by
373dc6a93da1f6a0ad0c80dbb72566c2b3a295f2
Timo Sirainen [Tue, 3 Aug 2021 17:38:13 +0000 (20:38 +0300)]
lib-storage: mailbox_get_expunge*() - Fix assert-crash on index corruption
This happened in the very unlikely situation that indexes became corrupted
between two mail_transaction_log_view_set() calls.
Fixes:
Panic: file mailbox-get.c: line 112 (mailbox_get_expunges_init): assertion failed: (ret != 0)
Timo Sirainen [Fri, 1 Oct 2021 12:21:38 +0000 (15:21 +0300)]
lib: str_hash() - Ignore integer wrapping with ubsan
ATTR_NO_SANITIZE_INTEGER was already set for other hash functions, but
forgotten for this one.
Fixes e.g.:
Error: hash.c:529:16: runtime error: unsigned integer overflow:
4294967200 + 115 cannot be represented in type ‘unsigned int’
Stephan Bosch [Mon, 27 Sep 2021 22:51:03 +0000 (00:51 +0200)]
lib: ostream-wrapper - Make sure o_stream_finish() has stream_errno != 0 when -1 is to be returned.
Fixes:
Panic: file ostream.c: line 209 (o_stream_flush): assertion failed: (stream->stream_errno != 0)
Siavash Tavakoli [Fri, 1 Oct 2021 09:42:16 +0000 (10:42 +0100)]
driver-cassandra: Fix prepared statement pool leak
sergey.kitov [Thu, 30 Sep 2021 15:42:08 +0000 (18:42 +0300)]
stats: Remove metric from stats dump, when removing dynamically.
Stephan Bosch [Wed, 23 Sep 2020 21:35:53 +0000 (23:35 +0200)]
lib-ssl-iostream: istream-openssl - Remove assert() in i_stream_ssl_read().
Stephan Bosch [Wed, 23 Sep 2020 21:35:30 +0000 (23:35 +0200)]
lib-ssl-iostream: iostream-openssl - Allow plain_input buffer to remain filled in openssl_iostream_bio_input().
Stephan Bosch [Wed, 23 Sep 2020 20:02:41 +0000 (22:02 +0200)]
lib-ssl-iostream: iostream-openssl - Use o_stream_uncork_flush() to uncork the plain output.
This flushes the stream after uncorking it, fixing I/O hang with nested SSL
layers.
Stephan Bosch [Wed, 29 Sep 2021 22:17:47 +0000 (00:17 +0200)]
lib-ssl-iostream: iostream-openssl - Return immediately from openssl_iostream_bio_output() upon error.
Stephan Bosch [Wed, 23 Sep 2020 21:58:12 +0000 (23:58 +0200)]
lib-ssl-iostream: iostream-openssl - Move error handling out of openssl_iostream_bio_output().
Makes the next commit clearer.
Stephan Bosch [Fri, 16 Apr 2021 11:55:06 +0000 (13:55 +0200)]
lib-ssl-iostream: test-iostream-ssl - Make finishing the ssl streams more robust.
Fixes:
Panic: file ostream.c: line 59 (o_stream_close_full): assertion failed: (stream->real_stream->error_handling_disabled)
Stephan Bosch [Fri, 16 Apr 2021 16:18:07 +0000 (18:18 +0200)]
lib-ssl-iostream: test-iostream-ssl - Properly mark client endpoints.
Stephan Bosch [Fri, 16 Apr 2021 16:21:01 +0000 (18:21 +0200)]
lib-ssl-iostream: test-iostream-ssl - Move small_packets_flush_callback().
Stephan Bosch [Fri, 16 Apr 2021 16:19:55 +0000 (18:19 +0200)]
lib-ssl-iostream: test-iostream-ssl - Move bufsize_flush_callback().
Stephan Bosch [Fri, 16 Apr 2021 12:52:34 +0000 (14:52 +0200)]
lib-ssl-iostream: ostream-openssl - Call SSL_shutdown() once stream is finished and buffer is empty.
Stephan Bosch [Fri, 16 Apr 2021 10:31:13 +0000 (12:31 +0200)]
lib: istream - Remove try_alloc_limit.
Stephan Bosch [Fri, 16 Apr 2021 10:27:48 +0000 (12:27 +0200)]
lib-ssl-iostream - iostream-openssl - Use i_stream_read_limited().
Stephan Bosch [Fri, 16 Apr 2021 10:25:43 +0000 (12:25 +0200)]
lib: istream - Add i_stream_read_limited().
Stephan Bosch [Sun, 27 Sep 2020 13:19:05 +0000 (15:19 +0200)]
lib-ssl-iostream: istream-openssl - Simplify i_stream_ssl_read().
Avoid using a stack buffer. Just fill the stream to the maximum buffer size.
Stephan Bosch [Fri, 16 Apr 2021 16:08:50 +0000 (18:08 +0200)]
lib-ssl-iostream: iostream-openssl - Add OPENSSL_IOSTREAM_SYNC_TYPE_NONE.
This is useful for calling openssl_iostream_handle_error() while avoiding
processing more I/O.
Timo Sirainen [Fri, 24 Sep 2021 16:16:43 +0000 (19:16 +0300)]
lib-ssl-iostream: Fix error handling if parent iostream fails
Expand out and remove openssl_iostream_more(). It could have returned
errors to two different locations depending on whether the failure came
from SSL handshake or parent iostream.
Timo Sirainen [Fri, 24 Sep 2021 16:15:22 +0000 (19:15 +0300)]
lib-ssl-iostream: ostream-ssl - Add ssl_io helper variable
Timo Sirainen [Fri, 24 Sep 2021 15:59:29 +0000 (18:59 +0300)]
lib: o_stream_copy_error_from_parent() - Assert-crash if source stream_errno is 0
This can help debug situations where error is missing.
Timo Sirainen [Fri, 24 Sep 2021 15:59:21 +0000 (18:59 +0300)]
global: Call o_stream_copy_error_from_parent() only on errors
Timo Sirainen [Fri, 24 Sep 2021 15:58:02 +0000 (18:58 +0300)]
lib-compression: ostream-zlib - Fix sending partial gz header to parent ostream
This practically wouldn't happen.
Timo Sirainen [Thu, 30 Sep 2021 13:38:23 +0000 (15:38 +0200)]
lib-http: test-http-client-errors - Revert previous retry changes
The real bug is found now, so the previous fix attempt isn't useful.
Reverts
ed1264368a5435c3080871380156978a8951fe26
Timo Sirainen [Thu, 30 Sep 2021 13:32:24 +0000 (15:32 +0200)]
lib-http: test-http-client-errors - Reset USR1 notification signal between tests
The "connection refused" test already set the signal as being received,
which caused the "connection refused backoff" test to randomly fail since it
thought the signal was immediately received.
Stephan Bosch [Fri, 24 Sep 2021 22:48:12 +0000 (00:48 +0200)]
lib: istream-concat - Prevent inheriting SIZE_MAX max buffer size from parent streams.
Only when all parent streams have SIZE_MAX for max buffer size, the concat stream will follow suit.
Timo Sirainen [Mon, 27 Sep 2021 17:35:19 +0000 (20:35 +0300)]
lib-storage: Add mailbox_list.disable_rebuild_on_corruption
If set, don't try to rebuild the mailbox list index even if corruption is
detected.
Timo Sirainen [Fri, 24 Sep 2021 14:59:06 +0000 (17:59 +0300)]
lib-dcrypt: Fix istream-decrypt snapshotting
This is mostly copy&pasted from istream-header-filter.
Michael M Slusarz [Fri, 24 Sep 2021 00:02:17 +0000 (18:02 -0600)]
lib-storage: hide mail_cache_min_mail_count setting
Timo Sirainen [Sat, 25 Sep 2021 22:16:53 +0000 (01:16 +0300)]
master: Avoid leaking master client fds to forked processes