]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
Timo Sirainen [Wed, 5 Aug 2020 11:35:52 +0000 (14:35 +0300)]
lib: Fix potential crash changing signal handlers after destroying ioloop
sergey.kitov [Mon, 22 Jun 2020 12:30:49 +0000 (15:30 +0300)]
lib-index: Set event name for "Recreated index"
Josef 'Jeff' Sipek [Tue, 21 Jul 2020 17:32:19 +0000 (13:32 -0400)]
global: Rely on fs_deinit() automatically freeing parent fs
Josef 'Jeff' Sipek [Tue, 21 Jul 2020 16:55:27 +0000 (12:55 -0400)]
lib-fs: Free parent fs generically
Josef 'Jeff' Sipek [Tue, 21 Jul 2020 17:24:15 +0000 (13:24 -0400)]
mail-crypt: Use container_of() instead of casts for fs code
Being more explicit not only makes the code more explict, it makes it safer.
Josef 'Jeff' Sipek [Tue, 21 Jul 2020 17:22:06 +0000 (13:22 -0400)]
fs-compress: Use container_of() instead of casts
Being more explicit not only makes the code more explict, it makes it safer.
Josef 'Jeff' Sipek [Tue, 21 Jul 2020 17:18:41 +0000 (13:18 -0400)]
lib-fs: sis - Use container_of() instead of casts
Being more explicit not only makes the code more explict, it makes it safer.
Josef 'Jeff' Sipek [Tue, 21 Jul 2020 17:16:34 +0000 (13:16 -0400)]
lib-fs: sis-queue - Use container_of() instead of casts
Being more explicit not only makes the code more explict, it makes it safer.
Josef 'Jeff' Sipek [Tue, 21 Jul 2020 17:13:20 +0000 (13:13 -0400)]
lib-fs: randomfail - Use container_of() instead of casts
Being more explicit not only makes the code more explict, it makes it safer.
Josef 'Jeff' Sipek [Tue, 21 Jul 2020 17:05:34 +0000 (13:05 -0400)]
lib-fs: metawrap - Use container_of() instead of casts
Being more explicit not only makes the code more explict, it makes it safer.
Josef 'Jeff' Sipek [Fri, 17 Jul 2020 21:43:08 +0000 (17:43 -0400)]
lib-fs: Add new deinit vfunc
This is useful for tidying up anything just before freeing the struct fs.
For example, flushing dirty data in a write-back cache.
Josef 'Jeff' Sipek [Fri, 17 Jul 2020 21:26:41 +0000 (17:26 -0400)]
lib-fs: Rename deinit vfunc to free
Timo Sirainen [Sun, 26 Apr 2020 19:27:52 +0000 (22:27 +0300)]
lib, lib-master: Send updated event to stats if fields/categories change
Based on code by Jeff Sipek
Timo Sirainen [Tue, 28 Apr 2020 15:48:07 +0000 (18:48 +0300)]
stats: Allow clients to update existing events with UPDATE command
Timo Sirainen [Tue, 28 Apr 2020 15:43:21 +0000 (18:43 +0300)]
lib: event_import*() - Allow importing duplicate data without using more memory
Josef 'Jeff' Sipek [Mon, 27 Jul 2020 15:15:42 +0000 (11:15 -0400)]
lib-master: Properly compare unit test output strings with expected values
The I_MIN() mean that only the prefix was getting compared.
Stephan Bosch [Sun, 5 Jul 2020 10:16:06 +0000 (12:16 +0200)]
imap: cmd-notify - Do not try to notify for removable namespaces.
It is not going to work anyway and it will cause a crash when the IMAP sync code
subsequently drops those namespaces as part of mail_user_drop_useless_namespaces().
This does not drop the earlier created mailbox_list_notify object, causing its
mailbox list index view object to remain open. This causes the following panic:
Panic: Leaked view for index <path>/dovecot.list.index: Opened in mailbox-list-index-notify.c:142
Stephan Bosch [Mon, 6 Jul 2020 23:37:54 +0000 (01:37 +0200)]
lib-storage: Add mail_namespace_is_removable() and use it.
Stephan Bosch [Sun, 5 Jul 2020 10:47:05 +0000 (12:47 +0200)]
lib-index: mail-index-view - Record caller source filename and line for mail_index_view_clone/dup_private().
Before, this was only recorded for mail_index_view_open(), which caused the view
leak panic to show a useless source location, e.g.:
Panic: Leaked view for index <path>: Opened in (null):0
Josef 'Jeff' Sipek [Thu, 16 Jul 2020 20:30:00 +0000 (16:30 -0400)]
lib-fs: Set debug on event from settings
Stephan Bosch [Mon, 29 Jun 2020 09:56:02 +0000 (11:56 +0200)]
imap: cmd-notify - Fix segfault ocurring upon NOTIFY error.
The client_send_line() function in imap_client_notify_more() uses notify_ns to
obtain access to client struct, while that is available as a direct function
parameter. And notify_ns is invalid at the end of the for loop, so dereferencing
it causes a segmentation fault.
Aki Tuomi [Fri, 31 Jul 2020 15:39:54 +0000 (18:39 +0300)]
lib-compression: test-compression - Do not fail on missing handlers
Aki Tuomi [Fri, 31 Jul 2020 06:51:35 +0000 (09:51 +0300)]
lib-compression: Fix support for older libzstd
Aki Tuomi [Fri, 31 Jul 2020 06:51:16 +0000 (09:51 +0300)]
lib-compression: test-compression - Ensure compression handler is found by file extension
Timo Sirainen [Wed, 10 Jun 2020 12:53:41 +0000 (15:53 +0300)]
fs-compress: Try all compression formats when decompressing
Not just the specified compression format.
Timo Sirainen [Wed, 10 Jun 2020 12:48:06 +0000 (15:48 +0300)]
fs-compress: Rename compress_fs.handler to compress_handler
Aki Tuomi [Mon, 6 Jul 2020 11:54:48 +0000 (14:54 +0300)]
lib-compression: test-compression - Add test for tiny invalid data
Ensure compression handlers return EINVAL when reading
less than header size data.
Aki Tuomi [Mon, 6 Jul 2020 16:55:10 +0000 (19:55 +0300)]
lib-compression: istream-xz - Fix header reading
If file was smaller than xz magic size, we would get
EPIPE instead of EINVAL.
Aki Tuomi [Mon, 6 Jul 2020 12:42:26 +0000 (15:42 +0300)]
lib-compression: istream-zstd - Fix header reading
If file was smaller than zstd magic size, we would get
EPIPE instead of EINVAL.
Aki Tuomi [Mon, 6 Jul 2020 12:41:28 +0000 (15:41 +0300)]
lib-compression: istream-zlib - Fix header reading
If data size was 0 it would give EPIPE instead of EINVAL
Aki Tuomi [Mon, 6 Jul 2020 16:16:50 +0000 (19:16 +0300)]
lib-compression: istream-lz4 - Fix header reading
If data size was smaller than header size, lz4 reading would
return -1 without error indicating EOF instead of EINVAL.
Broken in
c1a43c6098f0caf11e8a2c1889227ec3969e410e
Aki Tuomi [Mon, 6 Jul 2020 07:12:39 +0000 (10:12 +0300)]
lib-compression: ostream-zstd - Remove o_stream_zstd_error
It has only one private caller.
Aki Tuomi [Mon, 6 Jul 2020 07:11:51 +0000 (10:11 +0300)]
lib-compression: ostream-zstd - Fix error handling
The error code handling in ZSTD was wrong, because zstd returns
error codes as large unsigned numbers which need to be retrieved
with helper function.
Aki Tuomi [Mon, 6 Jul 2020 07:10:00 +0000 (10:10 +0300)]
lib-compression: istream-zstd - Remove i_stream_zstd_error
It has only one private caller.
Aki Tuomi [Fri, 3 Jul 2020 06:45:09 +0000 (09:45 +0300)]
lib-compression: Fix error handling for zstd
The error code handling in ZSTD was wrong, because zstd returns
error codes as large unsigned numbers which need to be retrieved
with helper function.
Markus Valentin [Mon, 6 Jul 2020 09:48:13 +0000 (11:48 +0200)]
lib-compression: Add "unsupported" compression
This new compression is only used for testing purposes.
Markus Valentin [Tue, 30 Jun 2020 12:28:03 +0000 (14:28 +0200)]
lib-compression: Change compression_lookup_handler_from_ext return value
In order to improve the error handling for
compression_lookup_handler_from_ext calls return an integer rather then
a pointer to struct compression_handler.
Markus Valentin [Tue, 30 Jun 2020 12:21:22 +0000 (14:21 +0200)]
lib-compression: Change compression_lookup_handler return value
In order to improve the error handling for compression_lookup_handler
calls return an integer rather then a pointer to struct
compression_handler.
This change also prevents crashes when trying to use a compression
format that isn't compiled in.
Timo Sirainen [Wed, 29 Jul 2020 07:40:17 +0000 (10:40 +0300)]
pop3: Fix assert-crash when using pop3_deleted_flag
Broken by
6d18044e1408ce98aa8ef145a9f85895829a7bc7
Fixes:
Panic: file seq-range-array.c: line 472 (seq_range_array_invert): assertion failed: (range[count-1].seq2 <= max_seq)
Timo Sirainen [Wed, 15 Jul 2020 09:42:59 +0000 (12:42 +0300)]
pop3-login: Fix handling commands that are sent in multiple IP packets
This happened especially if the commands were long, like XCLIENT.
This got broken by recent pop3-login changes.
Aki Tuomi [Fri, 10 Jul 2020 08:00:14 +0000 (11:00 +0300)]
lib-test: Rename s1, s2 to _temp_s1, _temp_s2 in test_assert_strcmp_idx
Some test code uses s1 and s2 as variable names.
Broken in
449539dc52070bebde3ae7babe96e6e272dd7101
Aki Tuomi [Thu, 9 Jul 2020 06:38:37 +0000 (09:38 +0300)]
pop3-login: Use struct client authenticating member
This is what should be used instead of introducing our own.
Broken in
6c55437036b3de11804eb68f66d84cb164c33d63
Aki Tuomi [Thu, 9 Jul 2020 06:39:48 +0000 (09:39 +0300)]
pop3-login: Consume line after mech probe
Otherwise we read next line empty and that causes -ERR.
Broken in
6c55437036b3de11804eb68f66d84cb164c33d63
Aki Tuomi [Wed, 8 Jul 2020 07:59:48 +0000 (10:59 +0300)]
lib: istream - Do not attempt read past end in i_stream_next_line_finish
Aki Tuomi [Wed, 8 Jul 2020 09:58:56 +0000 (12:58 +0300)]
lib-test: test_assert_strcmp_idx - Avoid double evaluation
Aki Tuomi [Wed, 8 Jul 2020 05:55:31 +0000 (08:55 +0300)]
pop3-login: Read command more carefully
Ensure we don't consume '\n' or '\0' when reading command, but
that we consume '\r' otherwise i_stream_read_next_line won't work properly.
Josef 'Jeff' Sipek [Wed, 1 Jul 2020 16:11:43 +0000 (12:11 -0400)]
lib: Properly free event filter in unit tests
Aki Tuomi [Fri, 3 Jul 2020 06:11:09 +0000 (09:11 +0300)]
lib: event-filter-lexer - Ignore unused parameters
Timo Sirainen [Tue, 19 May 2020 19:08:25 +0000 (22:08 +0300)]
lib: lib-signals - Use persistent signal IOs
When ioloop is switched, don't remove the IO from old ioloop and create it
to new ioloop. Just use persistent IOs for each separate ioloop. This can
reduce a lot of syscalls when ioloops are often switched.
Timo Sirainen [Tue, 19 May 2020 18:30:18 +0000 (21:30 +0300)]
lib: lib-signals - Add struct signal_ioloop
This struct tracks which ioloops have signal handlers.
Timo Sirainen [Tue, 19 May 2020 18:02:38 +0000 (21:02 +0300)]
lib: lib-signals - Replace LIBSIG_FLAG_NO_IOLOOP_AUTOMOVE with LIBSIG_FLAG_IOLOOP_AUTOMOVE
There aren't many signal handlers that actually want to move automatically.
It's just causing accidental bugs when signal handlers are run in
unexpected ioloops.
Timo Sirainen [Wed, 24 Jun 2020 07:30:21 +0000 (10:30 +0300)]
lib: lib-signals - Fix creating non-automove signal handlers before ioloop
Timo Sirainen [Tue, 19 May 2020 18:50:25 +0000 (21:50 +0300)]
lib: Add io_loop_add/remove_destroy_callback()
Aki Tuomi [Thu, 2 Jul 2020 07:09:49 +0000 (10:09 +0300)]
lib: event-filter - Use i_fatal for fatal error handling
Aki Tuomi [Thu, 2 Jul 2020 06:56:15 +0000 (09:56 +0300)]
lib: event-filter - Disable some more compiler warnings
Aki Tuomi [Thu, 2 Jul 2020 06:55:31 +0000 (09:55 +0300)]
lib: event-filter - Handle allocations
This allows us to use Dovecot specific memory error handling
when allocations fail. Also squashes compiler warnings.
Aki Tuomi [Tue, 30 Jun 2020 11:02:34 +0000 (14:02 +0300)]
pop3-login: Read SASL-IR properly
This fixes issue where login would fail if SASL-IR message would
be too long.
Aki Tuomi [Tue, 30 Jun 2020 11:01:12 +0000 (14:01 +0300)]
pop3-login: Read command separately
Simplifies next commit
Aki Tuomi [Wed, 1 Jul 2020 11:49:36 +0000 (14:49 +0300)]
auth: db-lua - Fix user iteration
The old code did not leave the stack empty after finishing up,
that would lead into stack being left dirty and accumulating
per each call.
Aki Tuomi [Wed, 1 Jul 2020 10:18:03 +0000 (13:18 +0300)]
auth: db-lua - Always set callback when iterating
Aki Tuomi [Fri, 26 Jun 2020 15:31:11 +0000 (18:31 +0300)]
lib-lua: Register panic handler
Aki Tuomi [Fri, 26 Jun 2020 15:27:18 +0000 (18:27 +0300)]
auth: db-lua - Ensure stack is empty at end
Aki Tuomi [Fri, 26 Jun 2020 15:29:46 +0000 (18:29 +0300)]
auth: db-lua - Pop dovecot after registering
Aki Tuomi [Fri, 26 Jun 2020 09:21:40 +0000 (12:21 +0300)]
auth: db-lua - Pop result after lookup
When doing lookups, the lookup result was not popped.
Aki Tuomi [Fri, 26 Jun 2020 09:16:31 +0000 (12:16 +0300)]
lib-lua: Add dlua_dump_stack
Useful for debugging why stack leaks
Aki Tuomi [Mon, 29 Jun 2020 06:55:15 +0000 (09:55 +0300)]
configure: Properly fail if bison or flex is missing
If bison or flex is missing, and are needed, fail configure.
Josef 'Jeff' Sipek [Fri, 26 Jun 2020 14:08:27 +0000 (10:08 -0400)]
Ignore ylwrap
Josef 'Jeff' Sipek [Thu, 25 Jun 2020 16:16:44 +0000 (12:16 -0400)]
lib: Rename event filter files to be less redundantly named
Josef 'Jeff' Sipek [Wed, 10 Jun 2020 20:44:19 +0000 (16:44 -0400)]
lib: event filter parser unit tests
Josef 'Jeff' Sipek [Tue, 26 May 2020 15:35:38 +0000 (11:35 -0400)]
lib: Switch event filtering to the new filter language
Josef 'Jeff' Sipek [Fri, 29 May 2020 17:09:22 +0000 (13:09 -0400)]
lib: Implement a new event filter language
Currently, it is not used by anything.
In general, the new syntax is very SQL-like. It is a boolean expression
made up of key-value comparisons, parentheses, and boolean connectors AND,
OR, and NOT.
The key-value comparisons are of the form:
<key> <operator> <value>
Where the key is one of:
(1) "event"
(2) "category"
(3) "source_location"
(4) a field name
The operator is one of:
(1) =
(2) >
(3) <
(4) >=
(5) <=
And the value is either:
(1) a single word token, or
(2) a quoted string
For example, to match events with the event name "abc", we would use one of
the following expressions. Note that white space is not significant between
tokens, and therefore the following are all equivalent.
event=abc
event="abc"
event = abc
event = "abc"
To match events with the name "abc" that include the "imap" category, we'd
use:
event=abc AND category=imap
To match events with the name "abc" that either include the "imap" or "pop3"
categories, we'd use:
event=abc AND (category=imap OR category=pop3)
Field names don't have any special prefix. Therefore, to match events than
have the field bytes_out equal to 10, we'd use:
bytes_out=10
To match events with bytes_out greater than or equal to 10, we'd use:
bytes_out>=10
Josef 'Jeff' Sipek [Wed, 17 Jun 2020 19:16:48 +0000 (15:16 -0400)]
lib: Allow event filter nodes to represent a log type category
Josef 'Jeff' Sipek [Wed, 17 Jun 2020 19:01:28 +0000 (15:01 -0400)]
lib: Future-proof the log type to event filter log type mapping
The mapping assumed that:
EVENT_FILTER_LOG_TYPE_FOO == (1 << LOG_TYPE_FOO)
While that is true today and will likely continue to be true in the future,
there's no reason why we can't future proof it and ensure that it always
works.
Josef 'Jeff' Sipek [Thu, 28 May 2020 21:43:21 +0000 (17:43 -0400)]
lib: Expose event_filter_category_to_log_type to the rest of event filter code
Josef 'Jeff' Sipek [Thu, 28 May 2020 21:22:09 +0000 (17:22 -0400)]
lib: Add internal code for event filter le/lt/ge/gt comparisons
These are currently unreachable.
Josef 'Jeff' Sipek [Fri, 22 May 2020 17:08:24 +0000 (13:08 -0400)]
lib: Rewrite event filter internals to use an abstract-syntax-tree
Josef 'Jeff' Sipek [Mon, 11 May 2020 18:43:15 +0000 (14:43 -0400)]
stats: Fail to load with empty metric filters
Josef 'Jeff' Sipek [Tue, 21 Apr 2020 14:32:32 +0000 (10:32 -0400)]
stats: replace metric { } filtering with the common filter language
Josef 'Jeff' Sipek [Thu, 14 May 2020 19:11:35 +0000 (15:11 -0400)]
lib: Change event_filter_parse() filter arg to a single pointer
Instead of allocating a new filter, fill in a passed in one.
Josef 'Jeff' Sipek [Thu, 14 May 2020 17:04:10 +0000 (13:04 -0400)]
lib: Assert that we aren't trying to match using filter framents
Josef 'Jeff' Sipek [Thu, 14 May 2020 17:03:52 +0000 (13:03 -0400)]
lib: Add event_filter_create_fragment()
Josef 'Jeff' Sipek [Tue, 21 Apr 2020 14:08:46 +0000 (10:08 -0400)]
lib: Move event filter query language from lib-master
This way we can use it elsewhere.
Josef 'Jeff' Sipek [Tue, 21 Apr 2020 15:05:58 +0000 (11:05 -0400)]
stats: openmetrics shouldn't abuse metric { } filter strings
Once upon a time it was thought that it was a good idea to output labels for
openmetrics metrics based on the fields used in the filter { } sub-block.
For the most part, this is not useful since the labels are going to be
either (1) always the same, or (2) one of several values.
For example, consider the following metric block:
metric foo {
event_name = something
...
filter {
abc = BAR
def = BAZ*
}
}
The value of 'abc' will *always* be 'BAR' for this metric, therefore it is
useless to include it.
The value of 'def' will always start with 'BAZ' for this metric. While it
may be tempting to justify this usage, the group_by provides a superset of
the functionality. In other words, the following config snipped will
provide a superset of the same information.
metric foo {
event_name = something
...
filter {
abc = BAR
def = BAZ*
}
group_by = abc def
}
Therefore, this filter { } sub-block labeling support is redundant and can
be safely removed.
Josef 'Jeff' Sipek [Mon, 11 May 2020 18:07:11 +0000 (14:07 -0400)]
lib: Add a way to merge filter queries with an overridden context
This allows the consumers to construct a filter without setting the context
on each query, and then when merging it with another query "filling in" the
context on the fly.
Josef 'Jeff' Sipek [Mon, 11 May 2020 18:03:52 +0000 (14:03 -0400)]
lib: Better document event filter iteration behavior
Aki Tuomi [Fri, 29 May 2020 06:53:53 +0000 (09:53 +0300)]
auth: auth-worker-client - Fix whitespace formatting
Aki Tuomi [Fri, 29 May 2020 06:52:23 +0000 (09:52 +0300)]
auth: auth-worker-client - Remove global auth_worker_client
All should go through connection list instead.
Broken in
317cb8aa981f856770057e23aeba98a33afc033a
Stephan Bosch [Tue, 29 Jan 2019 00:08:21 +0000 (01:08 +0100)]
lib-http: http-client - Fix assert panic occurring for shared clients.
Occurs as a race condition between connections becoming idle and new connections
being set up.
Panic was:
Panic: file http-client-queue.c: line 373 (http_client_queue_connection_attempt): assertion failed: (http_client_peer_addr_cmp (&(*peer_idx)->shared->addr, addr) != 0)
Timo Sirainen [Tue, 26 May 2020 16:22:52 +0000 (19:22 +0300)]
dict: Delay uncorking ostream in iteration callback
Timo Sirainen [Mon, 15 Jun 2020 07:33:53 +0000 (10:33 +0300)]
lib-storage: istream-mail - Fix assert-crash on handling corrupted mail size
In some situations the "Cached message size smaller than expected" error
handling could have resulted in:
Panic: file istream.c: line 315 (i_stream_read_memarea): assertion failed: (old_size <= _stream->pos - _stream->skip)
Timo Sirainen [Tue, 26 May 2020 16:09:38 +0000 (19:09 +0300)]
dict-client: Fix potential iterator double-free
client_dict_iterate_free() didn't really work properly, because of:
ctx->finished = TRUE;
client_dict_iter_api_callback(ctx, cmd, extra_args);
client_dict_iterate_free(ctx);
Here finished=TRUE is set first (and it needs to be set first). Afterwards
client_dict_iter_api_callback() internally calls
client_dict_iterate_deinit(), which can end up freeing the iterator.
Timo Sirainen [Tue, 26 May 2020 15:59:38 +0000 (18:59 +0300)]
dict-client: Rename struct dict_connection to dict_client_connection
dict server already has struct dict_connection. This naming conflict caused
problems with gdb debugging.
Timo Sirainen [Mon, 18 May 2020 17:34:27 +0000 (20:34 +0300)]
dict: Cork the output while writing iteration output
This reduces system CPU usage by avoiding many tiny write() syscalls.
Broken by
2ff2da52146609f4459bd0f7fd603e13400cb85e
Timo Sirainen [Tue, 28 Apr 2020 08:51:16 +0000 (11:51 +0300)]
fts: Add fts category
For now mainly so that the fts drivers' categories can inherit from it.
Timo Sirainen [Thu, 11 Jun 2020 09:59:14 +0000 (12:59 +0300)]
imap: Fix assert-crash in COPY/MOVE when storage doesn't return UIDs
For example copying mails into virtual storage crashed.
Broken by
09413e35f764a2898cbc26cea94218eed6df5cbf
Fixes:
Panic: file cmd-copy.c: line 152 (fetch_and_copy): assertion failed: (copy_ctx->copy_count == seq_range_count(©_ctx->saved_uids))
Timo Sirainen [Tue, 9 Jun 2020 08:40:53 +0000 (11:40 +0300)]
lib-compression: istream-zstd - Fix infinite loop when istream is nonblocking
Aki Tuomi [Thu, 4 Jun 2020 10:15:11 +0000 (13:15 +0300)]
lib-oauth2: oauth-jwt - Ensure / and . are escaped in kid
Aki Tuomi [Thu, 4 Jun 2020 07:41:32 +0000 (10:41 +0300)]
dovecot-oauth2.conf.ext: Update to match code
Aki Tuomi [Thu, 4 Jun 2020 07:23:36 +0000 (10:23 +0300)]
auth: db-oauth2 - Add more performant defaults for lib-http
Aki Tuomi [Wed, 3 Jun 2020 12:40:40 +0000 (15:40 +0300)]
lib-oauth2: Use azp to find token
This validates that the token is actually for us and also allows
having multiple tokens with same ID but different issuer.