The code analyzer is not able to properly infer that str_begins_builtin_success()
cannot be invoked when the previous strncmp() does not match. It then complies
about overrun pointers arithmetic that is just not possible to happen.
Karl Fleischmann [Mon, 21 Feb 2022 15:11:39 +0000 (16:11 +0100)]
auth: Clean up naming for auth worker connections
Similar to the indexer this commit consolidates the naming of the
auth-worker setup into a header file. This reduces the effort to write
the appropriate name correctly in 4 different places.
auth: Improve consistency with auth-worker timeout values
- Split values into numeric value and factor for next larger timeframe
(i.e. 60 for minutes, 1000 for seconds), and
- order them to be numeric value first, factor last for consistency.
auth: Refactor auth worker callbacks to use arguments
To prepare a refactor of the auth worker input handling to use the
connection API this commit changes the signature of the auth worker
callback to use an arguments array instead of the full line as well as
all relevant callback functions.
Karl Fleischmann [Fri, 18 Feb 2022 09:11:14 +0000 (10:11 +0100)]
auth: auth_worker_server - Use connection.h structures
This commit prepares a refactor of auth-worker-server to use the
connection API by introducing the connection.h structures.
Keep the lookup timeout extra in the worker as there are more distinct
use-cases for it than the connection API would handle.
Timo Sirainen [Fri, 10 Apr 2020 16:08:24 +0000 (19:08 +0300)]
lib: Fix str_begins() unit test
c05976729405180c565aad464cb494c731a640b3 replaced all strncmp() calls to
str_begins(). This caused str_begins() to be tested against str_begins()
itself, which obviously always works. Reverted the change.
Timo Sirainen [Thu, 14 Oct 2021 22:11:06 +0000 (00:11 +0200)]
imap-login: proxy: Fix STARTTLS failure message
The error message blindly skipped over 3 bytes after the tagged "S " reply.
This was okay if the reply was "NO", but wrong if the reply was "BAD". Also
nothing really guarantees that a broken server couldn't have just returned
a truncated "S " string, in which case the error would point to garbage.
Timo Sirainen [Thu, 14 Oct 2021 22:21:30 +0000 (00:21 +0200)]
lib: Fix memory pool names with DEBUG_SILENT=1
When compiling with --enable-devel-checks and running with DEBUG_SILENT=1,
the memory pool names were skipping over the first 8 bytes in the name.
This was supposed to be done only if the name begins with MEMPOOL_GROWING.
Timo Sirainen [Wed, 2 Mar 2022 14:39:30 +0000 (09:39 -0500)]
dsync: Fix hierarchical mailbox name parts individually
For example with filesystem-based mailbox formats it's not allowed to create
"box/../child" mailbox. With previous code dsync just gave up and created
the mailbox name based on its GUID. This is now improved to instead try to
insert '_' character after each hierarchy separator so the newly fixed
mailbox name is "box/_../child".
This commit removes the read support that was left behind to allow for more
gradual migration from lzma/xz.
The code had bugs. Additionally, there is no benefit in keeping it around.
bzip2 or zstd (at maximum compression level) are likely better choices for
archival. For non-archival usecases, a light compression algorithm like
zstd (at low to medium compression level) or lz4 are better choices.
Siavash Tavakoli [Mon, 25 Oct 2021 11:23:56 +0000 (12:23 +0100)]
lib-lua: Add a minimal interface to lib-http
Adds the ability to
- Creating http clients
- Creating http requests
- Adding arbitrary headers and payload to the http request
- Submitting the request to remote server and getting the response
Markus Valentin [Thu, 3 Mar 2022 13:21:00 +0000 (14:21 +0100)]
imapc: imapc_connection_disconnect_full() - Only conditionally abort
Only abort commands if there are no reconnect commands. Otherwise these
still will be handled and the commands memory will be freed after handling
them.
If the imapc connection was already disconnected when calling
imapc_connection_disconnect() it didn't clean up the commands and
especially the command pools.
build-aux: run-test.sh.in - Capture exit codes before set -e ends the script
With set -e, the script ends on any nonzero exit code and that would
leave the valgrind output unchecked. Fix the exit code capture so
valgrind output is correctly shown.
Stephan Bosch [Tue, 1 Feb 2022 00:33:53 +0000 (01:33 +0100)]
lmtp: lmtp-proxy - Use port 24 as default for proxy.
LMTP has no officially registered default service port, but 24 is the de-facto
standard. When client connects through TCP, the local client port number is used
to setup the proxy connection as well. However, when the client connects through a
unix socket, there is no port number to use and a default is needed.