]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
4 years agolib-settings: test-setting-parser - Use correct type in test
Aki Tuomi [Thu, 4 Feb 2021 06:46:51 +0000 (08:46 +0200)] 
lib-settings: test-setting-parser - Use correct type in test

SIZE uses uoff_t.

4 years agolib: backtrace - Use correct format modifier
Aki Tuomi [Thu, 4 Feb 2021 06:45:37 +0000 (08:45 +0200)] 
lib: backtrace - Use correct format modifier

Matches size_t correctly.

4 years agolib: test-time-util - Use correct types for test case
Aki Tuomi [Thu, 4 Feb 2021 06:44:46 +0000 (08:44 +0200)] 
lib: test-time-util - Use correct types for test case

Fixes type mismatch on 32-bit systems.

4 years agomaster: Fix reopening log files on SIGUSR1
Timo Sirainen [Tue, 19 Jan 2021 18:11:47 +0000 (19:11 +0100)] 
master: Fix reopening log files on SIGUSR1

4 years agoman: Clarify how doveadm log reopen works
Timo Sirainen [Tue, 19 Jan 2021 18:11:20 +0000 (19:11 +0100)] 
man: Clarify how doveadm log reopen works

4 years agodovecot.service.in: Update documentation URL
Timo Sirainen [Thu, 28 Jan 2021 15:45:45 +0000 (16:45 +0100)] 
dovecot.service.in: Update documentation URL

4 years agolib-master: test-event-stats - Fix unit test when compiling using build directory
Timo Sirainen [Fri, 22 Jan 2021 11:19:05 +0000 (13:19 +0200)] 
lib-master: test-event-stats - Fix unit test when compiling using build directory

When using build directory __FILE__ expands to
"../../../src/lib-master/test-event-stats.c", which doesn't match
"test-event-stats.c" what is normally used.

4 years agolib-master: test-event-stats - Cast test value to uint64_t
Aki Tuomi [Mon, 18 Jan 2021 16:14:47 +0000 (18:14 +0200)] 
lib-master: test-event-stats - Cast test value to uint64_t

4 years agolib: Fix timeval_cmp_margin for 32-bit systems
Paul Howarth [Mon, 4 Jan 2021 16:31:03 +0000 (16:31 +0000)] 
lib: Fix timeval_cmp_margin for 32-bit systems

The test suite compares times with seconds values of -INT_MAX and
INT_MAX. The result of this comparison does not fit in a value of
type int and so the test suite fails on 32-bit systems where time_t
is an int. To fix this, calculations on seconds values are done
using long long integers.

Broken by 16ab5542

4 years agodsync: Use a better default vname escape character
Timo Sirainen [Tue, 26 Jan 2021 15:44:46 +0000 (17:44 +0200)] 
dsync: Use a better default vname escape character

A control character was a bit unreadable in strings.

4 years agodsync: Replace escape characters in outgoing mailbox names with alt_char
Timo Sirainen [Tue, 26 Jan 2021 16:55:22 +0000 (18:55 +0200)] 
dsync: Replace escape characters in outgoing mailbox names with alt_char

Especially when dsync is used for migration, we don't want to end up having
invalid mUTF7 mailbox names locally. Also, remote might not even be
configured to use the same escape character.

4 years agodsync: Send alt_char also to slave brain
Timo Sirainen [Tue, 26 Jan 2021 16:54:53 +0000 (18:54 +0200)] 
dsync: Send alt_char also to slave brain

4 years agolib-storage: mailbox_list_escape_name_params() - Assert that escape_char isn't NUL
Timo Sirainen [Mon, 18 Jan 2021 21:53:50 +0000 (23:53 +0200)] 
lib-storage: mailbox_list_escape_name_params() - Assert that escape_char isn't NUL

4 years agoimapc: Add comment explaining various mailbox names
Timo Sirainen [Fri, 15 Jan 2021 17:27:00 +0000 (19:27 +0200)] 
imapc: Add comment explaining various mailbox names

4 years agoimapc: fs mailbox_list - Remove vname_escape_char
Timo Sirainen [Mon, 18 Jan 2021 21:31:28 +0000 (23:31 +0200)] 
imapc: fs mailbox_list - Remove vname_escape_char

This isn't necessary.

4 years agoimapc: Add IMAPC_LIST_FS_NAME_ESCAPE_CHAR
Timo Sirainen [Mon, 18 Jan 2021 21:30:28 +0000 (23:30 +0200)] 
imapc: Add IMAPC_LIST_FS_NAME_ESCAPE_CHAR

This clarifies how the escape characters are used.

4 years agoimapc: Add a default vname_escape_char
Timo Sirainen [Mon, 18 Jan 2021 21:23:37 +0000 (23:23 +0200)] 
imapc: Add a default vname_escape_char

Having vname_escape_char guarantees that all the remote mailbox names are
accessible by escaping them as necessary.

4 years agoimapc: Fix local filesystem directory name escaping
Timo Sirainen [Mon, 18 Jan 2021 21:19:01 +0000 (23:19 +0200)] 
imapc: Fix local filesystem directory name escaping

Use the remote mailbox name as the base. Convert the hierarchy separator
and add escaping as necessary.

The old method was based on storage_name, and it's a bit unclear if it
worked correctly in all situations.

4 years agoimapc: Add imapc_list_remote_to_storage_name()
Timo Sirainen [Sat, 16 Jan 2021 15:20:46 +0000 (17:20 +0200)] 
imapc: Add imapc_list_remote_to_storage_name()

4 years agoimapc: Fix remote/storage mailbox name mismatches
Timo Sirainen [Sat, 16 Jan 2021 13:03:59 +0000 (15:03 +0200)] 
imapc: Fix remote/storage mailbox name mismatches

4 years agoimapc: Use more explicit mailbox name variable names
Timo Sirainen [Sat, 16 Jan 2021 13:00:06 +0000 (15:00 +0200)] 
imapc: Use more explicit mailbox name variable names

Clearly specify which type of a mailbox name it is to avoid
misunderstandings.

4 years agoimapc: Rename imapc_list_get_fs_name() to imapc_list_storage_to_fs_name()
Timo Sirainen [Sat, 16 Jan 2021 12:44:00 +0000 (14:44 +0200)] 
imapc: Rename imapc_list_get_fs_name() to imapc_list_storage_to_fs_name()

4 years agoimapc: Rename imapc_list_to_vname() to imapc_list_remote_to_vname()
Timo Sirainen [Sat, 16 Jan 2021 12:41:24 +0000 (14:41 +0200)] 
imapc: Rename imapc_list_to_vname() to imapc_list_remote_to_vname()

4 years agoimapc: Rename imapc_list_to_remote() to imapc_list_storage_to_remote_name()
Timo Sirainen [Sat, 16 Jan 2021 12:40:54 +0000 (14:40 +0200)] 
imapc: Rename imapc_list_to_remote() to imapc_list_storage_to_remote_name()

4 years agolib-storage: mailbox_list_default_get_storage_name() - Escape ns_prefix/INBOX if...
Timo Sirainen [Thu, 14 Jan 2021 15:45:07 +0000 (17:45 +0200)] 
lib-storage: mailbox_list_default_get_storage_name() - Escape ns_prefix/INBOX if possible

If storage_name_escape_char is set, escape the "I" letter in the
storage_name if the namespace also has inbox=yes. This way it's possible to
distinguish between the actual INBOX and ns_prefix/INBOX.

4 years agolib-storage: Update mailbox_list_settings.{vname|storage_name}_escape_char comments
Timo Sirainen [Thu, 14 Jan 2021 15:33:13 +0000 (17:33 +0200)] 
lib-storage: Update mailbox_list_settings.{vname|storage_name}_escape_char comments

Also add the examples in the comments to unit tests to make sure they really
work.

4 years agolib-storage: Fix mailbox name escape/unescape ordering
Timo Sirainen [Thu, 14 Jan 2021 15:27:03 +0000 (17:27 +0200)] 
lib-storage: Fix mailbox name escape/unescape ordering

This fixes some cases like not properly escaping '/' in storage_name if it
was also the namespace separator. This also allows using the same character
for both vname_escape_char and storage_name_escape_char.

4 years agolib-storage: mailbox_list_default_get_vname() - Fix escaping namespace separator...
Timo Sirainen [Thu, 14 Jan 2021 15:07:34 +0000 (17:07 +0200)] 
lib-storage: mailbox_list_default_get_vname() - Fix escaping namespace separator in storage_name

For example if { storage_name="foo/bar", storage_sep=".", ns_sep="/" }
the "/" in the name shouldn't be treated as a namespace separator.
If vname_escape_char is set, it should be returned escaped instead.

4 years agolib-storage: Use imap_escaped_utf8_to_utf7()
Timo Sirainen [Thu, 14 Jan 2021 14:38:04 +0000 (16:38 +0200)] 
lib-storage: Use imap_escaped_utf8_to_utf7()

4 years agolib-storage: Use imap_escaped_utf8_hex_to_char()
Timo Sirainen [Thu, 14 Jan 2021 14:32:25 +0000 (16:32 +0200)] 
lib-storage: Use imap_escaped_utf8_hex_to_char()

4 years agolib-storage: Use mailbox_list_settings.vname_escape_char also with utf8 storage names
Timo Sirainen [Thu, 14 Jan 2021 14:23:24 +0000 (16:23 +0200)] 
lib-storage: Use mailbox_list_settings.vname_escape_char also with utf8 storage names

mailbox_list_default_get_storage_name() was already unescaping with utf8,
so mailbox_list_default_get_vname() should also be escaping with utf8.

4 years agolib-storage: mailbox_list_default_get_vname() - Use imap_utf7_to_utf8_escaped()
Timo Sirainen [Thu, 14 Jan 2021 13:40:44 +0000 (15:40 +0200)] 
lib-storage: mailbox_list_default_get_vname() - Use imap_utf7_to_utf8_escaped()

This changes the output a bit for broken mUTF7 names. Previously if any
part of the string had broken mUTF7 input, none of it was converted.
Now it's instead trying to convert as much as it can.

4 years agolib-storage: mailbox_list_default_get_vname() - Escape each hierarchical name separately
Timo Sirainen [Thu, 14 Jan 2021 13:09:34 +0000 (15:09 +0200)] 
lib-storage: mailbox_list_default_get_vname() - Escape each hierarchical name separately

Same reasoning as for the similar change for
mailbox_list_default_get_storage_name().

4 years agolib-storage: Split off mailbox_list_storage_name_prepare()
Timo Sirainen [Thu, 14 Jan 2021 10:47:55 +0000 (12:47 +0200)] 
lib-storage: Split off mailbox_list_storage_name_prepare()

4 years agolib-storage: mailbox_list_default_get_storage_name() - Escape each hierarchical name...
Timo Sirainen [Thu, 14 Jan 2021 10:34:48 +0000 (12:34 +0200)] 
lib-storage: mailbox_list_default_get_storage_name() - Escape each hierarchical name separately

This makes it possible in the following commits to allow unescaping to
write namespace hierarchy separator character without converting it into
the mailbox_list separator.

4 years agolib-storage: mailbox_list_default_get_storage_name() - Cleanup shared namespace root...
Timo Sirainen [Thu, 14 Jan 2021 10:30:54 +0000 (12:30 +0200)] 
lib-storage: mailbox_list_default_get_storage_name() - Cleanup shared namespace root handling

4 years agolib-storage: Split off mailbox_list_vname_prepare()
Timo Sirainen [Thu, 14 Jan 2021 10:03:58 +0000 (12:03 +0200)] 
lib-storage: Split off mailbox_list_vname_prepare()

This also slightly changes the code logic. mailbox_list_escape_name() is
now called also for INBOX, but that doesn't actually matter.

4 years agolib-storage: Remove mailbox_list_unescape_name() by moving its code inline
Timo Sirainen [Thu, 14 Jan 2021 13:22:20 +0000 (15:22 +0200)] 
lib-storage: Remove mailbox_list_unescape_name() by moving its code inline

There was only a single caller for this function. It doesn't need to exist.

4 years agolib-storage: Remove mailbox_list_escape_name() by moving its code inline
Timo Sirainen [Thu, 14 Jan 2021 13:20:13 +0000 (15:20 +0200)] 
lib-storage: Remove mailbox_list_escape_name() by moving its code inline

There was only a single caller for this function. It doesn't need to exist.

4 years agolib-storage: Add unit tests for mailbox_list_default_get_{storage_name|vname}()
Timo Sirainen [Wed, 13 Jan 2021 18:55:43 +0000 (20:55 +0200)] 
lib-storage: Add unit tests for mailbox_list_default_get_{storage_name|vname}()

4 years agolib-storage: Rename mailbox_list_settings.broken_char to vname_escape_char
Timo Sirainen [Wed, 13 Jan 2021 16:50:38 +0000 (18:50 +0200)] 
lib-storage: Rename mailbox_list_settings.broken_char to vname_escape_char

This clarifies that it's only used in vnames.

4 years agolib-storage: Rename mailbox_list_settings.escape_char to storage_name_escape_char
Timo Sirainen [Wed, 13 Jan 2021 16:47:11 +0000 (18:47 +0200)] 
lib-storage: Rename mailbox_list_settings.escape_char to storage_name_escape_char

This clarifies that it's only used in storage_names.

4 years agolib-imap: Add imap_utf7_to_utf8_escaped() and imap_escaped_utf8_to_utf7()
Timo Sirainen [Wed, 13 Jan 2021 17:50:50 +0000 (19:50 +0200)] 
lib-imap: Add imap_utf7_to_utf8_escaped() and imap_escaped_utf8_to_utf7()

These can be used to convert invalid mUTF-7 to escaped UTF-8 and back to the
original invalid input.

4 years agolib-imap: test-imap-utf7 - Simplify test_imap_utf7_non_utf16()
Timo Sirainen [Wed, 13 Jan 2021 17:48:15 +0000 (19:48 +0200)] 
lib-imap: test-imap-utf7 - Simplify test_imap_utf7_non_utf16()

4 years agolib-imap: Move unnecessary shift check to mbase64_decode_to_utf8()
Timo Sirainen [Wed, 13 Jan 2021 17:19:37 +0000 (19:19 +0200)] 
lib-imap: Move unnecessary shift check to mbase64_decode_to_utf8()

4 years agolib-imap: test-imap-utf7 - Improve/clarify testing '&'
Timo Sirainen [Wed, 13 Jan 2021 17:17:18 +0000 (19:17 +0200)] 
lib-imap: test-imap-utf7 - Improve/clarify testing '&'

& is never base64-encoded.

4 years agoconfig: Add unit test for config parser
Aki Tuomi [Mon, 25 Jan 2021 11:32:18 +0000 (13:32 +0200)] 
config: Add unit test for config parser

4 years agoconfig: Extract sources to libconfig.la
Aki Tuomi [Wed, 20 Jan 2021 08:07:56 +0000 (10:07 +0200)] 
config: Extract sources to libconfig.la

Makes unit testing possible

4 years agolib-settings: test-settings - Add tests for settings file
Aki Tuomi [Tue, 19 Jan 2021 09:54:15 +0000 (11:54 +0200)] 
lib-settings: test-settings - Add tests for settings file

4 years agotest-settings-parser: Add test for size
Aki Tuomi [Mon, 18 Jan 2021 13:43:06 +0000 (15:43 +0200)] 
test-settings-parser: Add test for size

4 years agolib-settings: test-settings-parser - Add test for settings parser
Aki Tuomi [Mon, 18 Jan 2021 13:32:51 +0000 (15:32 +0200)] 
lib-settings: test-settings-parser - Add test for settings parser

4 years agolib-settings: Add support for $ENV:name
Aki Tuomi [Mon, 18 Jan 2021 12:11:28 +0000 (14:11 +0200)] 
lib-settings: Add support for $ENV:name

Expands into given environment variable

4 years agoconfig: Add support for $ENV:name
Aki Tuomi [Wed, 22 Jan 2020 12:34:15 +0000 (14:34 +0200)] 
config: Add support for $ENV:name

Expands into given environment variable

4 years agoconfig: Expand multiple variables per line
Aki Tuomi [Wed, 22 Jan 2020 12:33:38 +0000 (14:33 +0200)] 
config: Expand multiple variables per line

Needed to properly support environment variables.

4 years agoconfig: config-parser - Add config_write_keyvariable
Aki Tuomi [Wed, 20 Jan 2021 08:49:23 +0000 (10:49 +0200)] 
config: config-parser - Add config_write_keyvariable

Move code handling key variable expansion to separate function.
Simplifies next commit.

4 years agolib-storage: Make lua methods and functions use the passed in lua_State * directly
Josef 'Jeff' Sipek [Tue, 12 Jan 2021 18:53:19 +0000 (13:53 -0500)] 
lib-storage: Make lua methods and functions use the passed in lua_State * directly

4 years agolib-storage: Make dlua_push_mail() take lua_State * directly
Josef 'Jeff' Sipek [Tue, 12 Jan 2021 19:27:31 +0000 (14:27 -0500)] 
lib-storage: Make dlua_push_mail() take lua_State * directly

4 years agolib-storage: Make dlua_push_mail_user() take lua_State * directly
Josef 'Jeff' Sipek [Tue, 12 Jan 2021 19:26:07 +0000 (14:26 -0500)] 
lib-storage: Make dlua_push_mail_user() take lua_State * directly

4 years agolib-storage: Make lua_storage_cmp() take lua_State * directly
Josef 'Jeff' Sipek [Tue, 12 Jan 2021 18:30:45 +0000 (13:30 -0500)] 
lib-storage: Make lua_storage_cmp() take lua_State * directly

4 years agolib-storage: Make lua_check_storage_mailbox() take lua_State * directly
Josef 'Jeff' Sipek [Tue, 12 Jan 2021 17:59:39 +0000 (12:59 -0500)] 
lib-storage: Make lua_check_storage_mailbox() take lua_State * directly

4 years agolib-storage: Make dlua_push_mailbox() take lua_State * directly
Josef 'Jeff' Sipek [Tue, 12 Jan 2021 17:02:05 +0000 (12:02 -0500)] 
lib-storage: Make dlua_push_mailbox() take lua_State * directly

4 years agomaster: Send instance_name setting to log process
Timo Sirainen [Thu, 7 Jan 2021 16:12:27 +0000 (18:12 +0200)] 
master: Send instance_name setting to log process

This way log process can use it for syslog ident

4 years agocassandra: Fix logging messages with LFs
Timo Sirainen [Mon, 7 Dec 2020 13:58:00 +0000 (15:58 +0200)] 
cassandra: Fix logging messages with LFs

At least some trace level messages had them.

4 years agom4: Fix configuration of libunwind on i386 (and probably other systems).
Stephan Bosch [Sat, 18 Apr 2020 10:56:14 +0000 (12:56 +0200)] 
m4: Fix configuration of libunwind on i386 (and probably other systems).

Use the standard libunwind-coredump instead of the system-dependent library.
This way, all can be configured using pkg-config, without relying on a failed
attempt to use the $build_cpu variable to find the system-dependent library.
This fails on i386 and probably other systems as well.

4 years agolib-imap: imap_bodystructure_write() - Add asserts to check unexpected NULLs inside...
Timo Sirainen [Wed, 25 Mar 2020 14:20:08 +0000 (16:20 +0200)] 
lib-imap: imap_bodystructure_write() - Add asserts to check unexpected NULLs inside lists

This just changes the assert that already triggers into a bit clearer
assert.

4 years agolib-imap: Add unit test for invalid BODYSTRUCTUREs
Timo Sirainen [Wed, 25 Mar 2020 13:52:29 +0000 (15:52 +0200)] 
lib-imap: Add unit test for invalid BODYSTRUCTUREs

4 years agolib-imap: imap_arg_get/as_nstring() - fail if input is an atom
Timo Sirainen [Wed, 25 Mar 2020 13:52:02 +0000 (15:52 +0200)] 
lib-imap: imap_arg_get/as_nstring() - fail if input is an atom

Atoms were wrongly allowed in these places.

These have been used in very few places, so this change should be pretty
safe to do. The only affected places are:

 * SETMETADATA - Backwards compatibility preserved by earlier commit
 * ID - It's not expected that any clients use atoms here
 * imapc - Server replies are parsed more strictly now

4 years agolib-imap: Don't wrongly accept NILs or atoms when parsing BODYSTRUCTURE
Timo Sirainen [Wed, 25 Mar 2020 13:49:37 +0000 (15:49 +0200)] 
lib-imap: Don't wrongly accept NILs or atoms when parsing BODYSTRUCTURE

Especially NILs could cause crashes later on when some internal field is
NULL when it's not expectedly to be.

Fixes a crash when parsing BODYSTRUCTURE and writing it out with
imap_bodystructure_write() when some of the parameter lists contained NILs.

4 years agolib-imap: imap_body_parse_from_bodystructure() - Write size field as atom
Timo Sirainen [Wed, 25 Mar 2020 13:47:51 +0000 (15:47 +0200)] 
lib-imap: imap_body_parse_from_bodystructure() - Write size field as atom

Following changes will break writing it as nstring.

4 years agoimap: SETMETADATA - Explicitly support using atoms for values
Timo Sirainen [Wed, 25 Mar 2020 14:00:08 +0000 (16:00 +0200)] 
imap: SETMETADATA - Explicitly support using atoms for values

Required to keep atoms working (and especially not assert-crashing) after
the following imap_arg_get_nstring() change.

4 years agolib: event-filter - Implement event_filter_merge() unit test
Josef 'Jeff' Sipek [Wed, 20 Jan 2021 16:15:18 +0000 (11:15 -0500)] 
lib: event-filter - Implement event_filter_merge() unit test

4 years agolib: event-filter - Use p_strdup() instead of p_strdup_empty() to avoid NULLs
Josef 'Jeff' Sipek [Tue, 12 Jan 2021 16:15:44 +0000 (11:15 -0500)] 
lib: event-filter - Use p_strdup() instead of p_strdup_empty() to avoid NULLs

The code used p_strdup_empty() in an (incorrect) attempt to avoid NULLs
turning into empty strings ("").  None of the strdup variants do this.
However, p_strdup_empty() converts empty strings to NULLs.  This caused a
NULL pointer dereference later on.

4 years agolib: test-lib - Free event filters
Aki Tuomi [Thu, 21 Jan 2021 07:15:10 +0000 (09:15 +0200)] 
lib: test-lib - Free event filters

Fixes memory leak

Forgotten from 01ccf687d660331ca3e483c90582156757cebb7f

4 years agolib: event-filter - Implement filter boolean expression unit tests
Josef 'Jeff' Sipek [Tue, 19 Jan 2021 18:46:13 +0000 (13:46 -0500)] 
lib: event-filter - Implement filter boolean expression unit tests

This is a exhaustive test of the boolean operators using field equality
comparisons.  This test code focuses on the boolean operators (AND, OR,
NOT) and not on the comparison operators (=, <, >, <=, and >=) and their
arguments (event names, source locations, categories).

4 years agolib: event-filter - Correct a comment referring to old filter syntax
Josef 'Jeff' Sipek [Tue, 19 Jan 2021 18:42:17 +0000 (13:42 -0500)] 
lib: event-filter - Correct a comment referring to old filter syntax

4 years agolib: event-filter - Add a helper function to get at the filter's boolean expression
Josef 'Jeff' Sipek [Tue, 19 Jan 2021 18:41:45 +0000 (13:41 -0500)] 
lib: event-filter - Add a helper function to get at the filter's boolean expression

This is necessary for the soon-to-be-implemented unit tests.

4 years agolib: event-filter - Expose internal functions to allow for unit testing
Josef 'Jeff' Sipek [Tue, 19 Jan 2021 18:40:17 +0000 (13:40 -0500)] 
lib: event-filter - Expose internal functions to allow for unit testing

We'll need these to avoid code duplication when unit testing the boolean
expression evaluation logic.

4 years agolib: event-filter - Make NOT operator right associative and higher precedence
Josef 'Jeff' Sipek [Mon, 4 Jan 2021 17:01:28 +0000 (12:01 -0500)] 
lib: event-filter - Make NOT operator right associative and higher precedence

For example, consider the filter:

    event=* AND
    NOT event=foo AND
    NOT event=bar AND
    NOT event=baz

The "NOT" operator is supposed to be bound to the comparisons to the
immediate right.  That is, it supposed to be equivalent to:

    event=* AND
    (NOT event=foo) AND
    (NOT event=bar) AND
    (NOT event=baz)

Both of these should produce the following parse tree:

    AND
      AND
        AND
          EQ EVENT '*'
          NOT
            EQ EVENT 'foo'
        NOT
          EQ EVENT 'bar'
      NOT
        EQ EVENT 'baz'

Instead, before this commit, the NOTs were getting bound to the entire
sub-expression to the right.  Therefore, the original filter expression
was being parsed as if it were:

    event=* AND
    NOT (event=foo AND
         NOT (event=bar AND
              NOT event=baz))

Which produced the following parse tree:

    AND
      EQ EVENT '*'
      NOT
        AND
          EQ EVENT 'foo'
          NOT
            AND
              EQ EVENT 'bar'
              NOT
                EQ EVENT 'baz'

4 years agolib-test: fuzzer - Don't crash in targets without ioloop
Philippe Antoine [Thu, 14 Jan 2021 19:31:18 +0000 (20:31 +0100)] 
lib-test: fuzzer - Don't crash in targets without ioloop

4 years agoauth: Makefile.am - Use $(LIBDOVECOT_LUA) instead of redefining it
Timo Sirainen [Mon, 18 Jan 2021 16:53:36 +0000 (17:53 +0100)] 
auth: Makefile.am - Use $(LIBDOVECOT_LUA) instead of redefining it

4 years agoauth: Fix building built-in lua
Timo Sirainen [Mon, 18 Jan 2021 16:53:07 +0000 (17:53 +0100)] 
auth: Fix building built-in lua

It was working only when building as plugin.

4 years agolib: test-buffer - Fix memory leak errors in fatal buffer tests
Timo Sirainen [Mon, 18 Jan 2021 12:46:55 +0000 (13:46 +0100)] 
lib: test-buffer - Fix memory leak errors in fatal buffer tests

4 years agolib-test: Add test_fatal_set_callback()
Timo Sirainen [Mon, 18 Jan 2021 12:46:46 +0000 (13:46 +0100)] 
lib-test: Add test_fatal_set_callback()

4 years agolib-master: test-event-stats - Add test for large event id
Aki Tuomi [Mon, 18 Jan 2021 09:38:04 +0000 (11:38 +0200)] 
lib-master: test-event-stats - Add test for large event id

Ensure UPDATE command syntax is correct when event id is over 1 million

4 years agoindexer: Remove worker-specific request queue
Siavash Tavakoli [Mon, 21 Dec 2020 10:45:32 +0000 (10:45 +0000)] 
indexer: Remove worker-specific request queue

- Each request is done in a single connection and indexer master disconnects
from worker after indexing job is complete.
- No need to keep a worker queue since it always have length of 1. Instead,
keep a pointer to indexer_request for each worker connection.
- If indexing is in progress for a user, don't try to use the same connection
when a new request arrives for the same user. Instead, move the request to the
back of the queue and wait for the in progress request to finish then
create a new connection and submit request to worker.

4 years agoindexer: Cleanup idle_list from worker pool
Siavash Tavakoli [Sun, 20 Dec 2020 19:45:09 +0000 (19:45 +0000)] 
indexer: Cleanup idle_list from worker pool

- Indexer always disconnects from worker process, no need to keep a list
of idle processes.
- The callback already calls worker_pool_release_connection every time worker
updated percentage. Defer disconnecting from working to the callback.
It checks if the request is completed and destroys connection.

4 years agoindexer: Disconnect from indexer-worker after each request
Siavash Tavakoli [Mon, 14 Dec 2020 21:39:39 +0000 (21:39 +0000)] 
indexer: Disconnect from indexer-worker after each request

This allows indexer-worker to properly handle service configurations such as
service_count and idle_kill time.

4 years agolib: array - Make sure it assert-crashes if trying to add more than UINT_MAX elements
Timo Sirainen [Wed, 20 May 2020 08:18:48 +0000 (11:18 +0300)] 
lib: array - Make sure it assert-crashes if trying to add more than UINT_MAX elements

This is required, because array_count() returns unsigned int.

4 years agolib: Add buffer_create_dynamic_max()
Timo Sirainen [Wed, 20 May 2020 08:16:29 +0000 (11:16 +0300)] 
lib: Add buffer_create_dynamic_max()

4 years agolib: hash - Add assert to make sure hash table doesn't grow beyond UINT_MAX nodes
Timo Sirainen [Wed, 20 May 2020 10:42:22 +0000 (13:42 +0300)] 
lib: hash - Add assert to make sure hash table doesn't grow beyond UINT_MAX nodes

hash_table_count() returns unsigned int, so the node count can't be larger.
It's internally also tracked as unsigned int currently. It should be large
enough for all practical use cases.

4 years agoauth: db-lua - Deref script in auth_lua_call_userdb_iterate_init() only once
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 22:48:37 +0000 (17:48 -0500)] 
auth: db-lua - Deref script in auth_lua_call_userdb_iterate_init() only once

4 years agoauth: db-lua - Deref script in auth_lua_call_userdb_lookup() only once
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 22:47:57 +0000 (17:47 -0500)] 
auth: db-lua - Deref script in auth_lua_call_userdb_lookup() only once

4 years agoauth: db-lua - Deref script in auth_lua_call_passdb_lookup() only once
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 22:47:03 +0000 (17:47 -0500)] 
auth: db-lua - Deref script in auth_lua_call_passdb_lookup() only once

4 years agoauth: db-lua - Deref script in auth_lua_call_password_verify() only once
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 22:46:20 +0000 (17:46 -0500)] 
auth: db-lua - Deref script in auth_lua_call_password_verify() only once

4 years agoauth: db-lua - Make auth_lua_dovecot_auth_register() take lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 22:44:16 +0000 (17:44 -0500)] 
auth: db-lua - Make auth_lua_dovecot_auth_register() take lua_State * directly

4 years agoauth: db-lua - Make auth_lua_auth_request_register() take lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 22:43:36 +0000 (17:43 -0500)] 
auth: db-lua - Make auth_lua_auth_request_register() take lua_State * directly

4 years agoauth: db-lua - Make auth_lua_call_lookup_finish() take lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 22:39:24 +0000 (17:39 -0500)] 
auth: db-lua - Make auth_lua_call_lookup_finish() take lua_State * directly

4 years agoauth: db-lua - Make auth_lua_export_passdb_table() take lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 22:37:10 +0000 (17:37 -0500)] 
auth: db-lua - Make auth_lua_export_passdb_table() take lua_State * directly

4 years agoauth: db-lua - Make auth_lua_call_lookup() take lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 22:35:21 +0000 (17:35 -0500)] 
auth: db-lua - Make auth_lua_call_lookup() take lua_State * directly

4 years agoauth: db-lua - Make auth_lua_export_userdb_table() take lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 22:32:50 +0000 (17:32 -0500)] 
auth: db-lua - Make auth_lua_export_userdb_table() take lua_State * directly