]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
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.

7 years agoconfig: Fix crash in doveconf -n when hiding sensitive information
Aki Tuomi [Wed, 9 May 2018 07:19:02 +0000 (10:19 +0300)] 
config: Fix crash in doveconf -n when hiding sensitive information

Broken by fc02343f

7 years agolib: Add str_append_escaped and use it with str_escape
Aki Tuomi [Wed, 9 May 2018 07:18:39 +0000 (10:18 +0300)] 
lib: Add str_append_escaped and use it with str_escape

7 years agodoveconf: Fix infinite loop when hiding sensitive information
Timo Sirainen [Thu, 12 Apr 2018 13:07:31 +0000 (16:07 +0300)] 
doveconf: Fix infinite loop when hiding sensitive information

For example with "nopassword=y". Broken in
fc02343fd81a6fab272ac0366b15fc60ec44a8b6

7 years agoconfig: Hide more sensitive information
Aki Tuomi [Mon, 12 Mar 2018 07:11:53 +0000 (09:11 +0200)] 
config: Hide more sensitive information

Hide parts of values where we can see a key that has word
key, secret or pass as prefix and is a key-value pair
separated by =.

7 years agoconfig: Move sensitive value hiding to own function
Aki Tuomi [Mon, 12 Mar 2018 07:11:14 +0000 (09:11 +0200)] 
config: Move sensitive value hiding to own function

Simplifies next change

7 years agolib: Add str_nescape
Aki Tuomi [Sat, 10 Mar 2018 16:20:32 +0000 (18:20 +0200)] 
lib: Add str_nescape

For partial escaping

7 years agolib: Add i_strstr_arr for searching string for multiple needles
Aki Tuomi [Sat, 10 Mar 2018 15:56:33 +0000 (17:56 +0200)] 
lib: Add i_strstr_arr for searching string for multiple needles

7 years agoman: doveconf - Document -P flag
Aki Tuomi [Fri, 9 Mar 2018 15:09:28 +0000 (17:09 +0200)] 
man: doveconf - Document -P flag

7 years agoimap: Fix assert-crash when client is disconnected during a long COPY/MOVE
Timo Sirainen [Mon, 28 May 2018 07:32:21 +0000 (10:32 +0300)] 
imap: Fix assert-crash when client is disconnected during a long COPY/MOVE

Similar fix than 481992bfe2740bdec70fcd7366dea50ed9128966

Fixes:
Panic: file cmd-copy.c: line 50 (fetch_and_copy): assertion failed: (o_stream_is_corked(client->output))

7 years agolib/data-stack - in panic scenarios, use the panic memory buffer
Phil Carmody [Thu, 14 Dec 2017 22:44:51 +0000 (00:44 +0200)] 
lib/data-stack  - in panic scenarios, use the panic memory buffer

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agolib/datastack - remove useless thing
Phil Carmody [Thu, 14 Dec 2017 22:35:39 +0000 (00:35 +0200)] 
lib/datastack - remove useless thing

It was useless.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agolib-storage: Deduplicate headers in struct mailbox_header_lookup_ctx
Timo Sirainen [Thu, 21 Jul 2016 14:32:52 +0000 (08:32 -0600)] 
lib-storage: Deduplicate headers in struct mailbox_header_lookup_ctx

This might slightly improve performance.

7 years agoman: Add missing commands to doveadm
Michael M Slusarz [Tue, 31 Jul 2018 23:40:08 +0000 (17:40 -0600)] 
man: Add missing commands to doveadm

7 years agoglobal: Start relying on event_set_forced_debug(e, FALSE) being a no-op
Josef 'Jeff' Sipek [Sat, 30 Jun 2018 14:13:10 +0000 (10:13 -0400)] 
global: Start relying on event_set_forced_debug(e, FALSE) being a no-op

Converted using the following semantic patch:

@@
expression event;
expression cond;
@@

- if (cond) {
-  event_set_forced_debug(event,
(
- TRUE
|
- cond
)
- );
- }
+ event_set_forced_debug(event, cond);

7 years agolib: Change event_set_forced_debug(e, FALSE) to be a no-op
Josef 'Jeff' Sipek [Sat, 30 Jun 2018 14:08:27 +0000 (10:08 -0400)] 
lib: Change event_set_forced_debug(e, FALSE) to be a no-op

7 years agolib: Add event_unset_forced_debug()
Josef 'Jeff' Sipek [Sat, 30 Jun 2018 14:06:04 +0000 (10:06 -0400)] 
lib: Add event_unset_forced_debug()

7 years agolib-storage: Initialize reset_id in index_index_copy_cache
Timo Sirainen [Wed, 27 Jun 2018 14:16:24 +0000 (17:16 +0300)] 
lib-storage: Initialize reset_id in index_index_copy_cache

Makes valgrind happy with clang's optimizations.

7 years agolmtp, submission: Remove extra spaces from "state = X" in disconnect log line
Timo Sirainen [Wed, 20 Jun 2018 07:49:46 +0000 (10:49 +0300)] 
lmtp, submission: Remove extra spaces from "state = X" in disconnect log line

Other Dovecot log messages don't have spaces in key=value.

7 years agodoveadm-dict: Initialize set variable in cmd_dict_init
Aki Tuomi [Mon, 11 Jun 2018 11:22:38 +0000 (14:22 +0300)] 
doveadm-dict: Initialize set variable in cmd_dict_init

Makes valgrind happy with clang's optimizations