]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
Stephan Bosch [Fri, 11 Sep 2020 22:20:51 +0000 (00:20 +0200)]
lib-smtp: test-smtp-command-parser - Add tests for input ending in partial UTF-8 sequences.
Stephan Bosch [Fri, 11 Sep 2020 22:19:14 +0000 (00:19 +0200)]
lib-smtp: test-smtp-command-parser - Test parsing commands from input that comes in gradually.
Stephan Bosch [Fri, 11 Sep 2020 22:15:35 +0000 (00:15 +0200)]
lib-smtp: smtp-command-parser - Fix parameter parsing not to fail on particular unicode code points.
Unicode code points were sometimes erroneously checked as ASCII characters.
Stephan Bosch [Fri, 11 Sep 2020 19:53:06 +0000 (21:53 +0200)]
lib-smtp: smtp-command-parser - Fix read past buffer limit while parsing UTF-8 character.
The buffer limit was specified as (buf->pos - buf->end) rather than (buf->end -
buf->pos). Since at most a valid UTF-8 character can be read beyond the buffer
size, this bug didn't cause noticeable effects, nor does it present an attack
surface.
Stephan Bosch [Fri, 11 Sep 2020 21:54:29 +0000 (23:54 +0200)]
lib-smtp: Reformat test-smtp-command-parser.c.
Stephan Bosch [Fri, 11 Sep 2020 20:57:58 +0000 (22:57 +0200)]
lib-smtp: Reformat smtp-command-parser.c.
Timo Sirainen [Mon, 31 Aug 2020 17:38:42 +0000 (20:38 +0300)]
lib-mail: message_parser_init_from_parts() - Fix crash if MIME boundaries don't end
If the last "boundary--" doens't exist, the parsing assert-crashed at
deinit. This mainly happened when searching mails.
Fixes:
Panic: file message-parser.c: line 175 (message_part_finish): assertion failed: (ctx->nested_parts_count > 0)
Timo Sirainen [Fri, 28 Aug 2020 15:35:00 +0000 (18:35 +0300)]
acl: Ignore acl_object_list_deinit() error when copying ACLs from parent
There's already a FIXME, and this makes static analyzer happier.
Timo Sirainen [Thu, 13 Aug 2020 08:38:07 +0000 (11:38 +0300)]
director: Explicitly ignore array_bsearch_insert_pos() return value
Makes static analyzers happier.
Timo Sirainen [Thu, 13 Aug 2020 08:29:38 +0000 (11:29 +0300)]
lib: test-istream - Check or explicitly ignore i_stream_read() return value
Makes static analyzers happier.
Timo Sirainen [Wed, 12 Aug 2020 08:05:55 +0000 (11:05 +0300)]
lib-ssl-iostream: Fix error message with invalid ciphersuites
The error message contained curve_list's value, not ciphersuites' value.
Timo Sirainen [Mon, 14 Sep 2020 14:44:58 +0000 (17:44 +0300)]
lib-compression: test-compression - Fix memory leak
Timo Sirainen [Mon, 14 Sep 2020 07:37:16 +0000 (10:37 +0300)]
lib: Add a comment about o_stream_create_buffer()
Timo Sirainen [Mon, 14 Sep 2020 07:28:41 +0000 (10:28 +0300)]
lib: ostream-buffer - Revert returning 0 as used buffer size
This change broke at least one external plugin that assumed the original
behavior. Safer to just revert this change.
Reverts
48083d9e7fdbe257b0be33043ecf0ca87489eef9
Timo Sirainen [Mon, 14 Sep 2020 07:27:26 +0000 (10:27 +0300)]
lib-compression: test-compression - Convert from ostream-buffer to iostream-temp
Using ostream-buffer required
48083d9e7fdbe257b0be33043ecf0ca87489eef9
change, but this broke some code that assumed the original behavior.
Aki Tuomi [Fri, 11 Sep 2020 20:28:47 +0000 (23:28 +0300)]
lib-compression: test-compression - Use datastack in test
Plugs a memory leak.
Broken in
60b4040ba498ce7b19fc8b189d327cc606856f07
Timo Sirainen [Fri, 11 Sep 2020 11:29:14 +0000 (14:29 +0300)]
lib-fs: test-fs-async - Fix to work properly after previous changes
It's an async test, so it should expect that the fs actually behaves
asynchronously.
Timo Sirainen [Fri, 11 Sep 2020 11:28:11 +0000 (14:28 +0300)]
lib-dict: dict_switch_ioloop() - Move also failure timeout
Forgotten in
178bb676ea1dd380789d3587bf5e64fd85a29d7a
Josef 'Jeff' Sipek [Fri, 21 Aug 2020 18:31:12 +0000 (14:31 -0400)]
stats: event exporter - Use category exporting helper to avoid duplicates (tabtext)
Josef 'Jeff' Sipek [Fri, 21 Aug 2020 18:23:50 +0000 (14:23 -0400)]
stats: event exporter - Use category exporting helper to avoid duplicates (json)
Josef 'Jeff' Sipek [Fri, 21 Aug 2020 18:23:14 +0000 (14:23 -0400)]
stats: Add helper to append category names without duplicates
Timo Sirainen [Fri, 28 Aug 2020 15:36:47 +0000 (18:36 +0300)]
lib: net_listen|connect_unix() - Use consistent error handling for too long paths
The errno should be the same for both functions. Prefer ENAMETOOLONG if it
exists on the OS, otherwise fallback to EOVERFLOW.
Aki Tuomi [Fri, 11 Sep 2020 05:22:11 +0000 (08:22 +0300)]
lib-dict: dict - Keep track of next commit in dict_wait
Satisfies static analyser, broken in
178bb676ea1dd380789d3587bf5e64fd85a29d7a
Aki Tuomi [Thu, 10 Sep 2020 14:56:49 +0000 (17:56 +0300)]
lib-dict: dict - Ensure there are no commits during deinit
Aki Tuomi [Thu, 10 Sep 2020 14:43:06 +0000 (17:43 +0300)]
lib-dict: dict - Allow calling callback immediately
Make callback calls the next callback immediately,
instead of adding a timeout that calls the callback.
Forgotten in
178bb676ea1dd380789d3587bf5e64fd85a29d7a
Aki Tuomi [Thu, 10 Sep 2020 14:42:19 +0000 (17:42 +0300)]
lib-dict: dict - Change background to delayed_callback
It better describes what it's intended to do.
Timo Sirainen [Wed, 12 Aug 2020 12:48:14 +0000 (15:48 +0300)]
acl: Add unit test for acl_rights_sort()
Timo Sirainen [Wed, 12 Aug 2020 12:46:31 +0000 (15:46 +0300)]
acl: acl_rights_sort() - Handle zero sized rights array properly
Fixes ubsan complaint about count-dest wrapping to negative.
The array code handled this properly though, so nothing was broken.
Aki Tuomi [Tue, 1 Sep 2020 06:13:05 +0000 (09:13 +0300)]
lib: test-file-cache - Add tests for file-cache
Aki Tuomi [Thu, 20 Aug 2020 13:47:12 +0000 (16:47 +0300)]
lib: log-throttle - Initialize last_throttle
It's compared to ioloop_timeval later on and would
produce overflow there.
Aki Tuomi [Thu, 20 Aug 2020 13:24:41 +0000 (16:24 +0300)]
quota: quota_free_bytes - Check we don't decrease more than INT64_MAX
Otherwise we get overflow
Aki Tuomi [Thu, 20 Aug 2020 09:46:06 +0000 (12:46 +0300)]
lib: file-dotlock - Do not call callback if we are going to timeout
Aki Tuomi [Thu, 20 Aug 2020 07:55:36 +0000 (10:55 +0300)]
lib-mail: istream-header-filter - Avoid unsigned overflow in last_offset calculation
Unsigned integer overflow occurs when size is 0.
Aki Tuomi [Thu, 20 Aug 2020 07:37:54 +0000 (10:37 +0300)]
lib-ldap: ldap_connection_send_next - Extract next message in separate function
Aki Tuomi [Thu, 20 Aug 2020 07:31:41 +0000 (10:31 +0300)]
lib-storage: index-mail-headers - Avoid unsigned overflow on header_match_value
Aki Tuomi [Thu, 20 Aug 2020 06:53:11 +0000 (09:53 +0300)]
imap: imap-sync - Avoid unsigned integer overflow
Error: imap-sync.c:433:17: runtime error: unsigned integer overflow:
4294967295 + 1 cannot be represented in type 'unsigned int'
Aki Tuomi [Thu, 20 Aug 2020 06:44:58 +0000 (09:44 +0300)]
lib-mail: test-istream-attachment - Avoid unsigned overflow in size calculation
Aki Tuomi [Thu, 20 Aug 2020 06:44:20 +0000 (09:44 +0300)]
lib: var-expand - Avoid unsigned overflow in offset calculation
Aki Tuomi [Thu, 20 Aug 2020 06:43:35 +0000 (09:43 +0300)]
lib: time-util - Use correct data types
Aki Tuomi [Thu, 20 Aug 2020 06:34:40 +0000 (09:34 +0300)]
quota: quota-imapc - Handle quota limits better
If quota limit is bigger than INT64_MAX, it's unlimited
as we cannot express this anyways.
Aki Tuomi [Thu, 20 Aug 2020 06:10:36 +0000 (09:10 +0300)]
lib-mail: message-parser - Change last_chr to unsigned char
Matches code usage.
Aki Tuomi [Thu, 20 Aug 2020 06:02:07 +0000 (09:02 +0300)]
lib-imap-storage: imap-msgpart - Fix constant type
Aki Tuomi [Thu, 20 Aug 2020 05:47:16 +0000 (08:47 +0300)]
auth: password-scheme - Fix salt generation data type mess
Satisfies runtime analyser
Aki Tuomi [Thu, 20 Aug 2020 05:44:45 +0000 (08:44 +0300)]
auth: mech-scram - Use correct data type for proof calculation
Satisfies runtime analyzer
Aki Tuomi [Mon, 31 Aug 2020 13:15:15 +0000 (16:15 +0300)]
lib: Remove istream-mmap.c
Nothing uses it.
Aki Tuomi [Mon, 31 Aug 2020 07:33:05 +0000 (10:33 +0300)]
lib-ntlm: Ensure data_size is large enough for buffer
Aki Tuomi [Thu, 13 Aug 2020 06:48:27 +0000 (09:48 +0300)]
lib-ntlm: Use CONST_PTR_OFFSET
Aki Tuomi [Thu, 13 Aug 2020 06:46:37 +0000 (09:46 +0300)]
auth, lib-ntlm: Use dovecot byteorder functions
Aki Tuomi [Tue, 11 Aug 2020 06:00:17 +0000 (09:00 +0300)]
lib: buffer - Assert that we don't try to allocate SIZE_MAX buffer
Only if devel checks are enabled
Aki Tuomi [Tue, 11 Aug 2020 05:45:37 +0000 (08:45 +0300)]
lib-ssl-iostream: ostream-openssl - Allocate at most IO_BLOCK_SIZE initial buffer
Otherwise we might attempt to allocate way too large buffers. This has not caused
issues yet, except with max_buffer_size=SIZE_T, which has been causing us to allocate
0-sized buffers.
Aki Tuomi [Mon, 10 Aug 2020 16:54:51 +0000 (19:54 +0300)]
auth: auth-cache - Data is not 4 bytes but variable sized
Aki Tuomi [Thu, 13 Aug 2020 08:41:23 +0000 (11:41 +0300)]
lib-otp: Use for-loop instead while
Avoids unsigned integer wrap
Aki Tuomi [Thu, 13 Aug 2020 08:40:35 +0000 (11:40 +0300)]
lib-compression: istream-zstd - Handle signed/unsigned return values correctly
Aki Tuomi [Thu, 13 Aug 2020 08:39:59 +0000 (11:39 +0300)]
lib: lib-event - Use for-loop in copying categories
Avoids unsigned integer wrap
Aki Tuomi [Wed, 19 Aug 2020 10:55:18 +0000 (13:55 +0300)]
global: Use i_rand_limit(limit) instead of i_rand() % limit
spatch with coccinelle/random-misuse.cocci
Aki Tuomi [Wed, 19 Aug 2020 11:01:50 +0000 (14:01 +0300)]
lib: Use i_rand_limit() helpers
Aki Tuomi [Wed, 19 Aug 2020 11:00:03 +0000 (14:00 +0300)]
lib: test-base32/64 - Use unsigned char
Simplifies next change
Aki Tuomi [Wed, 19 Aug 2020 16:49:38 +0000 (19:49 +0300)]
lib: Add some helpers for random values
Josef 'Jeff' Sipek [Wed, 19 Aug 2020 18:33:59 +0000 (14:33 -0400)]
lib: Document how i_rand_limit() ensures uniform distribution
This algorithm is not original, but it is dense enough that a detailed
explanation is in order.
Aki Tuomi [Thu, 13 Aug 2020 08:35:17 +0000 (11:35 +0300)]
lib: rand - Fix random number bounding
Aki Tuomi [Tue, 11 Aug 2020 05:48:09 +0000 (08:48 +0300)]
auth: password-scheme - Use generate_salt in md5crypt
Deduplicates code
Aki Tuomi [Sun, 23 Aug 2020 20:24:35 +0000 (23:24 +0300)]
lib-sql: driver-cassandra - Add SSL options
ssl_ca=<path>: Sets trusted peer certificate filename
ssl_cert=<path>: Sets client certificate filename
sl_key=<path>: Sets client certificate private key filename
ssl_key_password=<string>: Sets password for private key
ssl_verify=none | cert | cert-ip | cert-dns: Sets verify mode
* none = don't verify
* cert = verify certificate
* cert-ip = verify IP from CN or SubjectAltName
* cert-dns = verify hostname from CN or SubjectAltName
Aki Tuomi [Sun, 23 Aug 2020 20:05:33 +0000 (23:05 +0300)]
lib: buffer - Add buffer_append_full_(file|istream)
Consume istream or file up to max_read_size or EOF.
Aki Tuomi [Sun, 23 Aug 2020 19:24:07 +0000 (22:24 +0300)]
m4: want_cassandra.m4 - Add check for CASS_SSL_VERIFY_PEER_IDENTITY_DNS
Aki Tuomi [Sun, 23 Aug 2020 19:06:50 +0000 (22:06 +0300)]
m4: want_cassandra.m4 - Add check for cass_cluster_set_use_hostname_resolution
Aki Tuomi [Sun, 23 Aug 2020 19:06:34 +0000 (22:06 +0300)]
m4: Modernize want_cassandra.m4
Aki Tuomi [Fri, 28 Aug 2020 10:17:10 +0000 (13:17 +0300)]
lib-sql: driver-cassandra - Use INTx_MIN and INTx_MAX
Preferred over magic numbers
Aki Tuomi [Fri, 28 Aug 2020 10:13:32 +0000 (13:13 +0300)]
lib-sql: Reformat driver-cassandra.c
Timo Sirainen [Wed, 9 Sep 2020 09:08:38 +0000 (12:08 +0300)]
lib-compression: Add unit test to compress large input
This catches earlier zstd and lzma bugs.
Timo Sirainen [Wed, 9 Sep 2020 10:00:44 +0000 (13:00 +0300)]
lib-compression: ostream-lzma - Compressed output could have been truncated
The compression wasn't fully finished, resulting in truncated compressed
output that couldn't be fully read back. Reading would result in "Broken
pipe" errors.
Broken by
6080aa16e1bd50cd661acc31203d9f4986a9450a
Timo Sirainen [Wed, 9 Sep 2020 09:48:39 +0000 (12:48 +0300)]
lib-compression: istream-lzma - Improve error messages in EOF handling
Timo Sirainen [Wed, 9 Sep 2020 09:46:51 +0000 (12:46 +0300)]
lib-compression: istream-lzma - Fix EOF handling
lzma_stream_end() call was accidentally dropped by
c6248b825d8c6562b1320e51ad0d88e99b9fbe85
This (probably) didn't result in visible problems.
Timo Sirainen [Tue, 8 Sep 2020 18:19:21 +0000 (21:19 +0300)]
lib-compression: ostream-zstd - Fix assert-crash with large input
If the input was large enough, the ostream write could have returned
partially written output. Since this ostream-zstd was only used for
blocking ostreams, this would always result in an assert-crash. Fix is
to keep flushing the output to parent if the output buffer becomes full.
Fixes:
Panic: file ostream.c: line 287 (o_stream_sendv_int): assertion failed: (!stream->blocking)
Timo Sirainen [Wed, 9 Sep 2020 09:03:31 +0000 (12:03 +0300)]
lib: ostream-buffer: Return 0 as the used size, not the destination buffer size
This allows using ostream-buffer in places that previously would think that
the ostream buffer needed to be flushed because its buffer size was too
large.
This also changes o_stream_get_buffer_avail_size() to always return the
ostream max buffer size.
Stephan Bosch [Mon, 31 Aug 2020 13:29:03 +0000 (15:29 +0200)]
lib-smtp: smtp-server-recipient - Recipient event should be using the transaction event as parent.
The connection event is only used as event parent when the MAIL command failed
in pipeline or when the recipient is destroyed prematurely. The log prefix of
the transaction event is dropped, so that the connection event log prefix is
used in either case. Therefore, the main visible effect of this commit is that
the transaction event fields are available in the recipient event when there is
a transaction, the log messages will not change.
Stephan Bosch [Mon, 31 Aug 2020 12:10:18 +0000 (14:10 +0200)]
lib-smtp: smtp-server-recipient - Don't create event until transaction becomes available.
This way, the recipient event parent can be the transaction event once (and if)
that becomes available.
Stephan Bosch [Mon, 31 Aug 2020 12:58:44 +0000 (14:58 +0200)]
lib-smtp: smtp-server-command - Always call the NEXT_TO_REPLY hook.
Before, it wasn't called when a reply was submitted before the command became
next to reply.
Stephan Bosch [Mon, 31 Aug 2020 12:44:25 +0000 (14:44 +0200)]
lib-smtp: smtp-server-command - Move smtp_server_command_ready_to_reply().
New order makes more sense in the progression of command state.
Stephan Bosch [Wed, 2 Sep 2020 09:15:33 +0000 (11:15 +0200)]
lib: event-log - Fix handling dropping parent prefixes beyond a drop at a higher level.
Before, the drop in the higher level became invisible to the lower
hiererarchies. For example:
parent1, parent2, parent3, parent4(drop one) yielded
"parent1: parent2: parent4: " as a prefix (which is still OK), whereas
parent1: parent2: parent3: parent4(drop one): leaf(drop 3) yielded
"parent1: leaf: ", while the expected prefix would be:
"leaf: ".
This means that the drop of one prefix by parent4 is ignored. Instead it should
apply that drop and operate on the prefixes that are still visible at the lowel
level, so the number of prefixes dropped should be additive, which is what this
commit changes.
Stephan Bosch [Mon, 31 Aug 2020 13:08:43 +0000 (15:08 +0200)]
lib-smtp: Reformat smtp-server-recipient.c.
Stephan Bosch [Mon, 31 Aug 2020 12:40:16 +0000 (14:40 +0200)]
lib-smtp: Reformat smtp-server-private.h.
Stephan Bosch [Mon, 31 Aug 2020 12:37:35 +0000 (14:37 +0200)]
lib-smtp: Reformat smtp-server-connection.c.
Stephan Bosch [Mon, 31 Aug 2020 12:21:41 +0000 (14:21 +0200)]
lib-smtp: Reformat smtp-server-command.c.
Stephan Bosch [Mon, 31 Aug 2020 12:16:31 +0000 (14:16 +0200)]
lib-smtp: Reformat smtp-server-cmd-mail.c.
Stephan Bosch [Mon, 31 Aug 2020 12:13:31 +0000 (14:13 +0200)]
lib-smtp: Reformat smtp-server-cmd-rcpt.c.
Aki Tuomi [Mon, 7 Sep 2020 07:56:34 +0000 (10:56 +0300)]
lib-dict: dict_transaction_commit_async() - Never call callback immediately
This could cause confusion for the callers. Although so far all the callers
have handled it fine.
Use this wrappers for all dict drivers, even if they support async commits
themselves. This is because many of them were still calling the callback
immediately on error handling.
Timo Sirainen [Thu, 10 Sep 2020 07:16:56 +0000 (10:16 +0300)]
lib: istream-try - Fix off-by-one check for min_buffer_full_size
This mainly fixes random failures with the unit test.
Timo Sirainen [Thu, 10 Sep 2020 07:16:35 +0000 (10:16 +0300)]
lib: test-istream-try - Fix test name
Timo Sirainen [Tue, 8 Sep 2020 14:32:32 +0000 (17:32 +0300)]
lib: istream-try - Fix detecting istream when its input buffer is full
The previous check didn't work when the stream's buffer_size was 0,
which happened with istream-concat parent.
Added also a unit test that tries to test for these kind of situations.
It doesn't actually reproduce this specific bug, but it tests that the
code paths works at least in the generic situation.
Timo Sirainen [Tue, 8 Sep 2020 17:14:09 +0000 (20:14 +0300)]
lib-compression: Add COMPRESSION_HDR_MAX_SIZE macro
Will be used by the next commit.
Markus Valentin [Wed, 8 Jul 2020 08:18:27 +0000 (10:18 +0200)]
quota: Add logging prefix once and remove it from loglines
Markus Valentin [Tue, 7 Jul 2020 12:39:22 +0000 (14:39 +0200)]
quota: Introduce per quota-backend events
Timo Sirainen [Thu, 31 Oct 2019 17:27:15 +0000 (19:27 +0200)]
quota: Use event based logging
Aki Tuomi [Tue, 25 Aug 2020 11:01:24 +0000 (14:01 +0300)]
quota: Add event support
Timo Sirainen [Mon, 31 Aug 2020 15:30:18 +0000 (18:30 +0300)]
lib-index: Fix cache being purged too often when it had unaccessed fields
Cache was being purged when it had a field that was last accessed
after mail_cache_unaccessed_field_drop but before
2*mail_cache_unaccessed_field_drop. This purging may not have even
done anything.
Use shared code now between the check in mail_cache_header_fields_read()
and the actual purging in mail_cache_purge_check_field(). This way they
can't become desynced again.
Timo Sirainen [Mon, 31 Aug 2020 14:27:58 +0000 (17:27 +0300)]
lib-index: Use delayed purge reason for mail_cache_purge_* events
Timo Sirainen [Mon, 31 Aug 2020 14:25:54 +0000 (17:25 +0300)]
lib-index: Remember reason for delayed cache file purges
Timo Sirainen [Mon, 31 Aug 2020 14:23:05 +0000 (17:23 +0300)]
lib-index: Fix file_size field in mail_cache_purge_finished event
It used to be 32 always.
Timo Sirainen [Wed, 26 Aug 2020 15:39:22 +0000 (18:39 +0300)]
lib-index: Fix deadlock when expunging mails and adding lots of data to cache
This practically happened only when dovecot.index.cache contents were lost
and they were being re-filled while mails were also being expunged.
Broken by
9efb99924d0b7de27ca83e373f2290f3dd5b22cf
Timo Sirainen [Fri, 28 Aug 2020 14:16:03 +0000 (17:16 +0300)]
zlib: Rename istreams from zlib(parent) to compress(parent)
This clarifies it that the istream is a generic compression stream, not
specifically zlib/gz.