]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
Timo Sirainen [Sun, 9 Apr 2017 12:31:11 +0000 (15:31 +0300)]
auth: Shuffle failed auth requests before sending the failure replies.
This might be helpful against some timing attacks.
Using Fisher–Yates shuffle.
Timo Sirainen [Sun, 9 Apr 2017 12:19:25 +0000 (15:19 +0300)]
doveadm: Make doveadm_password safe against timing attacks.
Timo Sirainen [Sat, 8 Apr 2017 21:50:15 +0000 (00:50 +0300)]
auth: Make plaintext password comparisons safe against timing attacks
Timo Sirainen [Sat, 8 Apr 2017 21:49:37 +0000 (00:49 +0300)]
lib: Add mem_equals_timing_safe()
Aki Tuomi [Mon, 10 Apr 2017 17:53:29 +0000 (20:53 +0300)]
fts: Initialize fts after namespaces have been added
This way paths are correctly set, and fts indexes are
written to correct place. This affects mbox with lucene.
Fixes Panic: file mailbox-list.c: line 1158 (mailbox_list_try_mkdir_root): assertion failed (strncmp(root_dir, path, strlen(root_dir)) == 0)
Aki Tuomi [Tue, 11 Apr 2017 12:05:53 +0000 (15:05 +0300)]
fts: Remove indentation from fts_mailbox_list_created
Preparation for next commit
Timo Sirainen [Tue, 11 Apr 2017 11:55:04 +0000 (14:55 +0300)]
Makefile: Fix make distcheck when using scan-build
The _build directory shouldn't be deleted afterwards or it'll just fail.
Timo Sirainen [Tue, 11 Apr 2017 08:23:17 +0000 (11:23 +0300)]
Improve valgrind suppressions.
Timo Sirainen [Mon, 10 Apr 2017 15:12:47 +0000 (18:12 +0300)]
lib-imap-client: Fixes to unit test
Timo Sirainen [Mon, 10 Apr 2017 14:10:21 +0000 (17:10 +0300)]
lib-imap-client: Add unit test
Initially this tests some connection and reconnection problems.
Timo Sirainen [Mon, 10 Apr 2017 14:09:29 +0000 (17:09 +0300)]
lib-imap-client: Include "ms" in reconnect warning message
Timo Sirainen [Mon, 10 Apr 2017 14:07:28 +0000 (17:07 +0300)]
lib-imap-client: Fix reconnection
There was already code for reconnection. We just shouldn't have gone very
far in imapc_connection_connect() if we were still waiting for reconnection
delay to pass.
Timo Sirainen [Mon, 10 Apr 2017 14:06:34 +0000 (17:06 +0300)]
lib-imap-client: Remove hardcoded IMAPC_CONNECT_RETRY_WAIT_MSECS
We have a setting for it now.
Timo Sirainen [Mon, 10 Apr 2017 13:44:52 +0000 (16:44 +0300)]
lib-imap-client: Disconnection during LOGIN should still have state=disconnected
It's not an authentication failure, which would imply that the user or
password was wrong.
Timo Sirainen [Mon, 10 Apr 2017 13:18:46 +0000 (16:18 +0300)]
lib-imap-client: Make command tag counter externally accessible
This allows unit tests to reset it.
Timo Sirainen [Mon, 10 Apr 2017 12:49:24 +0000 (15:49 +0300)]
lib-imap-client: Call the public login callback exactly once.
Previously it was also called only once, as long as there were only a single
imap connection. (The current imapc code wouldn't create more than one
connection.) It was a bit confusing what the expectation was, so now the
callback is never called more than once.
Timo Sirainen [Mon, 10 Apr 2017 11:14:40 +0000 (14:14 +0300)]
lib-imap-client: imapc_client_deinit() didn't set client=NULL
Timo Sirainen [Mon, 10 Apr 2017 10:49:33 +0000 (13:49 +0300)]
imapc: Change imapc_connection_retry_interval setting to be in milliseconds.
Timo Sirainen [Mon, 10 Apr 2017 10:50:40 +0000 (13:50 +0300)]
imapc: Change imapc_connection_retry_interval default to be 1 second.
10 secs at least is too high. Usually the connection problem is very
intermittent and even an immediate reconnection would succeed.
Timo Sirainen [Mon, 10 Apr 2017 10:48:23 +0000 (13:48 +0300)]
lib-imap-client: Change connect_retry_interval_secs to _msecs
This allows caller to provide better precision.
Timo Sirainen [Mon, 10 Apr 2017 10:46:03 +0000 (13:46 +0300)]
lib-imap-client: Use struct timeval for tracking last_connect time.
This provides better accuracy when calculating how much time there's left
until reconnection.
Timo Sirainen [Mon, 10 Apr 2017 10:02:17 +0000 (13:02 +0300)]
lib-http: Improve request stats text.
It's important to know how long the request was in queue before it was sent.
Also the "n attempts in m secs" makes more sense if it was counting only the
time after the initial request was sent, not including the queuing time.
If there is more than 1 attempt, log separately how long all the attempts
were waited on vs. how long the last attempt took.
Timo Sirainen [Mon, 10 Apr 2017 09:59:08 +0000 (12:59 +0300)]
lib-http: Add http_client_request_stats.first_sent_msecs
Also rename sent_msecs to last_sent_msecs.
Timo Sirainen [Mon, 10 Apr 2017 09:53:43 +0000 (12:53 +0300)]
lib-http: Track request's first and last send attempt times separately.
Timo Sirainen [Mon, 10 Apr 2017 08:51:51 +0000 (11:51 +0300)]
lib-program-client unit test: Let OS assign the listener port
Timo Sirainen [Wed, 5 Apr 2017 09:36:32 +0000 (12:36 +0300)]
*-login: Move code to login_anvil_init()
Calling this allows plugins that need to talk to anvil make sure they have
an anvil connection even if mail_max_userip_connections=0.
Timo Sirainen [Wed, 5 Apr 2017 09:52:14 +0000 (12:52 +0300)]
doveadm who: Don't aggregate empty usernames with different IPs
We'll assume that in that case anvil is used to track IP addresses rather
than usernames. (Dovecot core doesn't currently use this.)
Timo Sirainen [Fri, 7 Apr 2017 06:28:55 +0000 (09:28 +0300)]
lib-http: Remove unnecessary enum declaration.
Most of these were removed by
a8fe899601735459641edae975c0fa08be8482e2
Timo Sirainen [Wed, 5 Apr 2017 11:14:57 +0000 (14:14 +0300)]
example-config: Add blocking setting to dovecot-ldap.conf.ext
Timo Sirainen [Sat, 8 Apr 2017 06:58:57 +0000 (09:58 +0300)]
auth-var-expand-crypt plugin: Add missing ldflags
Timo Sirainen [Sun, 9 Apr 2017 12:48:59 +0000 (15:48 +0300)]
fts-solr: Don't double-escape headers.
Timo Sirainen [Fri, 7 Apr 2017 13:27:12 +0000 (16:27 +0300)]
auth: Fix crash in passdb imap on connection failures
Timo Sirainen [Fri, 7 Apr 2017 13:13:13 +0000 (16:13 +0300)]
lib-ssl-iostream: Don't require SSL CA certs if allow_invalid_cert=TRUE
This happened only when verify_remote_cert was also TRUE. But this behavior
now allows verifying the cert without actually requiring it to be valid.
Timo Sirainen [Fri, 7 Apr 2017 12:47:27 +0000 (15:47 +0300)]
auth: passdb imap: Use ssl_client_ca_* settings.
The args = ssl_ca_dir=.. setting still overrides the ssl_client_ca_dir.
Timo Sirainen [Fri, 7 Apr 2017 06:34:39 +0000 (09:34 +0300)]
global: Remove extra ';' to fix compiler errors
Sun C doesn't like them.
Timo Sirainen [Fri, 7 Apr 2017 06:32:30 +0000 (09:32 +0300)]
global: Make sure all files end with newline
Fixes compiler warnings with Sun C.
Timo Sirainen [Fri, 7 Apr 2017 07:55:40 +0000 (10:55 +0300)]
fs-posix: Fix FS_METADATA_WRITE_FNAME to preserve the path
It should only change the filename.
Timo Sirainen [Fri, 7 Apr 2017 09:45:49 +0000 (12:45 +0300)]
doveadm force-resync: Skip autocreated mailboxes that don't exist yet.
Since they don't exist, there's nothing to resync in them either.
This avoids unnecessarily creating them.
Timo Sirainen [Fri, 7 Apr 2017 09:42:12 +0000 (12:42 +0300)]
dict-sql: Fix setting $variables to iteration key when map had multiple values
Timo Sirainen [Fri, 7 Apr 2017 06:14:27 +0000 (09:14 +0300)]
lib: Redefine NULL only if HAVE_TYPE_CHECKS is set
Timo Sirainen [Fri, 7 Apr 2017 06:11:53 +0000 (09:11 +0300)]
lib: Add a common HAVE_TYPE_CHECKS
I'm not sure if it should be checking gcc >= 3.0 or 3.3, but they're
all old so doesn't really matter.
The __cplusplus check was added to both, since it wouldn't have done
anything anyway as COMPILE_ERROR_IF_TRUE() is 0 for __cplusplus.
Timo Sirainen [Wed, 5 Apr 2017 12:59:51 +0000 (15:59 +0300)]
*-login: Minor logging cleanup if client is disconnected before sending banner.
Avoid unnecessarily adding "(no auth attempts in 0 secs)" when the reason
string already makes it clear that the user didn't even have a chance to
authenticate.
This kind of disconnection currently happens only with some plugins.
Timo Sirainen [Thu, 6 Apr 2017 17:43:20 +0000 (20:43 +0300)]
example-config: Add connect/read/write_timeout to mysql connect settings
Timo Sirainen [Thu, 6 Apr 2017 17:00:31 +0000 (20:00 +0300)]
imapc: Remove "_sec" suffix from imapc_connection_retry_interval_secs
Its type is SET_TIME, so the value doesn't have to be in seconds.
Aki Tuomi [Thu, 6 Apr 2017 16:49:07 +0000 (19:49 +0300)]
imap-login: Retain client ID only when enabled
Aki Tuomi [Wed, 5 Apr 2017 11:23:47 +0000 (14:23 +0300)]
lib-storage: Set internal error in imapc_list_get_hierarchy_sep
Aki Tuomi [Wed, 5 Apr 2017 11:23:26 +0000 (14:23 +0300)]
imapc: Use IMAPC_COMMAND_STATE_AUTH_FAILED to indicate auth failure
Aki Tuomi [Wed, 5 Apr 2017 11:22:38 +0000 (14:22 +0300)]
lib-imap-client: Do not reset ips when reconnecting
Avoids infinite loop
Aki Tuomi [Wed, 5 Apr 2017 10:27:57 +0000 (13:27 +0300)]
lib-storage: Return empty value in imapc_list_get_storage_name on auth error
Avoids clobbering authentication error.
Aki Tuomi [Wed, 5 Apr 2017 09:48:31 +0000 (12:48 +0300)]
lib-storage: Do not clobber error with imapc
Aki Tuomi [Wed, 5 Apr 2017 09:47:24 +0000 (12:47 +0300)]
global: Fix imapc_client_login usage
Aki Tuomi [Wed, 5 Apr 2017 09:09:57 +0000 (12:09 +0300)]
lib-imap-client: Add login_callback setter
This way it can be set before actually calling login
which might happen some time later.
Dmitry Yakunin [Tue, 4 Apr 2017 20:33:51 +0000 (23:33 +0300)]
imapc: Fix memory leak in disconnected state
Aki Tuomi [Wed, 5 Apr 2017 06:26:54 +0000 (09:26 +0300)]
auth: Update default policy string to include device id and protocol
Timo Sirainen [Tue, 4 Apr 2017 12:59:04 +0000 (15:59 +0300)]
imap: Set command reason strings using the new human_args
This way the reason string is already suitable for logging, since it's
guaranteed to be valid UTF-8 without control chars.
Timo Sirainen [Tue, 4 Apr 2017 12:58:42 +0000 (15:58 +0300)]
imap: Add client_command_context.human_args
Generated with imap_write_args_for_human()
Timo Sirainen [Tue, 4 Apr 2017 12:58:15 +0000 (15:58 +0300)]
lib-imap: Add imap_write_args_for_human()
Timo Sirainen [Tue, 4 Apr 2017 12:38:00 +0000 (15:38 +0300)]
imap: Add imap_client_command_get_reason()
All the command -> reason string conversions now go through this function.
Timo Sirainen [Tue, 4 Apr 2017 10:28:44 +0000 (13:28 +0300)]
lib: Increase net_connect*() EADDRNOTAVAIL retries to 20
4 is too little, since on busy systems it's sometimes failing. These calls
should be pretty cheap, so lets try if 20 is enough.
It would be nice if this was configurable, but the only practical way right
now would be to use environment variable, which is a bit ugly. We could
try it next if 20 is still not enough.
Martti Rannanjärvi [Tue, 4 Apr 2017 04:42:48 +0000 (07:42 +0300)]
config: Warn that director_consistent_hashing is obsolete
Timo Sirainen [Mon, 3 Apr 2017 15:44:52 +0000 (18:44 +0300)]
imapc: Compiler warning fix for 32bit systems
Martti Rannanjärvi [Mon, 3 Apr 2017 11:30:13 +0000 (14:30 +0300)]
director: Make director_consistent_hashing=yes mandatory
Aki Tuomi [Fri, 31 Mar 2017 07:57:14 +0000 (10:57 +0300)]
lib-imap-client: Make authentication failures more consistent
This way they always say the same prefix, which is easier to
spot.
Aki Tuomi [Fri, 31 Mar 2017 07:49:50 +0000 (10:49 +0300)]
lib-imap-client: Call login_callback on all authentication failures
Aki Tuomi [Fri, 31 Mar 2017 07:12:58 +0000 (10:12 +0300)]
lib-imap-client: Fix reconnection
This patch fixes reconnections to actually consider
all IP addresses first and then delay for interval and
retry at most retry count times.
Aki Tuomi [Fri, 31 Mar 2017 08:01:15 +0000 (11:01 +0300)]
lib-imap-client: Remove io earlier to avoid hammering
If connection has failed and reconnection is not yet
possible, io has to be removed here, otherwise it will
keep hammering the callback.
Aki Tuomi [Fri, 31 Mar 2017 07:58:47 +0000 (10:58 +0300)]
lib-imap-client: Only LOGOUT from connected connections
Aki Tuomi [Fri, 31 Mar 2017 06:44:28 +0000 (09:44 +0300)]
lib-imap-client: Make retry count and interval configurable
Aki Tuomi [Fri, 31 Mar 2017 06:59:02 +0000 (09:59 +0300)]
lib-imap-client: Add imapc_client_try_stop
Aki Tuomi [Thu, 30 Mar 2017 13:09:06 +0000 (16:09 +0300)]
lib-sasl: Add missing input handler for xoauth2
Timo Sirainen [Mon, 3 Apr 2017 09:40:51 +0000 (12:40 +0300)]
director: Fix mail_hosts_dup() to duplicate tags correctly.
The host->tag pointed to the old hosts list. Also the new hosts list's tags
array wasn't filled.
This fixes USER-LOOKUP to return host with default configuration, which fixes
doveadm director status <user> to not show "Initial config" as empty.
Martti Rannanjärvi [Mon, 3 Apr 2017 08:41:29 +0000 (11:41 +0300)]
doveadm: Call mailbox_set_reason with initialized mailbox
Timo Sirainen [Sat, 1 Apr 2017 19:12:37 +0000 (22:12 +0300)]
global: Add mailbox_transaction_set_reason() calls
Added to the most important places.
Timo Sirainen [Sat, 1 Apr 2017 18:54:30 +0000 (21:54 +0300)]
lib-storage: Add mailbox_transaction_set_reason()
Timo Sirainen [Sat, 1 Apr 2017 18:43:16 +0000 (21:43 +0300)]
global: Add mailbox_set_reason() calls
Added to the most important places.
Timo Sirainen [Sat, 1 Apr 2017 18:16:37 +0000 (21:16 +0300)]
lib-storage: Add mailbox_set_reason()
Use it to log a debug message when mailbox is being opened.
Timo Sirainen [Mon, 27 Mar 2017 15:05:29 +0000 (18:05 +0300)]
lib-index: Don't increase modseq for backend/dirty flag changes
These flags are used only for internal changes and they shouldn't be
triggering any modseq changes.
To avoid modseqs from unexpectedly shrinking, the new modseq counting
behavior is enabled only for newly rotated transaction log files that have
a new minor_version.
Timo Sirainen [Thu, 30 Mar 2017 17:38:44 +0000 (20:38 +0300)]
lib-index: Add macros to check if transaction log file version is new enough.
The version numbers are 8bit, so we can generate a single 16bit number out
of them.
Stephan Bosch [Tue, 28 Mar 2017 23:25:21 +0000 (01:25 +0200)]
lib-http: client: Implemented means to obtain request statistics.
Aki Tuomi [Fri, 31 Mar 2017 20:12:47 +0000 (23:12 +0300)]
lib: Fix strcasecmp mistake in var-expand
Timo Sirainen [Fri, 31 Mar 2017 13:42:55 +0000 (16:42 +0300)]
lmtp: Die at startup if config reading fails.
Although most of the time it's not strictly required for config to be read here,
one exception is SSL server settings. If this config reading fails, the SSL
initialization just crashes. So this gives a better error message than a crash.
Also config reading really isn't supposed to fail anyway.
Timo Sirainen [Thu, 30 Mar 2017 20:25:40 +0000 (23:25 +0300)]
lib-index: Assert in mail_index_append_finish_uids() to prevent UID wrapping
This should be handled better eventually, but it's better to crash earlier
now than later. This avoids a later assert:
Panic: file mail-index-transaction-finish.c: line 187 (mail_index_transaction_get_uid): assertion failed: (rec->uid != 0)
Timo Sirainen [Fri, 31 Mar 2017 09:28:56 +0000 (12:28 +0300)]
lib-fs: Add FS_METADATA_ORIG_PATH
This allows fs backends to keep track of the original filename and use it
for logging purposes and such.
Timo Sirainen [Fri, 31 Mar 2017 09:28:01 +0000 (12:28 +0300)]
lib-fs: Allow fs_set_metadata() to update already added metadata.
Previously we were just appending the metadata multiple times with different
values, which could have caused problems.
Timo Sirainen [Thu, 30 Mar 2017 13:43:58 +0000 (16:43 +0300)]
quota, acl: Use mail_user_plugin_getenv_bool() for boolean settings
These were forgotten earlier.
Timo Sirainen [Thu, 30 Mar 2017 22:02:49 +0000 (01:02 +0300)]
imap: Fix assert-crash when hibernation triggers during IDLE syncing
Fixes:
Panic: file cmd-idle.c: line 182 (idle_hibernate_timeout): assertion failed: (ctx->sync_ctx == NULL)
Timo Sirainen [Thu, 30 Mar 2017 20:46:02 +0000 (23:46 +0300)]
lib-http: http_client_request_delay_from_response() should use per-request timeout as max
It was using the global request_timeout_msecs for the maximum timeout,
which could be different from the per-request timeout set by
http_client_request_set_attempt_timeout_msecs().
Stephan Bosch [Thu, 30 Mar 2017 20:29:13 +0000 (22:29 +0200)]
lib-http: client: Fixed request-specific attempt timeout.
This is the timeout applied to a single request attempt. Using http_client_request_set_attempt_timeout_msecs() this can be set for a specific request.
However, this was mostly ignored for requests that weren't in the process of handling response payload.
Instead, the global request_timeout_msecs client setting was used.
Also amended the (currently manual) test suite with tests that demonstated the problem and now verify the fix.
Timo Sirainen [Tue, 28 Mar 2017 16:40:27 +0000 (19:40 +0300)]
lib-index: Use time_to_local_day_start() instead of reimplementing
Timo Sirainen [Tue, 28 Mar 2017 16:14:00 +0000 (19:14 +0300)]
lib: Add time_to_local_day_start()
Timo Sirainen [Mon, 27 Mar 2017 14:44:45 +0000 (17:44 +0300)]
lib-index: Code cleanup - expand LOG_WANT_ROTATE() macro
There was no reason it had to be a macro. Also this fixes off-by-one
error when checking for log_rotate_min_size.
Aki Tuomi [Mon, 27 Mar 2017 07:33:42 +0000 (10:33 +0300)]
var-expand-crypt-plugin: Add test suite
Aki Tuomi [Mon, 27 Mar 2017 08:02:31 +0000 (11:02 +0300)]
var-expand-crypt: Fix data decryption
Aki Tuomi [Mon, 27 Mar 2017 06:39:03 +0000 (09:39 +0300)]
var-expand-crypt: Add error handling for initialization
Aki Tuomi [Mon, 27 Mar 2017 06:34:50 +0000 (09:34 +0300)]
var-expand-crypt: Do not free dcrypt context twice
Found by coverity
Aki Tuomi [Fri, 17 Mar 2017 08:28:36 +0000 (10:28 +0200)]
test: lib-http: Check write_full return value in test
Makes static analyzers happier
Aki Tuomi [Fri, 17 Mar 2017 08:26:50 +0000 (10:26 +0200)]
test: fts-squat: Ignore gettimeofday return value in test
Makes static analyzers happier
Aki Tuomi [Fri, 17 Mar 2017 08:26:06 +0000 (10:26 +0200)]
test: lib-index: Ensure conficts_seqs is created in test
Makes static analyzers happier
Aki Tuomi [Fri, 17 Mar 2017 08:25:01 +0000 (10:25 +0200)]
test: lib: Ensure item is not null
Makes static analyzers happier
Aki Tuomi [Fri, 17 Mar 2017 08:23:42 +0000 (10:23 +0200)]
test: lib-program-client: Use i_close_fd instead of close