]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
4 years agolib-mail: Fix istream-header-filter snapshotting
Timo Sirainen [Thu, 27 May 2021 16:34:50 +0000 (19:34 +0300)] 
lib-mail: Fix istream-header-filter snapshotting

4 years agolib: Add istream_snapshot.free() to allow more complex snapshots
Timo Sirainen [Thu, 17 Jun 2021 16:55:56 +0000 (19:55 +0300)] 
lib: Add istream_snapshot.free() to allow more complex snapshots

4 years agolib-storage: Make use of MAIL_INDEX_VIEW_SYNC_FLAG_2ND_INDEX
Markus Valentin [Tue, 15 Jun 2021 10:21:22 +0000 (12:21 +0200)] 
lib-storage: Make use of MAIL_INDEX_VIEW_SYNC_FLAG_2ND_INDEX

4 years agolib-index: Introduce MAIL_INDEX_VIEW_SYNC_FLAG_2ND_INDEX
Markus Valentin [Tue, 15 Jun 2021 10:19:00 +0000 (12:19 +0200)] 
lib-index: Introduce MAIL_INDEX_VIEW_SYNC_FLAG_2ND_INDEX

This flag is used to make sure secondary views flags-index can work
properly without emitting warnings about inconsistency. If an
inconsistency is encountered fix it by fully syncing.

4 years agoRevert "lib-storage: Always fix inconsistency when syncing private flags index"
Markus Valentin [Tue, 15 Jun 2021 06:59:17 +0000 (08:59 +0200)] 
Revert "lib-storage: Always fix inconsistency when syncing private flags index"

This reverts commit 986d9cbbecffd836d977b6ad956b04e3ca606677.

This is reverted because storing flags on private indexes no longer send
untagged replies.

4 years agoacl: Ignore acls in acl_lookup_dict_rebuild_add_backend if ignore_acls is set
Markus Valentin [Thu, 1 Jul 2021 08:46:05 +0000 (10:46 +0200)] 
acl: Ignore acls in acl_lookup_dict_rebuild_add_backend if ignore_acls is set

In case an namespace has been configured to ignore ACLs also respect
that when acl_lookup_dict_rebuild is called.

Co-Authored-By: Vincent Brillault <vincent.brillault@cern.ch>
4 years agolib-smtp: test-smtp-payload - Set all timeouts to CLIENT_PROGRESS_TIMEOUT.
Stephan Bosch [Tue, 1 Jun 2021 22:40:19 +0000 (00:40 +0200)] 
lib-smtp: test-smtp-payload - Set all timeouts to CLIENT_PROGRESS_TIMEOUT.

This prevents connect and idle timeouts from triggering earlier than the
progress timeout.

4 years agoimap: PREVIEW responses need trailing space
Michael M Slusarz [Tue, 22 Jun 2021 17:52:02 +0000 (11:52 -0600)] 
imap: PREVIEW responses need trailing space

2.3.15 regression

Before 2.3.15, there was this same buggy behavior in error cases; 2.3.15
moved that buggy behavior to the success code path

DOP-2463

4 years agodoveadm-server: Add log prefix to logs written to client
Timo Sirainen [Mon, 14 Jun 2021 20:46:48 +0000 (23:46 +0300)] 
doveadm-server: Add log prefix to logs written to client

4 years agodoveadm-server: Simplify writing log output to client
Timo Sirainen [Mon, 14 Jun 2021 20:43:11 +0000 (23:43 +0300)] 
doveadm-server: Simplify writing log output to client

4 years agolib: Fix log prefix in internal handler when log handler has been overridden
Timo Sirainen [Mon, 14 Jun 2021 18:14:13 +0000 (20:14 +0200)] 
lib: Fix log prefix in internal handler when log handler has been overridden

Adds back mail_log_prefix to doveadm mail commands when doveadm-server was
accessed via TCP.

Originally broken by c9dd53f7180a78668cbc1e6eb34d5b1722beccb9

4 years agodict-file: Make sure home_dir doesn't change during operations
Siavash Tavakoli [Fri, 4 Jun 2021 22:00:21 +0000 (23:00 +0100)] 
dict-file: Make sure home_dir doesn't change during operations

file_dict is initialized for a specific user. Keep record of the user's
home_dir and check for all dict operations that the user did not change.

4 years agoglobal: Remove dict_settings.home_dir
Siavash Tavakoli [Wed, 2 Jun 2021 15:17:22 +0000 (16:17 +0100)] 
global: Remove dict_settings.home_dir

Allows dict to be shared across users. Dict operations use
dict_op_settings.home_dir if set.

4 years agodict: Split protocol command arguments in dict_command_input()
Siavash Tavakoli [Wed, 26 May 2021 14:18:20 +0000 (15:18 +0100)] 
dict: Split protocol command arguments in dict_command_input()

Instead of duplicating code and splitting in each command functions
separately.

4 years agolib-dict: Make sure username is valid as well when checking key prefix
Siavash Tavakoli [Wed, 26 May 2021 00:41:51 +0000 (01:41 +0100)] 
lib-dict: Make sure username is valid as well when checking key prefix

If this is a private key, username must be non-empty.

4 years agodict: Remove dict_connection.username and dict_settings.username
Siavash Tavakoli [Mon, 24 May 2021 11:54:58 +0000 (12:54 +0100)] 
dict: Remove dict_connection.username and dict_settings.username

- dict should be user agnostic. dict operations have username.
- same for dict connection
- also removes username from dict process' log prefix

4 years agodict: Add username field for command events
Siavash Tavakoli [Thu, 3 Jun 2021 18:59:23 +0000 (19:59 +0100)] 
dict: Add username field for command events

To prepare for connection username removal in next commit. Instead of
adding username field for the parent event, add it in command events.

Commands can now be run for different users. Having the same username
field as the one used in initialization can be wrong.

4 years agodict-client: Do not send username in initial handshake
Siavash Tavakoli [Mon, 24 May 2021 10:47:15 +0000 (11:47 +0100)] 
dict-client: Do not send username in initial handshake

Dict commands that need username have it included in their arguments now.

4 years agodict-fs: Remove unused fs_dict.username
Siavash Tavakoli [Mon, 24 May 2021 10:58:44 +0000 (11:58 +0100)] 
dict-fs: Remove unused fs_dict.username

4 years agodict-redis: Remove unused redis_dict.username
Siavash Tavakoli [Mon, 24 May 2021 10:58:02 +0000 (11:58 +0100)] 
dict-redis: Remove unused redis_dict.username

4 years agodict-memcached-ascii: Remove unused memcached_ascii_dict.username
Siavash Tavakoli [Mon, 24 May 2021 10:57:18 +0000 (11:57 +0100)] 
dict-memcached-ascii: Remove unused memcached_ascii_dict.username

4 years agodict-sql: Remove unused sql_dict.username
Siavash Tavakoli [Mon, 24 May 2021 10:56:29 +0000 (11:56 +0100)] 
dict-sql: Remove unused sql_dict.username

4 years agodict-ldap: Remove unused ldap_dict.username
Siavash Tavakoli [Mon, 24 May 2021 10:54:56 +0000 (11:54 +0100)] 
dict-ldap: Remove unused ldap_dict.username

4 years agodict: Add dict_event_create
Siavash Tavakoli [Thu, 3 Jun 2021 20:27:31 +0000 (21:27 +0100)] 
dict: Add dict_event_create

Helper function for dict events. If dict_op_settings has username set, adds
it as a field.

4 years agodict-client: Send username in commands
Siavash Tavakoli [Thu, 3 Jun 2021 20:18:03 +0000 (21:18 +0100)] 
dict-client: Send username in commands

Lookup, iterate_begin, and transaction_begin need username. This bumps
dict protocol's major version to 3.

4 years agodict-redis: Use dict_op_settings to get full key
Siavash Tavakoli [Thu, 3 Jun 2021 20:16:22 +0000 (21:16 +0100)] 
dict-redis: Use dict_op_settings to get full key

Switch from dict.username to dict_op_settings.username. Also, ensure
that username is escaped.

4 years agodict-memcached-ascii: Use dict_op_settings to get full key
Siavash Tavakoli [Thu, 3 Jun 2021 20:14:51 +0000 (21:14 +0100)] 
dict-memcached-ascii: Use dict_op_settings to get full key

Switch from dict.username to dict_op_settings.username.

4 years agodict-fs: Use dict_op_settings to get full key
Siavash Tavakoli [Thu, 3 Jun 2021 20:12:27 +0000 (21:12 +0100)] 
dict-fs: Use dict_op_settings to get full key

Switch from dict.username to dict_op_settings.username.

4 years agodict: Use dict_op_settings in backends
Siavash Tavakoli [Thu, 3 Jun 2021 19:58:05 +0000 (20:58 +0100)] 
dict: Use dict_op_settings in backends

- Use dict_op_settings in dict API functions
- forward the settings object to backends for dict lookup/iterate
- Update backends to use dict_op_settings

4 years agonotify-status: Initialize dict_op_settings for dict operations
Siavash Tavakoli [Thu, 3 Jun 2021 17:31:57 +0000 (18:31 +0100)] 
notify-status: Initialize dict_op_settings for dict operations

4 years agolast-login: Initialize dict_op_settings for dict operations
Siavash Tavakoli [Thu, 3 Jun 2021 17:32:50 +0000 (18:32 +0100)] 
last-login: Initialize dict_op_settings for dict operations

4 years agoquota: Initialize dict_op_settings for dict operations
Siavash Tavakoli [Thu, 3 Jun 2021 17:30:17 +0000 (18:30 +0100)] 
quota: Initialize dict_op_settings for dict operations

4 years agodict: Initialize dict_op_settings for dict operations
Siavash Tavakoli [Thu, 3 Jun 2021 18:32:26 +0000 (19:32 +0100)] 
dict: Initialize dict_op_settings for dict operations

4 years agoacl: Initialize dict_op_settings for dict lookup
Siavash Tavakoli [Thu, 3 Jun 2021 17:33:21 +0000 (18:33 +0100)] 
acl: Initialize dict_op_settings for dict lookup

4 years agolib-oauth2: Initialize dict_op_settings for dict operations
Siavash Tavakoli [Thu, 3 Jun 2021 17:34:26 +0000 (18:34 +0100)] 
lib-oauth2: Initialize dict_op_settings for dict operations

4 years agolib-dict: lua: Initialize dict_op_settings for dict operations
Siavash Tavakoli [Thu, 3 Jun 2021 17:41:14 +0000 (18:41 +0100)] 
lib-dict: lua: Initialize dict_op_settings for dict operations

- Add new mandatory argument for lookup, set, and transaction_begin.
- Use the username to initialize dict_op_settings passed to lib-dict API

4 years agolib-dict-extra: test-dict-fs: Initialize dict_op_settings for dict operations
Siavash Tavakoli [Thu, 1 Jul 2021 19:39:41 +0000 (20:39 +0100)] 
lib-dict-extra: test-dict-fs: Initialize dict_op_settings for dict operations

4 years agolib-dict-backend: test-dict-sql: Initialize dict_op_settings for dict operations
Siavash Tavakoli [Thu, 3 Jun 2021 17:39:39 +0000 (18:39 +0100)] 
lib-dict-backend: test-dict-sql: Initialize dict_op_settings for dict operations

4 years agolib-dict: test-dict-client: Initialize dict_op_settings for dict operations
Siavash Tavakoli [Thu, 3 Jun 2021 17:38:50 +0000 (18:38 +0100)] 
lib-dict: test-dict-client: Initialize dict_op_settings for dict operations

4 years agolib-storage: Initialize dict_op_settings for dict operations
Siavash Tavakoli [Thu, 3 Jun 2021 17:36:04 +0000 (18:36 +0100)] 
lib-storage: Initialize dict_op_settings for dict operations

4 years agolib-fs: Initialize dict_op_settings for dict operations
Siavash Tavakoli [Thu, 3 Jun 2021 17:35:28 +0000 (18:35 +0100)] 
lib-fs: Initialize dict_op_settings for dict operations

4 years agoauth: userdb-dict: Initialize dict_op_settings for dict iterate
Siavash Tavakoli [Thu, 3 Jun 2021 17:13:31 +0000 (18:13 +0100)] 
auth: userdb-dict: Initialize dict_op_settings for dict iterate

4 years agoauth: db-dict: Initialize dict_op_settings for dict lookup
Siavash Tavakoli [Thu, 3 Jun 2021 17:11:47 +0000 (18:11 +0100)] 
auth: db-dict: Initialize dict_op_settings for dict lookup

4 years agodoveadm dict: Initialize & use dict_op_settings for dict commands
Siavash Tavakoli [Thu, 3 Jun 2021 11:53:08 +0000 (12:53 +0100)] 
doveadm dict: Initialize & use dict_op_settings for dict commands

Sets the username in cmd_dict_init_full and use the settings struct for dict
operations.

4 years agolib-storage: Add mail_user.dict_op_set and mail_user_get_dict_op_settings()
Siavash Tavakoli [Wed, 2 Jun 2021 23:06:44 +0000 (00:06 +0100)] 
lib-storage: Add mail_user.dict_op_set and mail_user_get_dict_op_settings()

Used to initialize or obtain dict_op_settings for the user.

4 years agolib-storage: mail-user: Clarify mail_user_get_home() usage string
Siavash Tavakoli [Fri, 4 Jun 2021 14:39:05 +0000 (15:39 +0100)] 
lib-storage: mail-user: Clarify mail_user_get_home() usage string

Explicitly comment about returned string lifetime.

4 years agodict: Optionally accept username in lookup/iterate/begin dict protocol commands
Siavash Tavakoli [Tue, 18 May 2021 16:52:55 +0000 (17:52 +0100)] 
dict: Optionally accept username in lookup/iterate/begin dict protocol commands

Only an optional field, don't actually use it.

4 years agodict-file: Remove file_dict_iterate_path struct
Siavash Tavakoli [Fri, 28 May 2021 10:57:39 +0000 (11:57 +0100)] 
dict-file: Remove file_dict_iterate_path struct

No need for the struct since support for multi-path iterate is removed.
So path and path length can be merged with file_dict_iterate_context.

4 years agodict backends: Remove multi-path handling code in dict iteration
Siavash Tavakoli [Wed, 26 May 2021 12:47:50 +0000 (13:47 +0100)] 
dict backends: Remove multi-path handling code in dict iteration

With mutli-path iteration support being dropped from dict protocol, these
can be cleaned up.

4 years agodict: Drop support for multi-path iteration in dict protocol
Siavash Tavakoli [Wed, 26 May 2021 11:15:06 +0000 (12:15 +0100)] 
dict: Drop support for multi-path iteration in dict protocol

Remove dict_iterate_init_multiple() since it is not used anywhere. Also
drop support in dict protocol to read multiple paths.

4 years agolib-dict: Add dict_op_settings_dup() and dict_op_settings_private_free()
Siavash Tavakoli [Tue, 18 May 2021 00:50:03 +0000 (01:50 +0100)] 
lib-dict: Add dict_op_settings_dup() and dict_op_settings_private_free()

- dict_op_settings_dup() creates a copy of dict_op_settings into a new
  struct dict_dop_settings_private.
- dict_op_settings_private_free() frees the memory for copied object.

4 years agolib-dict: Add dict_op_settings parameter for dict_iterate_init()
Siavash Tavakoli [Mon, 3 May 2021 14:09:49 +0000 (15:09 +0100)] 
lib-dict: Add dict_op_settings parameter for dict_iterate_init()

Only adds the parameter, doesn't use it.

4 years agolib-dict: Add dict_op_settings parameter for dict_transaction_begin()
Siavash Tavakoli [Mon, 3 May 2021 14:09:01 +0000 (15:09 +0100)] 
lib-dict: Add dict_op_settings parameter for dict_transaction_begin()

Only adds the parameter, doesn't use it.

4 years agolib-dict: Add dict_op_settings
Siavash Tavakoli [Mon, 3 May 2021 12:42:56 +0000 (13:42 +0100)] 
lib-dict: Add dict_op_settings

Used for dict operations. Currently username & home_dir are used. Also, change
dict_lookup() to accept a parameter of this type but don't actually use it.

4 years agolib-dict: Remove dict_settings.value_type
Siavash Tavakoli [Mon, 3 May 2021 11:15:54 +0000 (12:15 +0100)] 
lib-dict: Remove dict_settings.value_type

It was originally added to dict-db and no other backend uses it. With dict-db
removed, there is no need to keep it.

4 years agodict-client: Escape username and dict uri in handshake HELLO message
Siavash Tavakoli [Wed, 12 May 2021 11:54:30 +0000 (12:54 +0100)] 
dict-client: Escape username and dict uri in handshake HELLO message

4 years agolib-dict-backen: Drop unused dict-db
Siavash Tavakoli [Fri, 30 Apr 2021 13:42:46 +0000 (14:42 +0100)] 
lib-dict-backen: Drop unused dict-db

4 years agovirtual: Expunge old emails if backend box uidvalidity changed
Josef 'Jeff' Sipek [Thu, 24 Jun 2021 16:56:05 +0000 (12:56 -0400)] 
virtual: Expunge old emails if backend box uidvalidity changed

4 years agodoveadm-server: Don't return two error lines if a command fails
Timo Sirainen [Mon, 14 Jun 2021 20:28:48 +0000 (23:28 +0300)] 
doveadm-server: Don't return two error lines if a command fails

This normally didn't affect doveadm client usage, but it did break reply
matching when multiple usernames were handled by a single command (e.g.
wildcard users).

4 years agolib-http: test-http-client-errors - Don't rely on sleeps
Timo Sirainen [Thu, 10 Dec 2020 08:44:42 +0000 (10:44 +0200)] 
lib-http: test-http-client-errors - Don't rely on sleeps

Use the notification signal API instead. Also it's only one test (group)
that needs to do this.

4 years agolib-test: Add notification signal send/wait API
Timo Sirainen [Fri, 18 Jun 2021 11:19:36 +0000 (14:19 +0300)] 
lib-test: Add notification signal send/wait API

This allows a simple way for child/parent processes to communicate when
they're ready. SIGHUP signal is reserved for this.

4 years agodoveadm batch: Fix assert-crash that happened when it was attempted to be used
Timo Sirainen [Thu, 10 Dec 2020 08:54:25 +0000 (10:54 +0200)] 
doveadm batch: Fix assert-crash that happened when it was attempted to be used

Fixes:
Panic: file mail-storage.c: line 1067 (mailbox_set_reason): assertion failed: (reason != NULL)

4 years agolib-fs: metawrap - Fix handling empty file
Markus Valentin [Fri, 25 Jun 2021 12:52:11 +0000 (14:52 +0200)] 
lib-fs: metawrap - Fix handling empty file

As empty files are already closed when fs-metawrap attempts to append
metadata there have been problems with size calculation. Fix this by
relying on the same mechanism as if metadata changed during write.

This recreates metadata and keeps old body. This fixes an issue when
writing empty mails to cache (failed: Cached message size larger than
expected).

This was introduced by 03e102ddccaae9e944c503d4269de755731798e8a

4 years agolib-fs: fs-metawrap - Expect fs_stat to return size 0 for empty file
Markus Valentin [Fri, 25 Jun 2021 12:28:57 +0000 (14:28 +0200)] 
lib-fs: fs-metawrap - Expect fs_stat to return size 0 for empty file

4 years agoNEWS: Updates for v2.3.15
Timo Sirainen [Mon, 14 Jun 2021 09:47:15 +0000 (12:47 +0300)] 
NEWS: Updates for v2.3.15

4 years agoNEWS: Add news for 2.3.14.1
Aki Tuomi [Mon, 24 May 2021 11:03:57 +0000 (14:03 +0300)] 
NEWS: Add news for 2.3.14.1

4 years agolib-smtp: smtp-server-connection - Fix STARTTLS command injection vulnerability.
Stephan Bosch [Fri, 21 May 2021 22:16:38 +0000 (00:16 +0200)] 
lib-smtp: smtp-server-connection - Fix STARTTLS command injection vulnerability.

The input handler kept reading more commands even though the input was locked by
the STARTTLS command, thereby causing it to read the command pipelined beyond
STARTTLS. This causes a STARTTLS command injection vulerability.

4 years agolib-dict-extra: dict-fs - Escape unsafe paths
Aki Tuomi [Tue, 8 Jun 2021 06:13:25 +0000 (09:13 +0300)] 
lib-dict-extra: dict-fs - Escape unsafe paths

Change any path components that are `.` or `..` to `...` and `....`.
Prevents path traversal attacks.

4 years agolib-oauth2: Do not escape '.'
Aki Tuomi [Tue, 8 Jun 2021 06:04:21 +0000 (09:04 +0300)] 
lib-oauth2: Do not escape '.'

This is not really needed and just makes things difficult.

4 years agolib-oauth2: Add missing test_begin/test_end to token escape
Aki Tuomi [Mon, 3 May 2021 06:58:29 +0000 (09:58 +0300)] 
lib-oauth2: Add missing test_begin/test_end to token escape

4 years agolib-oauth2: test-oauth2-jwt - Fix linkage for openssl
Aki Tuomi [Wed, 14 Apr 2021 16:17:30 +0000 (19:17 +0300)] 
lib-oauth2: test-oauth2-jwt - Fix linkage for openssl

Without whole archive option ssl_iostream_unref isn't
included in linkage, which will prevent libdcrypt from
loading openssl backend.

4 years agolib-oauth2: Ensure azp is escaped too
Aki Tuomi [Thu, 19 Nov 2020 17:55:42 +0000 (19:55 +0200)] 
lib-oauth2: Ensure azp is escaped too

4 years agolib-oauth2: Add test for token escape
Aki Tuomi [Wed, 14 Apr 2021 10:47:16 +0000 (13:47 +0300)] 
lib-oauth2: Add test for token escape

4 years agolib-oauth2: Improve identifier escaping function
Aki Tuomi [Wed, 14 Apr 2021 11:12:16 +0000 (14:12 +0300)] 
lib-oauth2: Improve identifier escaping function

4 years agolib-oauth2: Move identifier escaping to own function
Aki Tuomi [Sat, 10 Apr 2021 14:54:45 +0000 (17:54 +0300)] 
lib-oauth2: Move identifier escaping to own function

4 years agolib-storage: Sync mailbox if autoexpunging finds mails that are already expunged
Timo Sirainen [Thu, 25 Mar 2021 13:36:49 +0000 (15:36 +0200)] 
lib-storage: Sync mailbox if autoexpunging finds mails that are already expunged

The syncing should remove the mails from the index.

4 years agolib-storage: Fix infinite loop in autoexpunging if the mails are already expunged
Timo Sirainen [Thu, 25 Mar 2021 13:34:14 +0000 (15:34 +0200)] 
lib-storage: Fix infinite loop in autoexpunging if the mails are already expunged

This happens if the mails exist in the index, but mail_get_save_date()
fails with MAIL_ERROR_EXPUNGED.

4 years agoplugins/fts: Use event logging
Aki Tuomi [Mon, 31 May 2021 11:48:42 +0000 (14:48 +0300)] 
plugins/fts: Use event logging

4 years agoplugins/fts: fts-indexer - Use connection.c functions
Aki Tuomi [Wed, 26 May 2021 10:55:52 +0000 (13:55 +0300)] 
plugins/fts: fts-indexer - Use connection.c functions

4 years agoplugins/fts: fts-indexer - Move fts_indexer_init to end of file
Aki Tuomi [Mon, 31 May 2021 16:31:35 +0000 (19:31 +0300)] 
plugins/fts: fts-indexer - Move fts_indexer_init to end of file

Simplifies next commit

4 years agoplugins/fts: fts-indexer - Use connection structures
Aki Tuomi [Wed, 26 May 2021 10:54:56 +0000 (13:54 +0300)] 
plugins/fts: fts-indexer - Use connection structures

4 years agoindexer: worker - Fix busy/free status
Aki Tuomi [Thu, 6 May 2021 11:55:55 +0000 (14:55 +0300)] 
indexer: worker - Fix busy/free status

Determining whether worker is free or not should be determined
using worker_connection_is_busy, not whether there are
connections in the list.

A worker connection is busy when it has a request.

4 years agoindexer: indexer-client - Use connection.c functions
Aki Tuomi [Thu, 6 May 2021 09:54:15 +0000 (12:54 +0300)] 
indexer: indexer-client - Use connection.c functions

4 years agoindexer: indexer-client - Use connection structure
Aki Tuomi [Thu, 6 May 2021 09:41:39 +0000 (12:41 +0300)] 
indexer: indexer-client - Use connection structure

4 years agoindexer: indexer-worker - Use event logging
Aki Tuomi [Thu, 6 May 2021 09:08:39 +0000 (12:08 +0300)] 
indexer: indexer-worker - Use event logging

4 years agoindexer: indexer-worker: Use connection.c functions
Aki Tuomi [Thu, 6 May 2021 09:03:16 +0000 (12:03 +0300)] 
indexer: indexer-worker: Use connection.c functions

4 years agoindexer: indexer-worker: Use connection structure
Aki Tuomi [Thu, 6 May 2021 08:42:37 +0000 (11:42 +0300)] 
indexer: indexer-worker: Use connection structure

4 years agoindexer: worker-connection - Use connection.c functions
Aki Tuomi [Thu, 6 May 2021 08:21:43 +0000 (11:21 +0300)] 
indexer: worker-connection - Use connection.c functions

4 years agoindexer: worker-connection - Prepare for using connection.c
Aki Tuomi [Thu, 6 May 2021 07:59:24 +0000 (10:59 +0300)] 
indexer: worker-connection - Prepare for using connection.c

4 years agoindexer: worker-pool - Use connection_list
Aki Tuomi [Thu, 6 May 2021 07:56:40 +0000 (10:56 +0300)] 
indexer: worker-pool - Use connection_list

4 years agoindexer: worker-pool - Remove unused last_use
Aki Tuomi [Thu, 6 May 2021 07:49:23 +0000 (10:49 +0300)] 
indexer: worker-pool - Remove unused last_use

4 years agoindexer: worker-connection - Use connection.h structures
Aki Tuomi [Thu, 6 May 2021 07:29:23 +0000 (10:29 +0300)] 
indexer: worker-connection - Use connection.h structures

4 years agoindexer: worker-connection - Move constructor further down
Aki Tuomi [Thu, 6 May 2021 07:11:54 +0000 (10:11 +0300)] 
indexer: worker-connection - Move constructor further down

Simplifies next commit

4 years agoReformat worker-connection.c
Aki Tuomi [Thu, 6 May 2021 07:11:24 +0000 (10:11 +0300)] 
Reformat worker-connection.c

4 years agolib: lib-event - Copy ru_last when making passthrough event
Aki Tuomi [Tue, 25 May 2021 07:38:46 +0000 (10:38 +0300)] 
lib: lib-event - Copy ru_last when making passthrough event

Otherwise user_cpu_usecs does not get added to the sent events.

4 years agomaster: Fix idle-kill for processes with a single short-lived client
Aki Tuomi [Thu, 6 May 2021 11:29:03 +0000 (14:29 +0300)] 
master: Fix idle-kill for processes with a single short-lived client

lib-master sends unimportant service status updates to master only once per
second when client_limit>1, because within that 1 second the available client
count may have already changed many times. Normally this is fine, but there's a
problem with the initial client:

 * The client connection launches a new process
 * The process sends the initial status notification with available_count=MAX
 * The client connection is handled, but because the status notification was
   just sent, the update won't be sent until 1 second later
 * The client disconnects within the 1 second
 * The available_count is again MAX, so no status notification is sent

In this situation the master process never created the idle-kill timeout.
Usually the following clients will cause a status notification to be sent, but
if there was only the one client then this process won't be idle-killed. Fix the
situation so that the idle-kill timeout is created already by the initial status
notification.

4 years agolib: Add array_foreach_reverse[_modifiable]()
Timo Sirainen [Thu, 3 Jun 2021 16:04:26 +0000 (19:04 +0300)] 
lib: Add array_foreach_reverse[_modifiable]()

This is especially useful when deleting multiple elements inside the loop.

4 years agolib: Don't use special code for i_unreached() with STATIC_CHECKER
Timo Sirainen [Thu, 3 Jun 2021 13:50:39 +0000 (16:50 +0300)] 
lib: Don't use special code for i_unreached() with STATIC_CHECKER

This was done originally to help scan-build, but this is no longer
necessary. Also actually running code where __builtin_unreachable() was
reached produced (very weird) undefined behavior.

Reverts e2e9ea6da9f3db5fd7fe467db79232d20d03832f

4 years agoMakefile.am: Update configure parameters for scan-build
Timo Sirainen [Thu, 3 Jun 2021 13:48:36 +0000 (16:48 +0300)] 
Makefile.am: Update configure parameters for scan-build

Especially add --enable-static-checker.

4 years agolib-imap: imap-parser - Parse literal size using as same algorithm as str_parse*().
Timo Sirainen [Fri, 4 Jun 2021 09:46:53 +0000 (12:46 +0300)] 
lib-imap: imap-parser - Parse literal size using as same algorithm as str_parse*().

This prevents wrapping the integer value and fixes an ubsan complaint.

Based on Stephan's similar patch in managesieve-parser.