]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
Siavash Tavakoli [Mon, 27 Sep 2021 10:58:21 +0000 (11:58 +0100)]
driver-pgsql: Add wait() implementation
Siavash Tavakoli [Mon, 27 Sep 2021 10:48:34 +0000 (11:48 +0100)]
dict-sql: Add "sql_dict_wait()" implementation
lib-sql now has sql_wait().
Siavash Tavakoli [Mon, 27 Sep 2021 10:46:07 +0000 (11:46 +0100)]
lib-sql: Add "wait" vfunc
To be used in backends that support async operations. On deinit dicts
should wait for results and then exit.
Siavash Tavakoli [Mon, 27 Sep 2021 18:43:54 +0000 (19:43 +0100)]
driver-pgsql: Keep a list of pending query results
To be used in wait() to determine if there are pending operations.
Timo Sirainen [Wed, 22 Sep 2021 17:57:06 +0000 (20:57 +0300)]
dict: Wait for all dicts to finish pending operations at shutdown
This also changes the dict process to exit cleanly instead of early via
lib_exit().
Timo Sirainen [Thu, 11 Jul 2019 09:05:37 +0000 (12:05 +0300)]
dict: Unref dict connection immediately when connection is destroyed
The delayed unrefing is needed when calling from dict command callbacks to
avoid calling dict_deinit() too early. But the connection's destroy() vfunc
can't be called directly from dict command callbacks, so there's no need
to add further delays. Especially when this happens at deinit where there is
no possibility of calling the delayed callback anymore.
Siavash Tavakoli [Mon, 27 Sep 2021 10:42:07 +0000 (11:42 +0100)]
driver-pgsql: Fix escaped blob prefix
Escaped strings must be prefixed with double backslash.
Siavash Tavakoli [Mon, 27 Sep 2021 10:35:38 +0000 (11:35 +0100)]
driver-pgsql: Fix assert-crash when using binary fields
array_idx_modifiable() changed behavior in
1d4e5de8414ed93d1c810b30a91ad83d6d954861 and doesn't allocate space
anymore.
Fixes:
Panic: file array.c: line 10 (array_idx_modifiable_i): assertion failed: (idx < array->buffer->used / array->element_size)
sergey.kitov [Tue, 28 Sep 2021 12:35:21 +0000 (15:35 +0300)]
stats: Use duplicated metric settings in stats_metrics_add_dynamic().
Aki Tuomi [Tue, 28 Sep 2021 09:41:14 +0000 (12:41 +0300)]
configure: Set version to 2.3.17
Markus Valentin [Wed, 15 Sep 2021 12:44:42 +0000 (14:44 +0200)]
imapc: Add MAIL_STORAGE_CLASS_FLAG_SECONDARY_INDEX storage class flag
Add SECONDARY_INDEX storage class flag to enable storing shared private
indexes in obox user root bundle.
Timo Sirainen [Fri, 24 Sep 2021 14:33:38 +0000 (17:33 +0300)]
lib-storage: mail_get_binary_stream() - Add comment about having to unref returned istream
Timo Sirainen [Wed, 22 Sep 2021 12:58:55 +0000 (15:58 +0300)]
lib: test-cpu-limit - Remove dead code
No longer needed after
6d902507c24fca4f64e3e9bf7d79ae5a48281cd8
Timo Sirainen [Mon, 27 Sep 2021 08:49:05 +0000 (11:49 +0300)]
lib: test-strfuncs - Avoid testing p_strndup() with overlong max_chars parameter
This ended up in memchr() call with n=SIZE_MAX-1, which sometimes doesn't
work right with old glibc versions.
Fixes:
Panic: Trying to allocate
18446744073709551615 bytes
Aki Tuomi [Wed, 8 Sep 2021 07:39:36 +0000 (10:39 +0300)]
lib-mail: Add test for empty header value
Aki Tuomi [Thu, 2 Sep 2021 14:10:11 +0000 (17:10 +0300)]
lib-mail: Limit header length to 1000 bytes
Aki Tuomi [Thu, 2 Sep 2021 14:12:55 +0000 (17:12 +0300)]
lib-mail: If message header has no colon, store it as value only
If the header is missing :, it is not valid header. Storing it as
value only ensures it will be kept by mbox rewrite, but will not
be processed as a header.
Aki Tuomi [Thu, 2 Sep 2021 13:46:19 +0000 (16:46 +0300)]
lib-mail: test-message-header-parser - Add NAME10, 100, 1000 macros for testing
Aki Tuomi [Tue, 7 Sep 2021 11:37:34 +0000 (14:37 +0300)]
lib: Add i_memspn() and i_memcspn()
Binary data safe variants of strspn() and strcspn()
Timo Sirainen [Thu, 16 Sep 2021 11:32:37 +0000 (13:32 +0200)]
virtual: Log a debug message why backend mailbox has changed
Stephan Bosch [Fri, 24 Sep 2021 08:39:43 +0000 (10:39 +0200)]
lib-storage: mail-duplicate - Restructure mail_duplicate_read_db_file() to make sure fd is closed.
Found by Coverity.
Stephan Bosch [Fri, 24 Sep 2021 08:22:28 +0000 (10:22 +0200)]
lib-storage: mail-duplicate - Fix segfault occurring upon failure to lock and open DB file.
Found by Coverity.
Timo Sirainen [Wed, 18 Aug 2021 14:54:00 +0000 (16:54 +0200)]
indexer-worker: Fix event leak on error handling
Stephan Bosch [Tue, 13 Jul 2021 02:15:14 +0000 (04:15 +0200)]
lib-storage: mail-duplicate - Implement separate error code for deadlock.
Stephan Bosch [Wed, 15 Sep 2021 23:49:57 +0000 (01:49 +0200)]
lib-storage: mail-duplicate - Update records from duplicate DB file after acquirement of per-ID lock.
The process previously holding the per-ID lock may have updated the DB.
Stephan Bosch [Fri, 17 Sep 2021 09:11:21 +0000 (11:11 +0200)]
lib-storage: mail-duplicate - Move acquirement of dotlock for DB file into mail_duplicate_read().
Stephan Bosch [Mon, 20 Sep 2021 09:58:12 +0000 (11:58 +0200)]
lib-storage: mail-duplicate - Implement per-ID locking.
Stephan Bosch [Fri, 17 Sep 2021 09:16:39 +0000 (11:16 +0200)]
lib-storage: mail-duplicate - Allow calling mail_duplicate_read() more than once in a transaction.
Stephan Bosch [Tue, 13 Jul 2021 21:22:52 +0000 (23:22 +0200)]
lib-storage: mail-duplicate - Record an entry for both checked and marked IDs.
Still only write the marked IDs to the file. The in-memory record is needed for
the locking introduced in a later commit.
Stephan Bosch [Tue, 13 Jul 2021 03:03:02 +0000 (05:03 +0200)]
lib-storage: mail-duplicate - Add debug messages for transaction.
Stephan Bosch [Tue, 13 Jul 2021 03:07:39 +0000 (05:07 +0200)]
lib-storage: mail-duplicate - Add debug messages for database.
Stephan Bosch [Tue, 13 Jul 2021 02:40:24 +0000 (04:40 +0200)]
lib-storage: mail-duplicate - Add event to transaction object.
Stephan Bosch [Tue, 13 Jul 2021 02:53:11 +0000 (04:53 +0200)]
lib-storage: mail-duplicate - Add event to database object.
Stephan Bosch [Tue, 8 Jun 2021 01:51:10 +0000 (03:51 +0200)]
lib-storage: mail-duplicate - Restructure API to make it transaction-based.
Stephan Bosch [Tue, 13 Jul 2021 02:03:42 +0000 (04:03 +0200)]
lib-storage: mail-duplicate - Change mail_duplicate_check() return type from bool to enum.
Stephan Bosch [Fri, 17 Sep 2021 09:04:55 +0000 (11:04 +0200)]
lib-storage: Reformat mail-duplicate.c.
Stephan Bosch [Sat, 7 Aug 2021 13:43:35 +0000 (15:43 +0200)]
lib-storage: mail-user - Add mail_user_get_volatile_dir().
Stephan Bosch [Mon, 20 Sep 2021 00:45:23 +0000 (02:45 +0200)]
lib: file-lock - Adjust API to allow EDEADLK to be used by application.
It always caused a Dovecot panic before when returned from kernel.
Stephan Bosch [Sun, 19 Sep 2021 11:09:29 +0000 (13:09 +0200)]
lib: file-lock - Rework API to make it extensible.
Stephan Bosch [Mon, 20 Sep 2021 00:39:08 +0000 (02:39 +0200)]
lib: file-lock - Rename file_{wait,try}_lock_error() to file_{wait,try}_lock().
Stephan Bosch [Mon, 20 Sep 2021 00:29:55 +0000 (02:29 +0200)]
lib: file-lock - Remove file_{wait,try}_lock().
Stephan Bosch [Mon, 20 Sep 2021 00:26:46 +0000 (02:26 +0200)]
global: Avoid use of file_{wait,try}_lock().
Use the file_{wait,try}_lock_error() variants instead.
Timo Sirainen [Wed, 22 Sep 2021 14:36:27 +0000 (17:36 +0300)]
lib-http: test-http-client-errors - Allow more relaxed timeouts for connect retry tests
With max_connect_attempts=3 the connects come at (0ms, 100ms, 300ms).
Before the 3rd attempt a timeout at 250ms must have triggered, so there
was only 50ms time for it to trigger. This wasn't always enough when
running with valgrind on an overloaded system. Solve this by increasing
max_connect_attempts=4 so the 4th attempt comes at 700ms, giving the
timeout 450ms to trigger.
Timo Sirainen [Wed, 22 Sep 2021 09:14:08 +0000 (12:14 +0300)]
lib: Add most data_stack_grow event fields before checking if event is wanted
This allows using e.g. "event=data_stack_grow and alloc_size > 32768" as
an event filter.
Timo Sirainen [Tue, 21 Sep 2021 15:27:29 +0000 (18:27 +0300)]
config: Add data stack frame
Timo Sirainen [Tue, 21 Sep 2021 15:26:53 +0000 (18:26 +0300)]
doveconf: Avoid unnecessary data stack use when writing output
Timo Sirainen [Tue, 21 Sep 2021 15:21:54 +0000 (18:21 +0300)]
master: Create each service in its own data stack frame
Timo Sirainen [Tue, 21 Sep 2021 14:52:15 +0000 (17:52 +0300)]
doveadm: Call each run() in its own data stack frame
Timo Sirainen [Tue, 21 Sep 2021 14:14:44 +0000 (17:14 +0300)]
dsync: Add data stack frames to mailbox loops
Timo Sirainen [Tue, 21 Sep 2021 14:10:56 +0000 (17:10 +0300)]
dsync: Split off dsync_brain_recv_mailbox_tree_add()
Timo Sirainen [Tue, 21 Sep 2021 14:50:32 +0000 (17:50 +0300)]
acl: Code cleanup - Remove pointless while-loop
Timo Sirainen [Tue, 21 Sep 2021 14:03:45 +0000 (17:03 +0300)]
acl: acllist rebuild - Move data stack frame to caller's loop
Timo Sirainen [Tue, 21 Sep 2021 13:14:12 +0000 (16:14 +0300)]
acl: Add data stack frame when iterating mailboxes
Avoids wasting memory when there are a lot of mailboxes.
Timo Sirainen [Tue, 21 Sep 2021 14:51:15 +0000 (17:51 +0300)]
lib-storage: mail_user_unref() - Add data stack frame
The deinit code paths can sometimes eat up quite a lot of data stack.
Timo Sirainen [Wed, 22 Sep 2021 09:49:46 +0000 (12:49 +0300)]
lib-storage: mailbox_create() - Add data stack frames
Timo Sirainen [Wed, 22 Sep 2021 09:48:18 +0000 (12:48 +0300)]
lib-storage: Add data stack frames to [service] user initialization
Initialization steps can use a lot of data stack, so try to free it at
several checkpoints.
Timo Sirainen [Tue, 21 Sep 2021 14:49:34 +0000 (17:49 +0300)]
lib-storage: Add data stack frame when iterating mailboxes to build GUID cache
Timo Sirainen [Tue, 21 Sep 2021 14:48:33 +0000 (17:48 +0300)]
lib-storage: mailbox_verify_*name() - Add data stack frames
This function can eat up quite a lot of data stack.
Timo Sirainen [Tue, 21 Sep 2021 14:47:41 +0000 (17:47 +0300)]
lib-storage: str_contains_special_use() - Add data stack frame
This function is called in a loop by namespace_find_special_use().
Timo Sirainen [Tue, 21 Sep 2021 13:58:13 +0000 (16:58 +0300)]
lib-storage: List index rebuild - Add data stack frames
Timo Sirainen [Tue, 21 Sep 2021 13:57:13 +0000 (16:57 +0300)]
lib-storage: List index rebuild - Split off mail_storage_list_index_find_indexed_mailbox()
Timo Sirainen [Tue, 21 Sep 2021 13:37:13 +0000 (16:37 +0300)]
lib-storage: Don't use data stack for mailbox list index header update
There can be a lot of mailboxes, causing excessive data stack usage.
Timo Sirainen [Tue, 21 Sep 2021 13:42:39 +0000 (16:42 +0300)]
lib-index: Don't use data stack for building index header update buffer
The header update can be large (e.g. dovecot.list.index with many
mailboxes) and grow data stack unnecessarily.
Timo Sirainen [Tue, 21 Sep 2021 14:51:50 +0000 (17:51 +0300)]
lib: module_dir_deinit() - Call each deinit() in its own data stack frame
Timo Sirainen [Tue, 21 Sep 2021 13:15:54 +0000 (16:15 +0300)]
lib: test-data-stack - Make sure data stack memory usage doesn't leak
Timo Sirainen [Tue, 21 Sep 2021 10:38:27 +0000 (13:38 +0300)]
lib: test-cpu-limit - Remove checking for CPU usage upper limit
These tests keep randomly failing on loaded systems. It's more important
anyway to check that the minimum CPU usage is high enough than it is to
check that CPU usage isn't too high.
Timo Sirainen [Fri, 17 Sep 2021 13:11:12 +0000 (16:11 +0300)]
lib: Optimize str_tabescape()
Timo Sirainen [Fri, 17 Sep 2021 13:10:12 +0000 (16:10 +0300)]
lib: Optimize p_strsplit_tabescaped()
Timo Sirainen [Fri, 17 Sep 2021 13:06:17 +0000 (16:06 +0300)]
lib: Optimize t_strsplit_tabescaped()
Timo Sirainen [Fri, 17 Sep 2021 13:04:00 +0000 (16:04 +0300)]
lib: Optimize t_strsplit_tabescaped_inplace()
Timo Sirainen [Fri, 17 Sep 2021 13:02:10 +0000 (16:02 +0300)]
lib: Optimize t_strdup*()
Avoid zeroing the allocated data stack memory just before it's going to be
filled with the duplicated string anyway.
Timo Sirainen [Thu, 11 Mar 2021 23:41:35 +0000 (01:41 +0200)]
lib: Optimize t_str_tabunescape()
Timo Sirainen [Thu, 11 Mar 2021 23:38:13 +0000 (01:38 +0200)]
lib: Optimize str_tabunescape()
Timo Sirainen [Thu, 11 Mar 2021 23:27:30 +0000 (01:27 +0200)]
lib: Optimize str_append_tabescaped()
Avoid calling strlen() and replace for-loop with strcspn().
Timo Sirainen [Thu, 11 Mar 2021 23:23:04 +0000 (01:23 +0200)]
lib: Optimize str_append_tabescaped_n()
Timo Sirainen [Thu, 11 Mar 2021 23:19:38 +0000 (01:19 +0200)]
lib: Optimize p_strndup()
Timo Sirainen [Thu, 11 Feb 2021 00:56:11 +0000 (02:56 +0200)]
lib: Optimize buffer_append() and buffer_append_c()
Timo Sirainen [Thu, 11 Feb 2021 00:44:34 +0000 (02:44 +0200)]
lib: buffer_create_dynamic_max() - Fix max_size handling
Never allocate buffer larger than its max_size, since it's just wasted
memory. Also clarify that the allocation can actually go up to max_size+1
because of str_c() NUL byte reservation.
Timo Sirainen [Thu, 11 Feb 2021 00:30:12 +0000 (02:30 +0200)]
lib: buffer_append_zero() - Avoid unnecessary memset()
Timo Sirainen [Thu, 11 Feb 2021 00:21:30 +0000 (02:21 +0200)]
lib: buffer - Add writable_size to simplify checking if buffer needs to be grown
Timo Sirainen [Wed, 15 Sep 2021 12:14:47 +0000 (14:14 +0200)]
lib: buffer - Replace casts with container_of()
Aki Tuomi [Thu, 12 Aug 2021 07:02:55 +0000 (10:02 +0300)]
lib-storage: Add data stack frame for mailbox_copy and mailbox_move
Aki Tuomi [Thu, 12 Aug 2021 06:58:57 +0000 (09:58 +0300)]
lib-storage: Add data stack frame for mailbox_rename
Aki Tuomi [Thu, 12 Aug 2021 06:58:41 +0000 (09:58 +0300)]
lib-storage: Add data stack frame for mailbox_delete
Timo Sirainen [Thu, 16 Sep 2021 16:32:02 +0000 (19:32 +0300)]
acl: acl_backend_vfile_has_acl() - Simplify code
Timo Sirainen [Thu, 16 Sep 2021 16:13:09 +0000 (19:13 +0300)]
acl: acl_backend_vfile_has_acl() - Open mailbox to check if it exists
This is a bit more expensive than the previous behavior, but it's done only
when creating or renaming mailboxes which are pretty rare operations.
This fixes copying parent ACLs with obox when the parent mailbox doesn't
exist in local metacache.
Timo Sirainen [Thu, 16 Sep 2021 16:26:07 +0000 (19:26 +0300)]
acl: acl_backend_vfile_has_acl() - Avoid unnecessary local ACL file check
The local ACL file can't exist if its mailbox doesn't exist.
Timo Sirainen [Thu, 16 Sep 2021 16:22:41 +0000 (19:22 +0300)]
acl: acl_backend_vfile_has_acl() - Check first if global ACL exists
Global ACL can be checked more efficiently. If it exists, there's no need
anymore to access the local mailbox ro ACL files.
Timo Sirainen [Thu, 16 Sep 2021 15:05:04 +0000 (18:05 +0300)]
acl: Consistently determine whether ACL files are in control or mailbox directory
Add mail_storage_get_acl_list_path_type() that is used for it. This fixes
ACL inheritance with obox.
Siavash Tavakoli [Sun, 5 Sep 2021 23:49:06 +0000 (00:49 +0100)]
lib-lua: Add function for restricting global variable definition
Add "dovecot.restrict_global_variables()" with a boolean argument to mitigate
unintended variable assignments and to prevent unnecessarily populating
global namespace.
If enabled, variables can only be defined local to the script but global
functions are still allowed.
Siavash Tavakoli [Tue, 7 Sep 2021 14:03:37 +0000 (15:03 +0100)]
lib-lua: Use rawget to check presence of functions in scripts
With the restricted global variables in next commit, checking for
undeclared functions results in error. Use rawget to avoid metamethods.
Timo Sirainen [Fri, 17 Sep 2021 09:26:35 +0000 (12:26 +0300)]
lib-lua: Build test-dict-lua only with Lua 5.3+
Fixes building with Lua 5.1
Aki Tuomi [Tue, 14 Sep 2021 07:33:50 +0000 (10:33 +0300)]
lib-compression: bench-compress - Ensure we have both istream and ostream constructor
After
6e5ae5ef0f0f31acd7bde0db53980a708c81eced we have read-only compression
mechanism, that leads to null pointer crash in bench-compress.
Timo Sirainen [Thu, 16 Sep 2021 17:12:13 +0000 (20:12 +0300)]
NEWS: Add news for 2.3.16
Timo Sirainen [Fri, 10 Sep 2021 12:52:43 +0000 (15:52 +0300)]
lib-lua: Add test-dict-lua
Timo Sirainen [Fri, 10 Sep 2021 12:47:47 +0000 (15:47 +0300)]
dict-lua: Change dict:lookup() to actually return nil if key isn't found
It was previously returning an empty table, although the comment said it
should have returned nil.
Timo Sirainen [Fri, 10 Sep 2021 09:49:50 +0000 (12:49 +0300)]
lib-dict: dict-lua - Add set_timestamp()
Timo Sirainen [Wed, 1 Sep 2021 16:33:49 +0000 (19:33 +0300)]
lib-dict: dict-lua - Add unset()
Timo Sirainen [Tue, 7 Sep 2021 14:00:07 +0000 (17:00 +0300)]
indexer: Remove the concept of a "busy" connection
All the connections are busy, since they are created for a new request and
they are disconnected when the request is done.
Timo Sirainen [Tue, 7 Sep 2021 13:56:16 +0000 (16:56 +0300)]
indexer: Handle more requests whenever indexer-worker connection closes
Previously this was done only when worker process sent a "request finished"
notification. Crashing worker processes could have caused the queue to get
stuck until more requests were added to the queue.