]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
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.
Timo Sirainen [Tue, 7 Sep 2021 13:52:40 +0000 (16:52 +0300)]
indexer: Disconnect from worker after each request
service_count won't be tracked correctly otherwise.
Timo Sirainen [Tue, 7 Sep 2021 12:47:23 +0000 (15:47 +0300)]
indexer: Fix tracking indexer-worker's process_limit
After recent changes, the process_limit was too often thought to be 1.
Timo Sirainen [Tue, 31 Aug 2021 09:14:15 +0000 (12:14 +0300)]
indexer: Change status callback to take struct indexer_request parameter
Timo Sirainen [Tue, 31 Aug 2021 09:12:49 +0000 (12:12 +0300)]
indexer: Don't free worker_connection too early
There's no need for the status callback anymore to free the connection.
It will be tracked automatically.
Timo Sirainen [Tue, 31 Aug 2021 09:08:32 +0000 (12:08 +0300)]
indexer: Use a separate indexer_queue_callback_t type for indexer-queue callback
sergey.kitov [Tue, 14 Sep 2021 12:33:50 +0000 (15:33 +0300)]
lib: Remove connect_finished_time field from connection event.
Timo Sirainen [Fri, 10 Sep 2021 16:00:09 +0000 (19:00 +0300)]
lib: ENUM_NEGATE() - Disable runtime sizeof() check with STATIC_CHECKER
This is to avoid "Dangerous variable-length array (VLA) declaration"
errors with clang 12 scan-build, which happen because scan-build keeps
thinking that the enums can become larger than
2147483647 .
Aki Tuomi [Tue, 31 Aug 2021 12:44:20 +0000 (15:44 +0300)]
doveadm: Flush data to server client asynchronously
Markus Valentin [Tue, 13 Jul 2021 11:32:09 +0000 (13:32 +0200)]
virtual: Add storage flag for secondary index
Markus Valentin [Tue, 13 Jul 2021 11:28:43 +0000 (13:28 +0200)]
lib-storage: Add storage_class_flag for secondary index
Bernhard M. Wiedemann [Fri, 10 Sep 2021 04:47:21 +0000 (06:47 +0200)]
man: doveadm director flush - The parameter is -F, not -f
Aki Tuomi [Wed, 8 Sep 2021 06:53:12 +0000 (09:53 +0300)]
doveadm: doveadm-stats - Allocate field_types
field_types was function local variable that got used outside
of function. Change to use datastack allocation instead to
keep it valid after leaving function.
Broken in
e9a46e3a6df2edd6cb68a8fc04a5e8e4564a9d5e
Aki Tuomi [Tue, 31 Aug 2021 09:48:38 +0000 (12:48 +0300)]
lib-storage: Move (un)deleting debug message to mailbox_mark_index_deleted
Aki Tuomi [Mon, 9 Aug 2021 08:56:17 +0000 (11:56 +0300)]
lib-storage: mailbox-list - Detect duplicate GUIDs
This is only done for LAYOUT=INDEX.
Aki Tuomi [Thu, 19 Aug 2021 14:10:31 +0000 (17:10 +0300)]
lib-storage: mailbox-list - Add duplicate pool for duplicate detection
Aki Tuomi [Mon, 16 Aug 2021 11:38:47 +0000 (14:38 +0300)]
lib-storage: maildir - Use mail_storage_index_list_rebuild
Aki Tuomi [Fri, 20 Aug 2021 08:43:27 +0000 (11:43 +0300)]
lib-storage: maildir - Allow creating existing folder when rebuilding list index
Aki Tuomi [Mon, 9 Aug 2021 11:23:13 +0000 (14:23 +0300)]
lib-storage: dbox - Use mailbox_list_index_rebuild
Aki Tuomi [Mon, 9 Aug 2021 12:47:28 +0000 (15:47 +0300)]
lib-storage: dbox - Allow creating existing folder when rebuilding list index
Aki Tuomi [Fri, 13 Aug 2021 11:18:21 +0000 (14:18 +0300)]
lib-storage: Add list index rebuild code
Aki Tuomi [Fri, 27 Aug 2021 09:59:59 +0000 (12:59 +0300)]
lib-storage: Populate mailboxes_fs if needed
Aki Tuomi [Fri, 20 Aug 2021 11:30:46 +0000 (14:30 +0300)]
lib-storage: mailbox-list - Try to get GUID from mailbox path
Aki Tuomi [Fri, 13 Aug 2021 07:29:59 +0000 (10:29 +0300)]
lib-storage: Add fields to mail_storage needed for list rebuild
Aki Tuomi [Wed, 30 Jun 2021 05:44:33 +0000 (08:44 +0300)]
lib-storage: Fix changing mailbox GUID with LAYOUT=index
The old path would generate Mail/mailboxes/mailboxes/<guid>
sergey.kitov [Tue, 22 Jun 2021 12:59:25 +0000 (15:59 +0300)]
doveadm-stats: Add doveadm stats add/remove documentation
sergey.kitov [Thu, 27 May 2021 08:46:02 +0000 (11:46 +0300)]
doveadm: Add 'stats add' and 'stats remove' commands
sergey.kitov [Wed, 9 Jun 2021 14:23:28 +0000 (17:23 +0300)]
stats: replace hardcoded value of default exporter_include with macro
sergey.kitov [Wed, 9 Jun 2021 14:22:39 +0000 (17:22 +0300)]
doveadm: Rewrite doveadm stats dump command to allow reuse code in other commands.
sergey.kitov [Mon, 10 May 2021 13:39:21 +0000 (16:39 +0300)]
lib-master: Accept filter updates from stats by stats-client.
sergey.kitov [Tue, 20 Apr 2021 14:07:36 +0000 (17:07 +0300)]
stats: Implement ipc interface for adding and removing metrics
sergey.kitov [Mon, 10 May 2021 13:13:12 +0000 (16:13 +0300)]
stats: Implement sending filter updates to connected processes.
sergey.kitov [Tue, 20 Apr 2021 14:06:58 +0000 (17:06 +0300)]
stats: Add functions for adding or removing metrics
sergey.kitov [Tue, 13 Apr 2021 08:49:43 +0000 (11:49 +0300)]
stats: Expose stats_metric_setting_parser_info
sergey.kitov [Tue, 20 Apr 2021 14:06:26 +0000 (17:06 +0300)]
lib: Add function removing queries from event_filter
Timo Sirainen [Thu, 2 Sep 2021 11:31:36 +0000 (14:31 +0300)]
lib-http: test-http-client-errors - Fix random hangs
Wait for subprocesses to be initialized before starting each test.
This should fix random hangs with the test.
Timo Sirainen [Thu, 2 Sep 2021 12:39:33 +0000 (15:39 +0300)]
lib-test: test_subprocess_notify_signal_*() - Add signo parameter
This allows using multiple notification signals.
Timo Sirainen [Thu, 19 Aug 2021 10:50:04 +0000 (12:50 +0200)]
lib-storage: Make sure header parsing is deinitialized after failures
This should fix all the possible reasons for:
Panic: file index-mail-headers.c: line 198 (index_mail_parse_header_init): assertion failed: (!mail->data.header_parser_initialized)
Timo Sirainen [Thu, 19 Aug 2021 10:32:45 +0000 (12:32 +0200)]
lib-storage: Fix potential assert-crash if filter-stream fails
If filter-stream isn't read until header (because the parent istream fails),
the header parsing isn't deinitialized. If after the failure the headers are
attempted to be parsed again, there's an assert-crash. Make sure this won't
happen by finishing the filter-istream read, and if that fails then reset the
header parsing anyway.
Destroying the filter_stream may also change the parent istream offset to
change, so this commit adds an extra seek to beginning of the istream when
beginning to parse the mail headers.
Fixes:
Panic: file index-mail-headers.c: line 198 (index_mail_parse_header_init): assertion failed: (!mail->data.header_parser_initialized)
Timo Sirainen [Thu, 19 Aug 2021 10:29:36 +0000 (12:29 +0200)]
lib-storage: Split off index_mail_filter_stream_destroy()
Markus Valentin [Tue, 17 Aug 2021 12:33:56 +0000 (14:33 +0200)]
imapc: Fix crashing when copying nonexistent mails
Check the msgmap before attempting to copy an mail which may has been
expunged already. Fixes:
Panic: file mail-storage.c: line 2385 (mailbox_transaction_commit_get_changes): assertion failed: (ret < 0 || seq_range_count(&changes_r->saved_uids) == save_count || array_count(&changes_r->saved_uids) == 0)
Timo Sirainen [Wed, 18 Aug 2021 12:04:53 +0000 (14:04 +0200)]
lib-storage: Fix assert-crash in special partial mail parsing failures
This happened for example if:
- mail_precache() started parsing mail
- header was parsed, but mail body parsing failed due to mail size mismatch
- vsize parsing doesn't restart header parsing, because header size is already known
- body parsing assert-crashes because there is no messsage parser initialized
Fixes:
Panic: file index-mail.c: line 1290 (index_mail_parse_body): assertion failed: (data->parser_ctx != NULL)
Aki Tuomi [Thu, 12 Aug 2021 09:42:40 +0000 (12:42 +0300)]
lib-oauth2: Add unit test for missing exp field
Aki Tuomi [Thu, 12 Aug 2021 09:40:39 +0000 (12:40 +0300)]
lib-oauth2: Add unit tests for valid tokens
s3lph [Mon, 7 Jun 2021 22:35:13 +0000 (00:35 +0200)]
lib-oauth2-jwt: Remove 'nbf < iat' check, as it's not mandated by RFC7519, and not uncommon to predate the nbf field
Timo Sirainen [Tue, 24 Aug 2021 20:58:59 +0000 (22:58 +0200)]
lib-test: Fix race when subprocess immediately receives signal
Signal could be received before test_subprocess_is_child=1 is set, causing
the subprocess's signal handler to also attempt to cleanup other
subprocesses.
This was causing http-test-client-errors unit tests to fail somewhat
randomly, especially when running them only with 1 CPU.
Timo Sirainen [Tue, 24 Aug 2021 12:02:44 +0000 (15:02 +0300)]
lib: Add test-macros
Timo Sirainen [Mon, 23 Aug 2021 11:21:02 +0000 (14:21 +0300)]
lib: Rewrite POINTER_CAST_TO() to avoid new clang warning
Fixes:
warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
Timo Sirainen [Mon, 23 Aug 2021 11:20:54 +0000 (14:20 +0300)]
dbox: Remove unnecessary variable
The variable was set and updated, but never read.
Timo Sirainen [Mon, 23 Aug 2021 11:20:24 +0000 (14:20 +0300)]
lib-dcrypt: Remove unnecessary variable
The variable was set and updated, but never read.
Martti Rannanjärvi [Mon, 23 Aug 2021 08:46:46 +0000 (11:46 +0300)]
doveadm-dsync: Free ssl_iostream_context on connection failure
Stephan Bosch [Tue, 13 Apr 2021 16:25:06 +0000 (18:25 +0200)]
lib-smtp: smtp-server-cmd-rcpt - Fix assert crash occurring for pipelined MAIL RCPT MAIL sequence.
The assertion is wrong in that it assumes that no MAIL commands can be pending
once RCPT command is next to reply. The RCPT command does not block the
pipeline, so that a subsequent MAIL command can also be pending (but will almost
never succeed).
Stephan Bosch [Tue, 13 Apr 2021 16:25:31 +0000 (18:25 +0200)]
lib-smtp: smtp-server-cmd-data - Add comment to pipeline state assertion.
Stephan Bosch [Thu, 19 Aug 2021 23:19:28 +0000 (01:19 +0200)]
lib-smtp: smtp-server-cmd-data - Remove useless trans != NULL checks.
Siavash Tavakoli [Thu, 19 Aug 2021 16:06:42 +0000 (17:06 +0100)]
dict-sql: Fail early if there's unexpected number of bind arguments for iter
Otherwise, lib-sql raises a panic.
Timo Sirainen [Tue, 17 Aug 2021 13:23:31 +0000 (15:23 +0200)]
lib: istreams - Make sure freeing snapshots can't access freed parent istream memory
This happened after the recent istream-header-filter snapshot changes.
Timo Sirainen [Wed, 18 Aug 2021 17:49:43 +0000 (19:49 +0200)]
imap: Fix mailbox leak if MOVE can't open the source mailbox
Broken by
143b7c2b412ed8f155e812603fda81886bec466e
Fixes:
Panic: file mail-user.c: line 229 (mail_user_deinit): assertion failed: ((*user)->refcount == 1)
Siavash Tavakoli [Wed, 18 Aug 2021 12:54:39 +0000 (13:54 +0100)]
lib-lua: Don't include lua_resume_compat() for 5.1
lua_resume() is not supported in 5.1, so don't try to add a
compatibility function that fails compilation.
Timo Sirainen [Tue, 25 May 2021 16:26:14 +0000 (19:26 +0300)]
lib: Remove unused event_filter_add()
Timo Sirainen [Mon, 16 Aug 2021 14:13:27 +0000 (17:13 +0300)]
lib: test-event-filter - Replace event_filter_add() with event_filter_parse()
Timo Sirainen [Mon, 24 May 2021 20:57:13 +0000 (23:57 +0300)]
lib: Add comments to event-related code
Timo Sirainen [Mon, 24 May 2021 19:26:27 +0000 (22:26 +0300)]
lib: event_want_level() - Minor code cleanup
event_want_log_level() internally does both of these checks, so it's enough
to just check its return value.
Timo Sirainen [Tue, 17 Aug 2021 09:12:18 +0000 (12:12 +0300)]
lib-fs: Fix fs_stats.copy_count tracking with fs_default_copy()
The copy_count could have been decreased too many times with async
operations.
Timo Sirainen [Mon, 16 Aug 2021 12:36:37 +0000 (15:36 +0300)]
global: Add ATTR_UNSIGNED_WRAPS to fix various ubsan issues
Timo Sirainen [Thu, 5 Aug 2021 15:53:57 +0000 (18:53 +0300)]
global: Fix various ubsan issues
Timo Sirainen [Tue, 17 Aug 2021 07:59:49 +0000 (10:59 +0300)]
doveadm: Free memory for all loaded mail_plugins at deinit
Timo Sirainen [Tue, 17 Aug 2021 07:50:34 +0000 (10:50 +0300)]
doveadm pw -l: Free all memory to avoid memory leak complaints
Timo Sirainen [Tue, 17 Aug 2021 07:30:25 +0000 (09:30 +0200)]
doveadm batch: Fix memory leak
Timo Sirainen [Tue, 17 Aug 2021 08:06:36 +0000 (11:06 +0300)]
doveadm: Split off doveadm_mail_cmd_deinit()
Timo Sirainen [Fri, 7 May 2021 18:15:04 +0000 (21:15 +0300)]
doveadm: Make doveadm_mail_cmd_free() public
Siavash Tavakoli [Fri, 13 Aug 2021 10:08:30 +0000 (11:08 +0100)]
global: Use consistent lua function names
Change lua-style function names to be consistent with dovecot's style.
Siavash Tavakoli [Thu, 12 Aug 2021 18:43:25 +0000 (19:43 +0100)]
lib-lua: test-lua: Fix the test for lua versions later than 5.3
Siavash Tavakoli [Thu, 12 Aug 2021 18:40:22 +0000 (19:40 +0100)]
lib-lua: Add lua_resume_compat() and use it in lua versions prior to 5.4
Starting lua 5.4 "lua_resume()" expects an extra "nresults" argument. Add a
compatibility function to handle this argument in earlier versions.
Felipe Gasper [Sun, 24 May 2020 18:47:18 +0000 (14:47 -0400)]
man: Document command/args destination format to sync/backup.
Timo Sirainen [Mon, 16 Aug 2021 11:52:50 +0000 (14:52 +0300)]
lib-compression: istream-lz4 - Fix handling partial header reads
Reading assert-crashed if the header was read only partially. Either
because the file really was truncated or because parent stream already
had fewer bytes buffered.
Timo Sirainen [Mon, 16 Aug 2021 11:51:29 +0000 (14:51 +0300)]
lib-compression: istream-lz4 - Remove redundant check
The loop is reached only if ret is 0, so there's no need to check it again.
Timo Sirainen [Mon, 16 Aug 2021 11:50:10 +0000 (14:50 +0300)]
lib-compression: istream-lz4 - Add asserts to make sure parent buffer isn't full
The parent buffer's max size would have to be tiny for these to happen.
Siavash Tavakoli [Thu, 1 Jul 2021 12:52:29 +0000 (13:52 +0100)]
dict: Use dict-init-cache
Make use of dict-init-cache for initialization and deinitialization of dicts.
Siavash Tavakoli [Fri, 25 Jun 2021 13:11:52 +0000 (14:11 +0100)]
dict: Add caching mechanism for initializing dicts
Add a pool for dict instances. Each dict is refcounted and given a grace period
of 30 seconds for deletion. If refcount drops to 0 and no new dict
operation uses the instance in that period, it will be freed. A maximum
of 10 dicts are kept in the cache.
Siavash Tavakoli [Sun, 8 Aug 2021 23:35:09 +0000 (00:35 +0100)]
dict: Add dict_created and dict_destroyed events
Inherit from dict.event and emitted at dict initialization/deinit.
Martti Rannanjärvi [Sun, 15 Aug 2021 09:45:12 +0000 (12:45 +0300)]
lib-sasl: test-sasl-client.c - Initialize authid of sasl_empty_set
This fixes the compiler warning:
test-sasl-client.c:8:1: error: missing initializer for field 'authid'
of 'const struct dsasl_client_settings'
Martti Rannanjärvi [Sun, 15 Aug 2021 04:12:42 +0000 (07:12 +0300)]
lib-sasl: oauthbearer - Fix memory leak on auth failure
Aki Tuomi [Wed, 11 Aug 2021 06:48:06 +0000 (09:48 +0300)]
lib-sasl: Add unit tests
Aki Tuomi [Wed, 11 Aug 2021 06:59:05 +0000 (09:59 +0300)]
lib-sasl: Do not crash if password is NULL
Aki Tuomi [Wed, 11 Aug 2021 06:47:17 +0000 (09:47 +0300)]
lib-sasl: When setting port, parse value, not key.
Broken in
228f1e8d583
Aki Tuomi [Wed, 11 Aug 2021 05:49:44 +0000 (08:49 +0300)]
auth: Do not forward empty "master" passdb field
Aki Tuomi [Wed, 11 Aug 2021 05:48:29 +0000 (08:48 +0300)]
login-common: Ignore empty value for "master" passdb extra field
Siavash Tavakoli [Tue, 10 Aug 2021 11:26:14 +0000 (12:26 +0100)]
mail-crypt: Add password confirmation for doveadm cryptokey password command
To prevent setting wrong passwords by accident.