]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
Timo Sirainen [Mon, 9 Nov 2020 16:10:21 +0000 (18:10 +0200)]
lib-smtp: smtp_address_init_from_msg() - Avoid implicit char to unsigned char conversion
Fixes calling smtp_char_is_qpair() with ubsan:
runtime error: implicit conversion from type 'char' of value -61 (8-bit, signed) to type 'unsigned char' changed the value to 195 (8-bit, unsigned)
Timo Sirainen [Mon, 9 Nov 2020 15:52:51 +0000 (17:52 +0200)]
lib-index: Add explicit wrapping to 8bit variable increments
Fixes ubsan errors:
runtime error: implicit conversion from type 'int' of value 256 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 0 (8-bit, unsigned)
Timo Sirainen [Mon, 9 Nov 2020 15:38:26 +0000 (17:38 +0200)]
lib: istream-concat - Avoid NULL pointer arithmetic
Even though it was only doing +0. Fixes:
runtime error: applying zero offset to null pointer
Timo Sirainen [Mon, 9 Nov 2020 15:35:15 +0000 (17:35 +0200)]
lib: istream-chain - Avoid NULL pointer arithmetic
Even though it was only doing +0. Fixes:
runtime error: applying zero offset to null pointer
Timo Sirainen [Mon, 9 Nov 2020 14:55:06 +0000 (16:55 +0200)]
lib: MODULE_CONTEXT_SET*() - Avoid NULL pointer arithmetic
Even though it was only doing +0. Fixes:
runtime error: applying zero offset to null pointer
Timo Sirainen [Mon, 9 Nov 2020 14:09:05 +0000 (16:09 +0200)]
lib: Add and use TYPE_CHECKS() macro to standardize type checking for functions
This helps especially to avoid adding COMPILE_ERROR_*() macros to NULL
pointers, which results in ubsan errors:
runtime error: applying zero offset to null pointer
These changes also remove the use of gcc-specific ({...}) code in the
macros, making them slightly more portable.
Timo Sirainen [Mon, 9 Nov 2020 13:39:57 +0000 (15:39 +0200)]
lib: COMPILE_ERROR_IF_TRUE() - Return FALSE instead of 0
This will be needed for the following changes to avoid warnings with
-Wstrict-bool.
Timo Sirainen [Mon, 9 Nov 2020 11:04:43 +0000 (13:04 +0200)]
lib-fs: fs_file_init_parent() - Keep mode and flags parameters separated
Internally cast them both to (int) before ORing them together for the
fs_file_init_with_event() call.
This avoids compiler warnings with -Wenum-enum-conversion:
warning: bitwise operation between different enumeration types ('enum fs_open_mode' and 'enum fs_open_flags')
Josef 'Jeff' Sipek [Fri, 23 Oct 2020 20:24:09 +0000 (16:24 -0400)]
auth: Remove ntlm mechanism & the LANMAN and NTLM password schemes
Josef 'Jeff' Sipek [Fri, 16 Oct 2020 13:18:31 +0000 (09:18 -0400)]
auth: Remove vpopmail user & pass db support
Josef 'Jeff' Sipek [Fri, 16 Oct 2020 13:01:19 +0000 (09:01 -0400)]
auth: Remove S/Key mechanism & password scheme
Josef 'Jeff' Sipek [Fri, 16 Oct 2020 12:50:21 +0000 (08:50 -0400)]
auth: Remove RPA mechanism & password scheme
Josef 'Jeff' Sipek [Fri, 16 Oct 2020 12:31:34 +0000 (08:31 -0400)]
auth: Remove postmap socket type
Josef 'Jeff' Sipek [Fri, 16 Oct 2020 12:28:12 +0000 (08:28 -0400)]
auth: Remove support for SIA passdb
Josef 'Jeff' Sipek [Fri, 23 Oct 2020 14:56:08 +0000 (10:56 -0400)]
lib: Be less verbose in event filter tests
Only print the input string if the test failed.
Stephan Bosch [Tue, 27 Oct 2020 22:16:44 +0000 (23:16 +0100)]
lib-smtp: smtp-server-connection - Make sure output stream errors are handled.
Stephan Bosch [Mon, 26 Oct 2020 09:19:46 +0000 (10:19 +0100)]
lib-ssl-iosteam: ostream-openssl - Make sure error on plaintext streams is propagated.
Stephan Bosch [Mon, 26 Oct 2020 21:04:53 +0000 (22:04 +0100)]
lib-ssl-iostrea: ostream-openssl - Add local variable for ssl_io in o_stream_ssl_flush_buffer().
Aki Tuomi [Thu, 5 Nov 2020 11:25:19 +0000 (13:25 +0200)]
auth: db-oauth2 - Do not allow empty active_value or active_attribute, when other is set
Aki Tuomi [Thu, 29 Oct 2020 09:37:22 +0000 (11:37 +0200)]
auth: db-oauth2 - If active attribute is present in request, check it
If the attribute is missing, do not assume it's false.
Aki Tuomi [Thu, 29 Oct 2020 09:36:00 +0000 (11:36 +0200)]
auth: db-oauth2 - Check active attribute by default
Aki Tuomi [Thu, 22 Oct 2020 08:42:23 +0000 (11:42 +0300)]
auth: db-oauth2 - Change active:false to mean invalid token
Specifications say that invalid token, expired token and any other
reason why the token can be considered invalid should return
{"active":false} reply with no other fields.
Thus, we need to consider this as invalid token.
Aki Tuomi [Thu, 22 Oct 2020 08:41:16 +0000 (11:41 +0300)]
auth: db-oauth2 - Allow active:false without username
sergey.kitov [Tue, 13 Oct 2020 14:34:12 +0000 (17:34 +0300)]
lib-storage: Skip setting log view in mailbox_get_expunges_init when box->view is outdated.
This fixes assert-crash when IMAP client uses QRESYNC and lots of changes happen between syncing points.
Fixes:
Panic: file mail-transaction-log-view.c: line 144 (mail_transaction_log_view_set): assertion failed: (min_file_seq <= max_file_seq)
Timo Sirainen [Thu, 29 Oct 2020 10:34:57 +0000 (12:34 +0200)]
lib-fts: test-fts-filter - Fix clang suspicious concatenation of string literals warning
Fixes:
warning: suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma? [-Wstring-concatenation]
Timo Sirainen [Thu, 29 Oct 2020 10:33:14 +0000 (12:33 +0200)]
lib: Standardize STMT_BEGIN and STMT_END
do .. while(0) should work everywhere.
This also fixes warnings given by new clang:
warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
Timo Sirainen [Thu, 29 Oct 2020 10:32:44 +0000 (12:32 +0200)]
lib: test-istream - Don't try to return void
Aki Tuomi [Wed, 28 Oct 2020 10:45:09 +0000 (12:45 +0200)]
lib: test-file-cache - Add asserts for initial return value of file_cache_get
Aki Tuomi [Wed, 28 Oct 2020 10:23:40 +0000 (12:23 +0200)]
lib-lda: Update mail sizes to event only if they are known
Aki Tuomi [Wed, 28 Oct 2020 10:22:58 +0000 (12:22 +0200)]
lib-storage: raw-mail - Cast st_size to uoff_t
mbox->size is unsigned field, and st_size will be -1
is the stat target is not regular file or symbolic link.
This can happen if it's stream like stdin.
Timo Sirainen [Fri, 23 Oct 2020 11:54:22 +0000 (14:54 +0300)]
lib-fs: iteration - Fix crash when overwriting iteration error
Can't use fs_file_path() because file is NULL. Instead, add the path to
struct fs_iter directly so it can be used in the error.
Broken by
eaaf40ca4e8994824abff89fc617c3cc737d83a5
Aki Tuomi [Thu, 22 Oct 2020 17:21:41 +0000 (20:21 +0300)]
quota: Avoid implicit integer conversion to unsigned in quota calculation
Deducting negative number from unsigned integer causes
signed integer conversion to unsigned int, which results a
too large positive number. Do calculations using int64 instead.
This did not cause any visible problems, found by
clang integer sanitization.
Aki Tuomi [Thu, 22 Oct 2020 15:53:34 +0000 (18:53 +0300)]
global: Fix overzealous use of ENUM_NEGATE
Timo Sirainen [Thu, 22 Oct 2020 19:46:35 +0000 (22:46 +0300)]
lib: istream-seekable - Fix returning stream size
The returned size may have been truncated.
Timo Sirainen [Fri, 16 Oct 2020 08:21:51 +0000 (11:21 +0300)]
lib-fs: Add assert to make sure we never log "(null)" as the old error
Timo Sirainen [Fri, 16 Oct 2020 08:20:04 +0000 (11:20 +0300)]
lib-fs: Fix logging old error when an unlogged error is replaced by new error
The old error was logged as "(null)" if the error happened in a non-root
(filter) file.
Timo Sirainen [Fri, 16 Oct 2020 07:19:59 +0000 (10:19 +0300)]
lib-fs: Include file's path when logging pending error messages
Otherwise it may not be known which file the error is about.
This happens when a file is freed without the last error being logged.
Also when an unlogged error is being replaced with a new error.
Josef 'Jeff' Sipek [Thu, 24 Sep 2020 17:44:58 +0000 (13:44 -0400)]
lib: event-filter-parser - Disallow non-equals comparators on non-fields
Non-equals comparisons (<, <=, >, and >=) aren't well defined for anything
other than fields. Therefore, if we encounter one of these comparators with
an event name, category name, or source location, we should error out and
avoid confusing the user.
Timo Sirainen [Thu, 15 Oct 2020 17:34:05 +0000 (20:34 +0300)]
lib-storage: Delay recreating event when closing mail
If the mail isn't reused, the event is unnecessary.
Aki Tuomi [Mon, 19 Oct 2020 10:49:29 +0000 (13:49 +0300)]
global: Explicitly wrap values to fit target
Aki Tuomi [Tue, 1 Sep 2020 06:44:04 +0000 (09:44 +0300)]
global: Add explicit casts where needed
Squash implicit conversion complains from sanitizer.
Aki Tuomi [Thu, 13 Aug 2020 08:36:08 +0000 (11:36 +0300)]
global: Disable undefined behaviour sanitization for select locations
Aki Tuomi [Thu, 20 Aug 2020 05:39:26 +0000 (08:39 +0300)]
global: Fix negation with constants to match target type
Aki Tuomi [Thu, 20 Aug 2020 05:35:59 +0000 (08:35 +0300)]
global: Use ENUM_NEGATE() macro where necessary
Aki Tuomi [Wed, 23 Sep 2020 11:51:53 +0000 (14:51 +0300)]
global: Use UOFF_T_MAX instead of (uoff_t)-1
Aki Tuomi [Wed, 23 Sep 2020 11:43:29 +0000 (14:43 +0300)]
global: Use SIZE_MAX instead of (size_t)-1
Aki Tuomi [Tue, 11 Aug 2020 05:41:54 +0000 (08:41 +0300)]
lib: macros - Add ENUM_NEGATE
Handles enumeration flag negation.
Aki Tuomi [Tue, 28 Jul 2020 10:42:01 +0000 (13:42 +0300)]
configure: Add ubsan support
Aki Tuomi [Wed, 23 Sep 2020 11:39:36 +0000 (14:39 +0300)]
lib-mail: test-message-header-hash: Fix type issue
Satisfies runtime analyzer.
Aki Tuomi [Tue, 22 Sep 2020 11:39:41 +0000 (14:39 +0300)]
doveadm: mailbox status - Handle first_save_date correctly
If first_save_date is -1 it means no save has been done.
Aki Tuomi [Thu, 20 Aug 2020 05:57:35 +0000 (08:57 +0300)]
lib: unichar - Change uni_utf8_char_bytes to accept unsigned char
Aki Tuomi [Tue, 1 Sep 2020 06:57:04 +0000 (09:57 +0300)]
lib-index: Use SIZE_MAX with str_sanitize
Aki Tuomi [Tue, 1 Sep 2020 06:57:23 +0000 (09:57 +0300)]
auth: password-scheme - Use UINT_MAX when calling password_generate_otp
Aki Tuomi [Tue, 1 Sep 2020 08:54:50 +0000 (11:54 +0300)]
lib: mempool-allocfree - Do not use PTR_OFFSET with negative offset
Avoids undefined behaviour sanitization error.
Aki Tuomi [Tue, 1 Sep 2020 08:56:42 +0000 (11:56 +0300)]
lib-fts: test-fts-tokenizer - Change test_chars to unsigned char
Aki Tuomi [Thu, 20 Aug 2020 06:46:24 +0000 (09:46 +0300)]
lib: str - Ensure str_append_c gets unsigned char parameter
Timo Sirainen [Thu, 1 Oct 2020 08:37:24 +0000 (11:37 +0300)]
lib: seq-range-array - Assert-crash if array becomes 0..(uint32_t)-1
Timo Sirainen [Thu, 1 Oct 2020 08:19:33 +0000 (11:19 +0300)]
lib: seq_range_array_add() - Reorder code flow
Timo Sirainen [Thu, 1 Oct 2020 08:18:04 +0000 (11:18 +0300)]
lib: seq-range-array - Split off seq_range_array_add_slow_path()
Timo Sirainen [Thu, 1 Oct 2020 08:04:56 +0000 (11:04 +0300)]
lib: seq-range-array - Use seq_range_length() internally
Timo Sirainen [Thu, 1 Oct 2020 08:04:36 +0000 (11:04 +0300)]
lib: seq_range_length() - Use const pointer
Martti Rannanjärvi [Tue, 20 Oct 2020 12:02:24 +0000 (15:02 +0300)]
doc: Include dovecot-oauth2.conf.ext in dist tarball
Stephan Bosch [Mon, 12 Oct 2020 21:29:02 +0000 (23:29 +0200)]
doveadm-server: Fix STARTTLS support.
Stephan Bosch [Tue, 13 Oct 2020 20:56:25 +0000 (22:56 +0200)]
lib-master: master-service-ssl - Make context initialization error more useful.
This improves the error in case SSL is disabled; other causes still yield a
rather unhelpful error message.
Stephan Bosch [Mon, 12 Oct 2020 21:18:09 +0000 (23:18 +0200)]
lib: ostream-multiplex - Fix dead assignment by adding an assertion on the result.
Found by Clang scan-build.
Stephan Bosch [Tue, 6 Oct 2020 22:06:08 +0000 (00:06 +0200)]
global: Fix dead assignments in expressions.
Found by Clang scan-build.
raphael-walther [Thu, 8 Oct 2020 11:48:45 +0000 (13:48 +0200)]
man: Update doveadm-search-query.7
TEXT searches also from headers, not just body.
jonmoesli [Wed, 7 Oct 2020 15:48:06 +0000 (17:48 +0200)]
director: Fix error message when director_username_hash expansion fails
Timo Sirainen [Fri, 9 Oct 2020 11:58:54 +0000 (14:58 +0300)]
lib-storage: Fix potential assert-crash when adding missing attachment keywords
Broken by
aab71c35259f542d9ba46b4b5b24eff0016b802e
Fixes:
Panic: file index-mail.c: line 1241 (index_mail_parse_body): assertion failed: (data->parser_ctx != NULL)
Timo Sirainen [Thu, 8 Oct 2020 07:41:52 +0000 (10:41 +0300)]
lib: json-parser - Fix skipping strings with non-blocking input
The skipping could have accessed memory outside the allocated string.
This might have resulted in a crash, or caused JSON parsing to fail.
Stephan Bosch [Wed, 16 Sep 2020 03:06:12 +0000 (05:06 +0200)]
lib-mail: test-message-header-decode - Add random encode/decode tests for 8 bit data.
This also tests handling of (broken) UTF-8 input.
Stephan Bosch [Wed, 16 Sep 2020 02:31:58 +0000 (04:31 +0200)]
lib-mail: test-message-header-encode - Add tests for broken UTF-8 in input.
Stephan Bosch [Thu, 17 Sep 2020 10:17:44 +0000 (12:17 +0200)]
lib-mail: test-message-header-encode - Check maximum line length with long printable text and whitespace.
Stephan Bosch [Wed, 16 Sep 2020 23:26:13 +0000 (01:26 +0200)]
lib-mail: message-header-encode - Update function descriptions.
Stephan Bosch [Wed, 16 Sep 2020 01:21:30 +0000 (03:21 +0200)]
lib-mail: Properly handle bad UTF-8 in message_header_encode_b().
Broken characters are substituted with a replacement character.
Stephan Bosch [Wed, 16 Sep 2020 01:19:34 +0000 (03:19 +0200)]
lib-mail: Properly handle bad UTF-8 in message_header_encode_q().
Broken characters are substituted with a replacement character.
Stephan Bosch [Wed, 16 Sep 2020 01:10:12 +0000 (03:10 +0200)]
lib-mail: message-header-encode - Return immediately when len == 0 in message_header_encode_b/q().
Just to make sure. This shouldn't happen in the first place.
Stephan Bosch [Wed, 16 Sep 2020 01:05:30 +0000 (03:05 +0200)]
lib-mail: message-header-encode - Use size_t for length/size variables and parameters.
Stephan Bosch [Wed, 16 Sep 2020 23:33:52 +0000 (01:33 +0200)]
lib-mail: message-header-encode - Fix encoding of 0x7F byte for Q encoding.
It was not escaped.
Stephan Bosch [Wed, 16 Sep 2020 23:41:41 +0000 (01:41 +0200)]
lib-mail: test-message-header-decode - Use test_assert_idx().
Stephan Bosch [Wed, 16 Sep 2020 16:28:43 +0000 (18:28 +0200)]
lib-mail: test-message-header-decode - Avoid generating random bytes that are never used.
Stephan Bosch [Thu, 17 Sep 2020 10:24:40 +0000 (12:24 +0200)]
lib-mail: test-message-header-decode - Use test_assert_strcmp().
Stephan Bosch [Thu, 17 Sep 2020 10:23:06 +0000 (12:23 +0200)]
lib-mail: test-message-header-encode - Use test_assert_strcmp().
Stephan Bosch [Tue, 15 Sep 2020 23:03:53 +0000 (01:03 +0200)]
lib: base64 - Add base64_encode_get_full_space().
This translates the space in the destination buffer to the number of bytes that
can be encoded at most to complete the full base64 encoding, including padding
and newlines if configured.
Stephan Bosch [Tue, 15 Sep 2020 23:02:22 +0000 (01:02 +0200)]
lib: base64 - Fix return value of base64_encode_more().
It didn't properly return TRUE when all input data was consumed.
Stephan Bosch [Wed, 16 Sep 2020 21:19:19 +0000 (23:19 +0200)]
lib: test-base64 - Add test for base64_encode_get_size() in random lowlevel streaming tests.
Stephan Bosch [Wed, 16 Sep 2020 21:20:32 +0000 (23:20 +0200)]
lib: test-base64 - Abort random lowlevel test case early when something failed already.
Stephan Bosch [Tue, 15 Sep 2020 22:37:45 +0000 (00:37 +0200)]
lib: unichar - Add length definitions for replacement and ellipsis characters.
Timo Sirainen [Wed, 6 May 2020 10:15:34 +0000 (13:15 +0300)]
lib: json-parser - Fix parsing \uXXXX in non-blocking input
If it was in the istream's read boundary it resulted as parsing error.
Timo Sirainen [Wed, 6 May 2020 10:01:41 +0000 (13:01 +0300)]
lib: json-parser - Fix error message for invalid escape sequence
Timo Sirainen [Wed, 6 May 2020 09:54:13 +0000 (12:54 +0300)]
lib: json-parser - Don't allocate errors from data stack
There's no guarantee that the json-parser's life time is within the same
data stack frame.
Timo Sirainen [Wed, 6 May 2020 09:38:22 +0000 (12:38 +0300)]
lib: json-parser - Fail if strings contain NULs
Previous behavior was to just truncate the string, which could be worse than
failing entirely.
Stephan Bosch [Tue, 22 Sep 2020 23:59:27 +0000 (01:59 +0200)]
lib-http: test-http-client-errors - Add unit test for host idle timeout.
This test involves retrying a request that failed host lookup, which used to
cause the request to be erroneously aborted.
Stephan Bosch [Sun, 20 Sep 2020 23:14:20 +0000 (01:14 +0200)]
lib-http: http-client-host - Prevent erroneously starting host idle timeout during request retry.
During request retry the request is first dropped from and subsequently added to
the queue. Dropping a request from the queue can start the host idle timeout
when it is the very last one. The timeout was not removed later on anymore when
the request was submitted again, because it was added prematurely (before
dropping the request).
Stephan Bosch [Sun, 20 Sep 2020 21:16:00 +0000 (23:16 +0200)]
lib-http: http-client-host - Fix determination of whether host is idle.
Stephan Bosch [Tue, 22 Sep 2020 20:12:27 +0000 (22:12 +0200)]
lib-http: http-client-host - Make sure DNS lookup is performed when host has no IPs.
This fixes at least one panic:
Panic: file ./http-client-private.h: line 679 (http_client_host_get_ip): assertion failed: (idx < host->shared->ips_count)
Timo Sirainen [Wed, 26 Aug 2020 08:31:01 +0000 (11:31 +0300)]
auth: Fix potential read buffer overflow in PLAIN mechanism
The overflow could have crashed the auth process in theory, although
practically it doesn't seem to happen.
Timo Sirainen [Wed, 26 Aug 2020 08:42:02 +0000 (11:42 +0300)]
auth: test-mech - Allocate test input explicitly
This way valgrind will catch if there are read buffer overflows.
Timo Sirainen [Wed, 1 Apr 2020 14:22:04 +0000 (17:22 +0300)]
lib-index: Fix DEBUG assert to not trigger on transaction resets
Fixes a crash in test-mail-index when compiled --with-devel-checks:
Panic: file mail-index-transaction.c: line 211 (mail_index_transaction_commit_real): assertion failed: (expected_highest_modseq == log->head->sync_highest_modseq)
Josef 'Jeff' Sipek [Thu, 17 Sep 2020 19:43:02 +0000 (15:43 -0400)]
login-common: Include the proxy's source address in log messages