]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
7 years agolib: Implement vfuncs for logging to stderr
Sergey Kitov [Thu, 14 Jun 2018 12:54:03 +0000 (15:54 +0300)] 
lib: Implement vfuncs for logging to stderr

7 years agolib: Implement vfuncs for logging to syslog
Sergey Kitov [Thu, 14 Jun 2018 12:49:41 +0000 (15:49 +0300)] 
lib: Implement vfuncs for logging to syslog

7 years agolib: Implement vfuncs for logging to default location and common failure logging...
Sergey Kitov [Sun, 5 Aug 2018 01:00:17 +0000 (04:00 +0300)] 
lib: Implement vfuncs for logging to default location and common failure logging handling

7 years agolib: Introduce abstraction for failure logging implementations.
Sergey Kitov [Tue, 12 Jun 2018 12:56:46 +0000 (15:56 +0300)] 
lib: Introduce abstraction for failure logging implementations.

7 years agolib-master: Fix crash when stats events are merged all the way to the root
Timo Sirainen [Mon, 3 Sep 2018 11:15:07 +0000 (14:15 +0300)] 
lib-master: Fix crash when stats events are merged all the way to the root

7 years agolib-master: stats_event_get_merged() - Remove unnecessary variable assignment
Timo Sirainen [Mon, 3 Sep 2018 10:14:39 +0000 (13:14 +0300)] 
lib-master: stats_event_get_merged() - Remove unnecessary variable assignment

Fixes scan-build complaint.

7 years agolib-master: stats_event_write use BEGIN only when event and parent_event create times...
Sergey Kitov [Tue, 16 Jan 2018 10:51:53 +0000 (12:51 +0200)] 
lib-master: stats_event_write use BEGIN only when event and parent_event create timestamps differ

7 years agolib: Add some event handling functions.
Sergey Kitov [Mon, 26 Feb 2018 14:33:19 +0000 (16:33 +0200)] 
lib: Add some event handling functions.

event_has_all_categories() - checks if given event contains all the
categories of an another event.
event_has_all_fields() - checks if given event contains all the fields
of an another event.
event_dup() - duplicates an event.
event_copy_categories_fields() - copies all categories and fields from
source to dest.

7 years agolib-http: client: peer: Log the number of pending connections consistently in relevan...
Stephan Bosch [Thu, 6 Sep 2018 01:40:55 +0000 (03:40 +0200)] 
lib-http: client: peer: Log the number of pending connections consistently in relevant debug messages.

Use the same style everywhere and log it where it makes sense.

7 years agolib-http: client: peer: Maintain a list of connections pending on behalf of a peer.
Stephan Bosch [Thu, 6 Sep 2018 01:33:59 +0000 (03:33 +0200)] 
lib-http: client: peer: Maintain a list of connections pending on behalf of a peer.

Before, pending connections were only listed in the peer pool.

7 years agolib-http: client: connection: Unlist the connection as pending immediately in http_cl...
Stephan Bosch [Thu, 6 Sep 2018 01:23:26 +0000 (03:23 +0200)] 
lib-http: client: connection: Unlist the connection as pending immediately in http_client_connection_failure().

7 years agolib-http: client: connection: Remove the connection from the peer pool pending list...
Stephan Bosch [Wed, 5 Sep 2018 23:57:43 +0000 (01:57 +0200)] 
lib-http: client: connection: Remove the connection from the peer pool pending list in a separate function.

7 years agolib-http: client: peer: Notify all peers in a peer pool about a successful connection.
Stephan Bosch [Thu, 6 Sep 2018 13:22:30 +0000 (15:22 +0200)] 
lib-http: client: peer: Notify all peers in a peer pool about a successful connection.

This allows peers for which the last connection attempt failed (which was not
the last pending attempt in the pool) to try again. This solves a problem that
could potentially cause a hang with multiple parallel clients creating serveral
new connections at once.

7 years agolib-http: client: peer: Add debug message for http_client_peer_connection_failure().
Stephan Bosch [Thu, 6 Sep 2018 14:03:58 +0000 (16:03 +0200)] 
lib-http: client: peer: Add debug message for http_client_peer_connection_failure().

7 years agolib-http: client: peer: Clarify debug message in http_client_peer_connection_failed_p...
Stephan Bosch [Thu, 6 Sep 2018 13:56:44 +0000 (15:56 +0200)] 
lib-http: client: peer: Clarify debug message in http_client_peer_connection_failed_pool().

7 years agolib-http: client: peer: Log debug message before calling peer pool in http_client_pee...
Stephan Bosch [Thu, 6 Sep 2018 13:54:02 +0000 (15:54 +0200)] 
lib-http: client: peer: Log debug message before calling peer pool in http_client_peer_connection_success().

7 years agolib-http: client: peer: Rename http_client_peer_connection_failed_any() to http_clien...
Stephan Bosch [Thu, 6 Sep 2018 13:50:36 +0000 (15:50 +0200)] 
lib-http: client: peer: Rename http_client_peer_connection_failed_any() to http_client_peer_connection_failed_pool().

7 years agolib-http: client: peer: Always run http_client_queue_connection_failure() upon defini...
Stephan Bosch [Thu, 6 Sep 2018 01:11:18 +0000 (03:11 +0200)] 
lib-http: client: peer: Always run http_client_queue_connection_failure() upon definitive connection failure.

The recorded peer->connecting flag was highly unreliable in a scenario involving
starting parallel connections. This way, the linked queues can update their
state accordingly. Also, this will not cause empty queues to initiate new
connection, because empty queues will do nothing after updating the connection
state.

This problem caused a client ioloop hang in high-load conditions.

7 years agolib-http: client: peer: Move http_client_peer_connection_failure().
Stephan Bosch [Thu, 6 Sep 2018 12:57:28 +0000 (14:57 +0200)] 
lib-http: client: peer: Move http_client_peer_connection_failure().

7 years agolib-http: client: queue: Do not fail claimed requests unless the queue is being destr...
Stephan Bosch [Thu, 6 Sep 2018 01:02:16 +0000 (03:02 +0200)] 
lib-http: client: queue: Do not fail claimed requests unless the queue is being destroyed.

Before, connection failure would also abort requests already being sent on
another connection, which is premature at best.

7 years agolib-http: client: queue: Fix the number of pending requests listed in http_client_que...
Stephan Bosch [Thu, 6 Sep 2018 00:57:24 +0000 (02:57 +0200)] 
lib-http: client: queue: Fix the number of pending requests listed in http_client_queue_connection_failure() debug message.

7 years agolib-http: client: peer: Determine number of pending peers in http_client_peer_shared_...
Stephan Bosch [Thu, 6 Sep 2018 00:51:09 +0000 (02:51 +0200)] 
lib-http: client: peer: Determine number of pending peers in http_client_peer_shared_connection_failure() itself.

Before, the number of pending peers was a parameter, but that was only for a
single peer pool. This is wrong, since the one peer can have many different
pools (depending on how many clients with incompatible configs share this
peer).

7 years agolib-http: client: peer: Notify definitive connection failure only within a peer pool.
Stephan Bosch [Thu, 6 Sep 2018 12:49:59 +0000 (14:49 +0200)] 
lib-http: client: peer: Notify definitive connection failure only within a peer pool.

Other peer pools have different configuration, which may actually succeed and
will arrive at this point when their own connections fail anyway.

7 years agoquota: Mark noenforcing quotas with unlimited quota
Aki Tuomi [Tue, 24 Jul 2018 11:47:47 +0000 (14:47 +0300)] 
quota: Mark noenforcing quotas with unlimited quota

This allows quota to be properly updated for unenforced quotas
so they can be used for tracking only.

This fixes issue where using noenforcing would not update quota
during mail save, but requires a manual quota update.

7 years agoquota: Cleanup - Move enforce checking out of quota_root_visible()
Aki Tuomi [Tue, 24 Jul 2018 11:38:18 +0000 (14:38 +0300)] 
quota: Cleanup - Move enforce checking out of quota_root_visible()

Non-enforcing quota roots need to be visible even when enforcing quotas,
otherwise we cannot update them.

7 years agofts: Optimize replacing NULs in header
Timo Sirainen [Mon, 27 Aug 2018 12:06:44 +0000 (15:06 +0300)] 
fts: Optimize replacing NULs in header

7 years agofts: Fix indexing mails with NULs in headers
Timo Sirainen [Thu, 23 Aug 2018 11:33:59 +0000 (14:33 +0300)] 
fts: Fix indexing mails with NULs in headers

After the first NUL all the rest of the string was converted to spaces.
This was broken already in the initial commit that attempted to fix this:
4d27f95c76bd008bb38f9c442567046da2b6ce14

7 years agolib-index: mail_cache_lookup_headers() - Allow using datastack pool
Timo Sirainen [Mon, 20 Aug 2018 09:51:28 +0000 (12:51 +0300)] 
lib-index: mail_cache_lookup_headers() - Allow using datastack pool

This fixes assert caused by 53712af0e7f357e7279d9ff03831428aae85aa45:
Panic: pool_data_stack_realloc(): stack frame changed

7 years agolib-storage: Fix NUL handling in mail_get_first_header*(), mail_get_headers*()
Timo Sirainen [Fri, 17 Aug 2018 11:39:41 +0000 (14:39 +0300)] 
lib-storage: Fix NUL handling in mail_get_first_header*(), mail_get_headers*()

These functions return NUL-terminated values, so they got truncated whenever
a header value contained a NUL. Fix this by converting NULs to unicode
replacement characters in the output.

7 years agolib-mail: Make message_header_strdup() public
Timo Sirainen [Fri, 17 Aug 2018 11:33:50 +0000 (14:33 +0300)] 
lib-mail: Make message_header_strdup() public

Also move it to a better file.

7 years agolib-mail: Cleanup - Rename internal hdr_strdup() to message_header_strdup()
Timo Sirainen [Fri, 17 Aug 2018 17:16:29 +0000 (20:16 +0300)] 
lib-mail: Cleanup - Rename internal hdr_strdup() to message_header_strdup()

7 years agolib-mail: rfc822-parser - Handle \<NUL> in quoted-string and domain-literal
Timo Sirainen [Fri, 17 Aug 2018 11:12:25 +0000 (14:12 +0300)] 
lib-mail: rfc822-parser - Handle \<NUL> in quoted-string and domain-literal

It was already handled in comments. Previously this caused the strings and
domain-literals to be truncated at that position.

7 years agolib-mail: test-message-address - Test NULs in display-name
Timo Sirainen [Fri, 17 Aug 2018 10:42:35 +0000 (13:42 +0300)] 
lib-mail: test-message-address - Test NULs in display-name

7 years agolib-mail: Change MESSAGE_ADDRESS_PARSE_FLAG_NON_STRICT_DOTS to _FLAG_STRICT_DOTS
Timo Sirainen [Fri, 4 May 2018 16:53:27 +0000 (19:53 +0300)] 
lib-mail: Change MESSAGE_ADDRESS_PARSE_FLAG_NON_STRICT_DOTS to _FLAG_STRICT_DOTS

Generally we want it to be enabled everywhere, so it's easier to just enable
it by default.

(This is kept as a separate commit from the previous one so it'll be easy to
revert this in case we actually don't want this to be the default.)

7 years agolib-mail: Add MESSAGE_ADDRESS_PARSE_FLAG_NON_STRICT_DOTS
Timo Sirainen [Fri, 4 May 2018 16:49:57 +0000 (19:49 +0300)] 
lib-mail: Add MESSAGE_ADDRESS_PARSE_FLAG_NON_STRICT_DOTS

This code is somewhat copy&pasted from parse_local_part() in Pigeonhole.

7 years agolib-mail: message_address_parse() - Change fill_missing parameter to flags
Timo Sirainen [Fri, 4 May 2018 16:31:26 +0000 (19:31 +0300)] 
lib-mail: message_address_parse() - Change fill_missing parameter to flags

This change allows adding more flags. The API is also backwards compatible
in a way that the old FALSE/TRUE values still map to compatible 0/1 flags.

7 years agolib-mail: Fix rfc822_parse_dot_atom() to reject if dot isn't followed by atom
Timo Sirainen [Fri, 4 May 2018 16:21:52 +0000 (19:21 +0300)] 
lib-mail: Fix rfc822_parse_dot_atom() to reject if dot isn't followed by atom

7 years agolib-mail: Remove MESSAGE_HEADER_REPLACE_NULS_WITH_0x80 flag
Timo Sirainen [Wed, 25 Apr 2018 11:19:27 +0000 (14:19 +0300)] 
lib-mail: Remove MESSAGE_HEADER_REPLACE_NULS_WITH_0x80 flag

As mentioned in previous commit, 0x80 isn't valid UTF-8 and we shouldn't
encourage using it. This implementation also can't be easily changed to
use unicode replacement character without larger changes to istream-nonuls.

Reverts 95fba2c295bb84639dc64ca5c9f2ccb9edc00ba7.

7 years agolib-mail: Change NUL -> 0x80 replacement to use unicode replacement char instead
Timo Sirainen [Wed, 25 Apr 2018 11:17:34 +0000 (14:17 +0300)] 
lib-mail: Change NUL -> 0x80 replacement to use unicode replacement char instead

Using 0x80 produces invalid UTF-8 output, which we should avoid. Some places
in Dovecot code already requires that input is valid UTF-8, so it's also
safer and easier to use the unicode replacement character.

Fixes: Panic: file fts-tokenizer-generic.c: line 210 (fts_tokenizer_generic_simple_next): assertion failed: (char_size > 0)
7 years agolib-mail: Change rfc822_parser_context.nul_replacement_char to string
Timo Sirainen [Wed, 25 Apr 2018 11:11:43 +0000 (14:11 +0300)] 
lib-mail: Change rfc822_parser_context.nul_replacement_char to string

7 years agolib-mail: message_part_*_parse_from_header() - Replace NULs with 0x80
Timo Sirainen [Tue, 24 Apr 2018 15:01:03 +0000 (18:01 +0300)] 
lib-mail: message_part_*_parse_from_header() - Replace NULs with 0x80

This avoids truncation of Content-*, Subject, Message-ID, In-Reply-To and
Date headers in IMAP ENVELOPE, BODY and BODYSTRUCTURE replies. Of course,
NULs in headers are violating RFCs already, so the previous behavior wasn't
really wrong either.

7 years agolib: Mark str_append_n() deprecated
Timo Sirainen [Sat, 21 Apr 2018 13:21:33 +0000 (16:21 +0300)] 
lib: Mark str_append_n() deprecated

It was almost always used wrongly. Most of the time str_append_data()
should have been used instead. str_append_max() has the old functionality.

7 years agolib: Add ATTR_DEPRECATED macro
Timo Sirainen [Sat, 21 Apr 2018 13:19:43 +0000 (16:19 +0300)] 
lib: Add ATTR_DEPRECATED macro

7 years agoglobal: Replace str_append_n() with str_append_max()
Timo Sirainen [Sat, 21 Apr 2018 13:17:03 +0000 (16:17 +0300)] 
global: Replace str_append_n() with str_append_max()

7 years agolib-fts: fts-tokenizer-address - Cleanup NUL handling in parent_data
Timo Sirainen [Sat, 21 Apr 2018 13:07:21 +0000 (16:07 +0300)] 
lib-fts: fts-tokenizer-address - Cleanup NUL handling in parent_data

The end result is anyway that the token will be truncated at the first NUL.
This change just makes the code a bit more understandable on where the
truncation will happen.

7 years agolib: str_append_[tab]unescaped(): Don't truncate input at NULs
Timo Sirainen [Sat, 21 Apr 2018 12:44:11 +0000 (15:44 +0300)] 
lib: str_append_[tab]unescaped(): Don't truncate input at NULs

For str_append_tabunescaped() the input is supposed to have NULs already
escaped though, so it was truncating only with invalid input.

7 years agoglobal: Replace str_append_n() with str_append_data() wherever possible
Timo Sirainen [Sat, 21 Apr 2018 12:24:28 +0000 (15:24 +0300)] 
global: Replace str_append_n() with str_append_data() wherever possible

It shouldn't be possible for input to have NULs in any of these places.
This makes the extra NUL-check in str_append_n() unnecessary.

7 years agolib: Add str_append_max()
Timo Sirainen [Sat, 21 Apr 2018 13:11:48 +0000 (16:11 +0300)] 
lib: Add str_append_max()

It's otherwise the same as str_append_n(), except it takes const char* as
input instead of const void*. This, as well as its name, should make it
less likely to be used wrong when the input may legitimately have NULs.

The unit test is changed from str_append_n() to str_append_max(), because
str_append_n() will be deprecated.

7 years agolib: Improve str_append_n() comment
Timo Sirainen [Sat, 21 Apr 2018 13:10:03 +0000 (16:10 +0300)] 
lib: Improve str_append_n() comment

7 years agolib-mail: Add MESSAGE_HEADER_REPLACE_NULS_WITH_0x80 flag
Sergey Kitov [Wed, 11 Apr 2018 11:41:45 +0000 (14:41 +0300)] 
lib-mail: Add MESSAGE_HEADER_REPLACE_NULS_WITH_0x80 flag

The flag signals that input stream for message_parse_header() should replace
0x0 symbols with 0x80.

7 years agolib-mail: rfc2231_parse() - Replace NULs with 0x80
Timo Sirainen [Sat, 21 Apr 2018 13:47:16 +0000 (16:47 +0300)] 
lib-mail: rfc2231_parse() - Replace NULs with 0x80

Instead of truncating the strings at NULs.

7 years agolib-mail: message_address_parse*() - Replace NULs with 0x80
Timo Sirainen [Sat, 21 Apr 2018 13:34:05 +0000 (16:34 +0300)] 
lib-mail: message_address_parse*() - Replace NULs with 0x80

Instead of truncating the strings at NULs.

7 years agolib-mail: rfc822-parser: Add nul_replacement_char
Timo Sirainen [Sat, 21 Apr 2018 13:27:21 +0000 (16:27 +0300)] 
lib-mail: rfc822-parser: Add nul_replacement_char

7 years agolib-mail: rfc822-parser: Strip away folding whitespace from comments
Timo Sirainen [Sat, 21 Apr 2018 10:46:21 +0000 (13:46 +0300)] 
lib-mail: rfc822-parser: Strip away folding whitespace from comments

7 years agolib-mail: rfc822-parser: Improve domain-literal parsing
Timo Sirainen [Sat, 21 Apr 2018 10:28:34 +0000 (13:28 +0300)] 
lib-mail: rfc822-parser: Improve domain-literal parsing

Strip away folding whitespace. Treat any extra '[' as an error.

7 years agolib-mail: rfc822-parser: Don't allow preserving escaped [CR]LF
Timo Sirainen [Sat, 21 Apr 2018 10:05:49 +0000 (13:05 +0300)] 
lib-mail: rfc822-parser: Don't allow preserving escaped [CR]LF

It's not valid to have "\<CR>" or "\<LF>", so the old behavior isn't really
wrong either. However, rfc822_parse_quoted_string() callers are more likely
to expect that the output won't contain any [CR]LF so this new behavior is
a bit better.

7 years agolib-mail: Change rfc822_parse_content_param() API to allow NULs in value
Timo Sirainen [Sat, 21 Apr 2018 09:47:22 +0000 (12:47 +0300)] 
lib-mail: Change rfc822_parse_content_param() API to allow NULs in value

This was the only function in rfc822-parser.h that wasn't NUL-safe.
This won't fix anything, but it makes the rfc822-parser.h API fully
consistent with the NUL handling.

Normally rfc2231_parse() should be called instead of calling
rfc822_parse_content_param() directly, so this shouldn't break any plugins.

7 years agofts-squat: Fix truncating headers at NULs while indexing
Timo Sirainen [Sat, 21 Apr 2018 13:05:16 +0000 (16:05 +0300)] 
fts-squat: Fix truncating headers at NULs while indexing

7 years agologin-common: Consistently truncate client SASL input at first NUL
Timo Sirainen [Sat, 21 Apr 2018 13:03:42 +0000 (16:03 +0300)] 
login-common: Consistently truncate client SASL input at first NUL

The input is supposed to be base64-encoded, so there's no need to support
actual NUL characters. The previous code truncated at NULs, but could have
kept appending more data to the value. This could have produced somewhat
random results.

7 years agolib-master, util: Consistently truncate tabescaped input at the first NUL
Timo Sirainen [Sat, 21 Apr 2018 12:58:15 +0000 (15:58 +0300)] 
lib-master, util: Consistently truncate tabescaped input at the first NUL

The NULs are supposed to come tab-escaped, so there's no need to support
actual NUL characters. The previous code truncated at NULs, but could
have kept appending more data to the value. This could have produced
somewhat random results.

7 years agoconfig: Consistently truncate value at the first NUL in value input file
Timo Sirainen [Sat, 21 Apr 2018 12:53:42 +0000 (15:53 +0300)] 
config: Consistently truncate value at the first NUL in value input file

When value contained "<file", the file was added as a value. The setting
values don't currently support NULs, so the value gets truncated at the
first NUL. However, the previous code could have appended more data to
the value. This could have produced somewhat confusing results.

7 years agodict-fs/memcached-ascii/redis: Consistently truncate value at NULs
Timo Sirainen [Sat, 21 Apr 2018 12:50:08 +0000 (15:50 +0300)] 
dict-fs/memcached-ascii/redis: Consistently truncate value at NULs

The dict API currently doesn't support NULs in values, so they have to be
truncated. However, previously they were truncated at NULs, but more data
may have still been appended to the value. This could have produced
somewhat random results.

7 years agoauth: checkpassword - Fail if input from script contains NULs
Timo Sirainen [Sat, 21 Apr 2018 12:47:23 +0000 (15:47 +0300)] 
auth: checkpassword - Fail if input from script contains NULs

Previously the input was just silently truncated at NULs.

7 years agodoveadm: Fix table printer to not truncate output at NULs
Timo Sirainen [Sat, 21 Apr 2018 12:42:53 +0000 (15:42 +0300)] 
doveadm: Fix table printer to not truncate output at NULs

7 years agodoveadm dump: Don't truncate dovecot.index.cache values at NULs
Timo Sirainen [Sat, 21 Apr 2018 12:41:44 +0000 (15:41 +0300)] 
doveadm dump: Don't truncate dovecot.index.cache values at NULs

7 years agolib-mail: rfc822-parser: Don't truncate comment/quoted-string/domain-literal at NUL
Timo Sirainen [Sat, 21 Apr 2018 11:56:43 +0000 (14:56 +0300)] 
lib-mail: rfc822-parser: Don't truncate comment/quoted-string/domain-literal at NUL

The other tokens couldn't have contained NULs in the first place.

7 years agolib-mail: message_snippet_generate() - Ignore NULs without shrinking snippet size
Timo Sirainen [Sat, 21 Apr 2018 11:53:25 +0000 (14:53 +0300)] 
lib-mail: message_snippet_generate() - Ignore NULs without shrinking snippet size

Previously the NULs also weren't in the snippet content, but they were
included in the snippet size.

7 years agolib-storage: Fix truncating header values at NUL when adding to cache
Timo Sirainen [Sat, 21 Apr 2018 11:31:08 +0000 (14:31 +0300)] 
lib-storage: Fix truncating header values at NUL when adding to cache

For example FETCH BODY.PEEK[HEADER.FIELDS (Subject)] could have returned
the NUL on the first fetch when the mail wasn't in dovecot.index.cache,
but the second FETCH would have returned it truncated at the NUL.

7 years agolib: Fix filtering by event name in log_core_filter
Timo Sirainen [Sun, 27 May 2018 12:42:26 +0000 (15:42 +0300)] 
lib: Fix filtering by event name in log_core_filter

event->sending_name was already cleared by the time it was checked, so any
event:* filters never matched.

7 years agomaster: Wait 1 second for SIGQUITs to get handled
Josef 'Jeff' Sipek [Mon, 20 Aug 2018 22:07:30 +0000 (18:07 -0400)] 
master: Wait 1 second for SIGQUITs to get handled

The delay (previously 100ms, now 1s) is intended to delay our exit enough so
that the child processes have a chance to receive & handle the SIGQUITs we
just sent.  If we don't wait long enough, it is possible that we'll get
restarted before our children had the chance to stop listening on their
sockets and we'll hit "address already in use" type errors.

Increasing the delay does not fix the issue, but it masks it better.

7 years ago*-login: Fix non-global ssl=no configuration
Timo Sirainen [Fri, 18 May 2018 14:04:36 +0000 (17:04 +0300)] 
*-login: Fix non-global ssl=no configuration

For example local 127.0.0.2 { ssl=no } wasn't working.

7 years agodict-file: If write failed, file was left locked
Timo Sirainen [Thu, 28 Jun 2018 08:51:22 +0000 (11:51 +0300)] 
dict-file: If write failed, file was left locked

7 years agodict-file: Fix memory leak when file is recreated during lock wait
Timo Sirainen [Thu, 28 Jun 2018 08:50:36 +0000 (11:50 +0300)] 
dict-file: Fix memory leak when file is recreated during lock wait

7 years agolda: Deinitialize cleanly if user doesn't exist in userdb
Timo Sirainen [Wed, 27 Jun 2018 15:28:23 +0000 (18:28 +0300)] 
lda: Deinitialize cleanly if user doesn't exist in userdb

7 years agolda: Deinitialize cleanly if mail delivery fails
Timo Sirainen [Wed, 27 Jun 2018 15:24:06 +0000 (18:24 +0300)] 
lda: Deinitialize cleanly if mail delivery fails

7 years agolda: Cleanup - move code to lda_deliver() function
Timo Sirainen [Wed, 27 Jun 2018 15:22:01 +0000 (18:22 +0300)] 
lda: Cleanup - move code to lda_deliver() function

No functional changes.

7 years agolda: Cleanup - reorder code
Timo Sirainen [Wed, 27 Jun 2018 15:17:23 +0000 (18:17 +0300)] 
lda: Cleanup - reorder code

Makes the next commit cleaner.

7 years agolib-storage: Fix memory leak in mail_storage_set_internal_error()
Timo Sirainen [Wed, 27 Jun 2018 10:22:03 +0000 (13:22 +0300)] 
lib-storage: Fix memory leak in mail_storage_set_internal_error()

7 years agolib: Fix memory leak at deinit if log_core_filter is set
Timo Sirainen [Tue, 19 Jun 2018 14:42:55 +0000 (17:42 +0300)] 
lib: Fix memory leak at deinit if log_core_filter is set

7 years agodoveadm dump: Fix dumping "vsize" header in dovecot.index
Timo Sirainen [Wed, 13 Jun 2018 17:09:32 +0000 (20:09 +0300)] 
doveadm dump: Fix dumping "vsize" header in dovecot.index

It was trying to print it as the "vsize" header in dovecot.list.index.
This caused confusing output, as well as potentially accessing memory
out of bounds.

7 years agodoveadm log find: Fix memory leak
Timo Sirainen [Wed, 13 Jun 2018 17:08:08 +0000 (20:08 +0300)] 
doveadm log find: Fix memory leak

7 years agodoveadm user: Fix memory leak
Timo Sirainen [Wed, 13 Jun 2018 17:07:52 +0000 (20:07 +0300)] 
doveadm user: Fix memory leak

7 years agodsync: Fix memory leak - unreference iostreams at deinit
Timo Sirainen [Wed, 13 Jun 2018 17:07:28 +0000 (20:07 +0300)] 
dsync: Fix memory leak - unreference iostreams at deinit

Only some of the code paths need unreferencing, so also add a reference to
the other code paths.

7 years agodsync: ibc - reference iostreams internally
Timo Sirainen [Wed, 13 Jun 2018 17:06:11 +0000 (20:06 +0300)] 
dsync: ibc - reference iostreams internally

This makes it clearer who needs to reference and unreference the streams.

7 years agolib-master: Allow calling master_service_deinit() without _init_finish()
Timo Sirainen [Tue, 12 Jun 2018 21:58:55 +0000 (00:58 +0300)] 
lib-master: Allow calling master_service_deinit() without _init_finish()

7 years agolib: restrict-access: Free chroot_dir at deinit
Timo Sirainen [Tue, 12 Jun 2018 19:05:52 +0000 (22:05 +0300)] 
lib: restrict-access: Free chroot_dir at deinit

7 years agolib: Free global_event_stack array at deinit
Timo Sirainen [Tue, 12 Jun 2018 19:05:35 +0000 (22:05 +0300)] 
lib: Free global_event_stack array at deinit

7 years agovirtual: Fix memory leak when selecting mailboxes with '-' or /metadata
Timo Sirainen [Tue, 12 Jun 2018 15:01:21 +0000 (18:01 +0300)] 
virtual: Fix memory leak when selecting mailboxes with '-' or /metadata

7 years agomail-crypt-acl: Fix memory leak when updating ACLs
Timo Sirainen [Tue, 12 Jun 2018 14:23:35 +0000 (17:23 +0300)] 
mail-crypt-acl: Fix memory leak when updating ACLs

7 years agolib-dcrypt, mail-crypt: Fix leaking memory when using non-global keys
Timo Sirainen [Tue, 12 Jun 2018 14:08:04 +0000 (17:08 +0300)] 
lib-dcrypt, mail-crypt: Fix leaking memory when using non-global keys

The users' private keys had one reference too much. Because of key cache,
most likely the keys were leaked only once at deinit.

Changed the i_stream_create_decrypt_callback() API so that it allows the
callback to create the key itself without having to store it anywhere.

In this case the key was already added to cache, which increased its
refcount. So an alternative fix would have been to simply unreferenced the
key before returning it. It's a bit ugly though to rely on such caches,
since without the cache the code would be buggy.

7 years agomail-crypt: Fix memory leak in "doveadm mailbox cryptokey generate"
Timo Sirainen [Tue, 12 Jun 2018 13:56:51 +0000 (16:56 +0300)] 
mail-crypt: Fix memory leak in "doveadm mailbox cryptokey generate"

7 years agolib-smtp: server: Fix memory leak when handling BDAT command
Timo Sirainen [Tue, 12 Jun 2018 13:49:36 +0000 (16:49 +0300)] 
lib-smtp: server: Fix memory leak when handling BDAT command

7 years agoimapc: Fix leaking memory when sending imapc commands after authentication failure
Timo Sirainen [Tue, 12 Jun 2018 13:45:26 +0000 (16:45 +0300)] 
imapc: Fix leaking memory when sending imapc commands after authentication failure

7 years agolib: test-strfuncs - Rename test i_strbegins to str_begins
Aki Tuomi [Mon, 6 Aug 2018 08:34:35 +0000 (11:34 +0300)] 
lib: test-strfuncs - Rename test i_strbegins to str_begins

Matches the real name

7 years agodoveconf: Fix compiler nit
Aki Tuomi [Mon, 6 Aug 2018 08:36:41 +0000 (11:36 +0300)] 
doveconf: Fix compiler nit

Ensure secret_r cannot be NULL unless none was found.

7 years agodoveconf: Improve secret hiding
Aki Tuomi [Tue, 14 Aug 2018 12:25:40 +0000 (15:25 +0300)] 
doveconf: Improve secret hiding

Hide with more wide filtering.

7 years agodoveconf: Use key_ends_with to compare suffixes
Aki Tuomi [Tue, 14 Aug 2018 12:24:56 +0000 (15:24 +0300)] 
doveconf: Use key_ends_with to compare suffixes

Fixes key hiding.

Broken in 1518e085

7 years agodoveconf: Do not skip over secrets when hiding them
Aki Tuomi [Wed, 1 Aug 2018 05:47:34 +0000 (08:47 +0300)] 
doveconf: Do not skip over secrets when hiding them

All candidates for hiding need to be considered, otherwise
it might skip over some of them and leave them unhidden.

7 years agodoveconf: Hide URL userpart
Aki Tuomi [Wed, 30 May 2018 11:10:41 +0000 (14:10 +0300)] 
doveconf: Hide URL userpart

7 years agodoveconf: Add find_next_secret
Aki Tuomi [Tue, 19 Jun 2018 11:26:29 +0000 (14:26 +0300)] 
doveconf: Add find_next_secret

Find start of possible next secret, and return
what the found secret was. Makes next commit easier.