]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
Timo Sirainen [Sun, 15 Sep 2019 18:52:39 +0000 (21:52 +0300)]
lib-dict-backend: Remove cache for prepared statements
Timo Sirainen [Sun, 15 Sep 2019 18:49:13 +0000 (21:49 +0300)]
lib-sql: Rename sql_prepared_statement_deinit() to _unref()
Timo Sirainen [Sun, 15 Sep 2019 18:45:18 +0000 (21:45 +0300)]
lib-sql: Keep prepared statements in memory until db is deinitialized
There aren't supposed to be many different prepared statements.
Timo Sirainen [Sun, 15 Sep 2019 18:39:07 +0000 (21:39 +0300)]
lib-sql: Try to reuse prepared statements if possible
Timo Sirainen [Sun, 15 Sep 2019 20:45:30 +0000 (23:45 +0300)]
lib-sql: Fix the new sql_db refcounting to work with sql-db-cache
Timo Sirainen [Sun, 15 Sep 2019 20:15:33 +0000 (23:15 +0300)]
lib-sql: Add refcounting to sql_db
Timo Sirainen [Sun, 15 Sep 2019 18:35:01 +0000 (21:35 +0300)]
lib-sql: Move query_template to struct sql_prepared_statement directly
Markus Valentin [Wed, 10 Jul 2019 13:45:51 +0000 (15:45 +0200)]
lib-storage: fix typo in mailbox-list-iter.h
Timo Sirainen [Wed, 4 Sep 2019 09:11:43 +0000 (12:11 +0300)]
imap-hibernate: Fix crash if unhibernation fd_send() fails
The imap-master connection needs to be freed when the client is freed.
Otherwise it attempts to free the client again.
Timo Sirainen [Wed, 11 Sep 2019 08:11:57 +0000 (11:11 +0300)]
lib: i_stream_get_data() - Mark invalid buffer code path unlikely
This really isn't expected to happen, so marking it unlikely optimizes
slightly callers that cause i_stream_get_data() to be called a huge number
of times.
Timo Sirainen [Tue, 10 Sep 2019 07:14:24 +0000 (10:14 +0300)]
doveadm fs: Use mail_temp_dir as temp_dir for fs operations' temp_dir
Timo Sirainen [Tue, 10 Sep 2019 07:50:14 +0000 (10:50 +0300)]
doveadm: Expand variables in doveadm_settings
Required by the next commit.
Timo Sirainen [Tue, 10 Sep 2019 07:48:32 +0000 (10:48 +0300)]
doveadm: Use a memory pool for duplicating settings
Required by the next commit.
Timo Sirainen [Mon, 9 Sep 2019 09:24:00 +0000 (12:24 +0300)]
auth: If user is already authenticated, passdb result shouldn't be password_mismatch
This caused confusion in the auth_request_passdb_finished event's result
parameter. Otherwise it shouldn't have caused any bugs.
Timo Sirainen [Mon, 9 Sep 2019 09:21:39 +0000 (12:21 +0300)]
auth: Add and use auth_request_password_missing() where possible
Timo Sirainen [Mon, 9 Sep 2019 09:08:33 +0000 (12:08 +0300)]
auth: Add passdb_id and userdb_id to auth_request_passdb/userdb_* events
Timo Sirainen [Wed, 4 Sep 2019 14:13:15 +0000 (17:13 +0300)]
lib-auth: Fix auth_client_is_connected() to work after disconnection
Timo Sirainen [Mon, 9 Sep 2019 14:57:14 +0000 (17:57 +0300)]
lib-http: test-http-client should use PKG_RUNDIR/dns-client
Instead of hardcoded /var/run/dovecot/dns-client
Timo Sirainen [Fri, 6 Sep 2019 13:49:44 +0000 (16:49 +0300)]
lib, lib-program-client: Fix i_stream_read_memarea() usage
Calling it may change the stream's buffer and free the old buffer. However,
some istreams didn't change the buffer if i_stream_read_memarea() returned
-2. The old buffer was kept referenced, which could have caused the istream
to read garbage or crash due to accessing freed memory.
This fixes:
* istream-limit
* istream-sized
* istream-rawlog
* program-client-istream
* Anything using i_stream_read_copy_from_parent(), which includes:
* istream-fs-file
* istream-fs-stats
* istream-metawrap
* http-server-istream
* istream-header-filter
* istream-mail
* istream-failure-at
* istream-hash
* istream-timeout
* istream-try
Timo Sirainen [Thu, 5 Sep 2019 09:06:02 +0000 (12:06 +0300)]
lib-master: Event filter parsing - Accept "service:<name>"
This is short for "category:service:<name>"
Timo Sirainen [Thu, 5 Sep 2019 09:04:50 +0000 (12:04 +0300)]
lib-master: Code cleanup for handling event filter category parsing
Timo Sirainen [Thu, 5 Sep 2019 09:02:16 +0000 (12:02 +0300)]
lib, lib-master: Add service:<name> category for all events
Timo Sirainen [Thu, 5 Sep 2019 08:59:20 +0000 (11:59 +0300)]
lib: Add EVENT_CALLBACK_TYPE_CREATE to call a callback on event creation
It's not called for event_dup() or event_flatten(), because those are based
on events that were already created.
Timo Sirainen [Thu, 5 Sep 2019 12:36:40 +0000 (15:36 +0300)]
lib: Add and use event_create_internal() wrapper
This avoids p_strdup()ing the source_filename twice. Also it'll be extended
by the following commit.
Timo Sirainen [Thu, 5 Sep 2019 12:42:34 +0000 (15:42 +0300)]
lib: event_set_source() - Avoid p_strdup() if source filename doesn't change
Timo Sirainen [Thu, 5 Sep 2019 12:41:54 +0000 (15:41 +0300)]
lib: event_import_unescaped() - Use event_set_source() to set the source
Timo Sirainen [Thu, 5 Sep 2019 08:58:48 +0000 (11:58 +0300)]
lib: Add and use event_call_callbacks_noargs() helper
Timo Sirainen [Thu, 5 Sep 2019 08:57:20 +0000 (11:57 +0300)]
lib, lib-master: Remove event.call_free
Just call the EVENT_CALLBACK_TYPE_FREE always. Having this flag isn't
really going to affect the performance, and it might be useful in the
future to work this way.
Only the unit test was relying on call_free to be different from
id_sent_to_stats. This commit changes the unit test to check for the
END strings where necessary.
Timo Sirainen [Thu, 5 Sep 2019 08:52:05 +0000 (11:52 +0300)]
lib: Rename event_send_callbacks() to event_call_callbacks()
Timo Sirainen [Thu, 5 Sep 2019 08:51:44 +0000 (11:51 +0300)]
lib: Move event_send_callbacks() and event_send_free() earlier in the file
Timo Sirainen [Thu, 5 Sep 2019 08:48:27 +0000 (11:48 +0300)]
lib, lib-master: Rename EVENT_CALLBACK_TYPE_EVENT to _SEND
This describes the functionality better.
Stephan Bosch [Thu, 5 Sep 2019 11:06:28 +0000 (13:06 +0200)]
lib: test-istream-base64-decoder - Make random test also test CRLF vs LF line endings at random.
Stephan Bosch [Thu, 5 Sep 2019 09:50:04 +0000 (11:50 +0200)]
lib: test-istream-base64-decoder - Add explicit test cases for decoding the empty string.
Stephan Bosch [Thu, 5 Sep 2019 09:45:02 +0000 (11:45 +0200)]
lib: test-base64 - Add explicit test cases for encoding/decoding the empty string.
Stephan Bosch [Thu, 5 Sep 2019 00:31:58 +0000 (02:31 +0200)]
lib: base64 - Add assertion preventing calling base64_encode_more() after base64_encode_finish().
Stephan Bosch [Wed, 4 Sep 2019 23:13:46 +0000 (01:13 +0200)]
lib: test-istream-base64-decoder - Reduce minimum random stream buffer size to 1.
Stephan Bosch [Wed, 4 Sep 2019 23:11:53 +0000 (01:11 +0200)]
lib: test-istream-base64-decoder - Abort random test at first error and print parameters.
Stephan Bosch [Wed, 4 Sep 2019 21:40:25 +0000 (23:40 +0200)]
lib: test-istream-base64-encoder - Fix test names.
Stephan Bosch [Wed, 4 Sep 2019 21:37:11 +0000 (23:37 +0200)]
lib: test-base64 - Abort random test at first error and print parameters.
Stephan Bosch [Wed, 4 Sep 2019 21:16:24 +0000 (23:16 +0200)]
lib: test-base64 - Test Base64 encoding with maximum line length of 1.
This corner case is a useful test for problems in the line encoding.
Stephan Bosch [Wed, 4 Sep 2019 20:52:00 +0000 (22:52 +0200)]
lib: test-base64 - Better check output of incrementally encoded random Base64.
Check whether it is equal to the same data encoded as a single block and whether
the length matches the base64_get_full_encoded_size() output.
Stephan Bosch [Wed, 4 Sep 2019 20:44:03 +0000 (22:44 +0200)]
lib: base64 - Fix incremental/streaming Base64 encoding with CRLF line endings.
Line lengths became inconsistent due to a design error. The encoding itself
remained valid. The linefeed is no longer appended to the write buffer when the
destination buffer is full. Rather, a flag is set that makes the encoder emit
the linefeed immediately next time the encoder is called with more buffer
space. Appending it to the write buffer was wrong; it in fact needs to be
prepended and in that case a flag is more efficient.
Stephan Bosch [Wed, 4 Sep 2019 23:17:55 +0000 (01:17 +0200)]
lib: base64 - Restructure base64_encode_get_size().
Stephan Bosch [Wed, 4 Sep 2019 20:23:25 +0000 (22:23 +0200)]
lib: base64 - Use unsigned size type for base64_get_full_encoded_size().
Makes more sense.
Stephan Bosch [Wed, 4 Sep 2019 16:34:30 +0000 (18:34 +0200)]
lib: base64 - Truly fix dest buffer assertion in base64_decode_more().
Previous fix was inadequate in the presence of padding at the end of input.
Stephan Bosch [Thu, 5 Sep 2019 12:21:53 +0000 (14:21 +0200)]
lib: test-istream-base64-decoder - Use unsigned int for bit field in random test.
Josef 'Jeff' Sipek [Tue, 23 Jul 2019 12:05:02 +0000 (08:05 -0400)]
global: Clean up MAX_INT_STRLEN usage
A number of MAX_INT_STRLEN consumers did not realize that it already
includes space for the trailing nul.
Timo Sirainen [Tue, 23 Jul 2019 10:56:18 +0000 (13:56 +0300)]
lib: Add comment to MAX_INT_STRLEN macro
Timo Sirainen [Wed, 4 Sep 2019 18:02:27 +0000 (21:02 +0300)]
auth: Set auth_request successful before auth_request_finished event
Otherwise the event never has success=yes parameter.
Timo Sirainen [Tue, 3 Sep 2019 14:46:39 +0000 (17:46 +0300)]
doveadm fs iter[-dirs]: Add --object-ids and --no-cache parameters
Timo Sirainen [Wed, 4 Sep 2019 12:02:11 +0000 (15:02 +0300)]
imap-old-stats: Fix plugin dependency variable names
Timo Sirainen [Wed, 4 Sep 2019 12:43:06 +0000 (15:43 +0300)]
master: Don't log "Sent SIGKILL to .. processes" when actually sending SIGUSR1
The SIGUSR1 is sent when all login processes are full and can't accept any
more connections. This should be handled silently by the master.
Timo Sirainen [Wed, 4 Sep 2019 12:38:09 +0000 (15:38 +0300)]
lib-auth: Remove "BUG:" prefix from "Authentication server sent unknown id" error
It's not necessarily a bug.
Timo Sirainen [Wed, 4 Sep 2019 12:35:55 +0000 (15:35 +0300)]
lib-auth: Don't disconnect from auth server when receiving "unknown id"
It doesn't mean that the state between auth client and server is broken.
Just that the client had already forgotten about some of the IDs.
This also means that the "unknown id" lines aren't treated as invalid lines.
Previously the whole OK/FAIL line may have been logged, which could have
included e.g. passwords.
Timo Sirainen [Wed, 4 Sep 2019 10:52:10 +0000 (13:52 +0300)]
push-notification-lua: Use the new accessor functions instead of variables directly
This fixes plugin dependency checking. Instead of:
Fatal: Couldn't load required plugin .../lib22_push_notification_lua_plugin.so: dlopen() failed: /usr/local/lib/dovecot/lib22_push_notification_lua_plugin.so: undefined symbol: event_category_push_notification
The error is now clearer:
Fatal: Couldn't load required plugin .../lib22_push_notification_lua_plugin.so: Plugin push_notification must be loaded also
Timo Sirainen [Wed, 4 Sep 2019 10:51:26 +0000 (13:51 +0300)]
push-notification: Add accessor functions to global variables
These are enough for the current plugin. Maybe others will be needed in the
future.
Stephan Bosch [Wed, 4 Sep 2019 10:33:08 +0000 (12:33 +0200)]
lib: base64 - Fix dest buffer assertion in base64_decode_more().
The assertion is supposed to trigger when the encoder hits the buffer size limit
unexpectedly (src_pos_r==NULL means that all should be encoded at once). It
triggered erroneously when the destination buffer had the exact size needed
for the encoded data.
Stephan Bosch [Tue, 3 Sep 2019 19:45:35 +0000 (21:45 +0200)]
lib: test-istream-base64-decoder - Add extensive random base64 stream I/O unit test.
Stephan Bosch [Tue, 3 Sep 2019 19:44:55 +0000 (21:44 +0200)]
lib: istream-base64-encoder - Fix handling of error, EOF and stream buffer overflow conditions.
Stephan Bosch [Tue, 3 Sep 2019 19:43:31 +0000 (21:43 +0200)]
lib: istream-base64-decoder - Fix handling of error, EOF and stream buffer overflow conditions.
Stephan Bosch [Tue, 3 Sep 2019 16:37:57 +0000 (18:37 +0200)]
lib: base64 - Restructure encoder to always fill the output buffer as much as possible.
This is not strictly required, but makes the encoder easier to use in streams
and less bug-prone in incremental encoding applications in general.
Stephan Bosch [Tue, 3 Sep 2019 16:15:57 +0000 (18:15 +0200)]
lib: base64 - Allow encoding line endings one octet at a time.
Stephan Bosch [Tue, 3 Sep 2019 19:10:55 +0000 (21:10 +0200)]
lib: base64 - Add more w_buf_len assertions to encoder.
Stephan Bosch [Tue, 3 Sep 2019 19:04:20 +0000 (21:04 +0200)]
lib: base64 - Use sizeof() for determining the size of the encoder w_buf.
Stephan Bosch [Tue, 3 Sep 2019 10:22:16 +0000 (12:22 +0200)]
lib: base64 - Fix base64_get_full_encoded_size() for size 0.
Stephan Bosch [Mon, 2 Sep 2019 20:48:30 +0000 (22:48 +0200)]
lib: istream-base64-decoder - Use i_stream_try_alloc() properly.
Stephan Bosch [Mon, 2 Sep 2019 19:56:37 +0000 (21:56 +0200)]
lib: istream-base64-encoder - Use i_stream_try_alloc() properly.
Markus Valentin [Tue, 3 Sep 2019 12:38:17 +0000 (14:38 +0200)]
imap: previews/snippets requested with lazy update the caching decision
If lazy is true set the lookup_abort to NOT_IN_CACHE_START_CACHING
which results in the snippet field becoming wanted for caching.
Markus Valentin [Tue, 3 Sep 2019 12:33:03 +0000 (14:33 +0200)]
lib-storage: change caching decision for lazy requests in cache lookup
In case lookup_abort is set to NOT_IN_CACHE_START_CACHING update the
cacheing decision for the requested field.
Markus Valentin [Tue, 3 Sep 2019 12:30:15 +0000 (14:30 +0200)]
lib-storage: introduce MAIL_LOOKUP_ABORT_NOT_IN_CACHE_START_CACHING
In some cases we would like to mark an field as to be cached but still
don't fetch it now. For this occasions this change introduces a new enum
value for mail_lookup_abort which allows to implement such a behaviour.
Markus Valentin [Tue, 3 Sep 2019 12:16:41 +0000 (14:16 +0200)]
lib-index: move mail_cache_decision_add to public header
To allow other components to mark fields as to be cached move the
declaration from mail-cache-private.h to mail-cache.h.
Aki Tuomi [Wed, 4 Sep 2019 07:50:06 +0000 (10:50 +0300)]
virtual: Free mail event when virtual mail is free'd
Forgotten on
c499c40caf37f766968a551909190c5b009a9b15
Timo Sirainen [Tue, 3 Sep 2019 16:23:09 +0000 (19:23 +0300)]
lib: test-event-flatten - Fix compiler warnings
For example:
test-event-flatten.c:170:18: warning: missing field 'tv_usec' initializer
[-Wmissing-field-initializers]
Timo Sirainen [Tue, 3 Sep 2019 12:49:13 +0000 (15:49 +0300)]
global: Replace timeout_add_short(0) calls with io_set_pending() where possible
These timeouts were added before io_set_pending() existed. This won't fix
anything, but makes the code cleaner.
Timo Sirainen [Tue, 3 Sep 2019 12:47:18 +0000 (15:47 +0300)]
login-common: Don't call client_input() directly in clients_notify_auth_connected()
This probably won't fix anything, but it's cleaner to get to client_input()
always from IO loop directly. Although it might shrink data stack's memory
usage.
Timo Sirainen [Tue, 3 Sep 2019 12:43:49 +0000 (15:43 +0300)]
login-common: Don't call client_input() directly in client_auth_failed()
Fixes a new assert-crash caused by
9aaf0554aeae4f8056eeef56cfd99bf386f4c009 :
Panic: file sasl-server.c: line 357 (authenticate_callback): assertion failed: (!client->authenticating)
This was caused by a code path:
- sasl_server_check_login()
- sasl_server_auth_failed()
- sasl_server_auth_cancel()
- call_client_callback()
- sasl_callback()
- client_auth_failed()
- client_input()
- another AUTHENTICATE/LOGIN was read
The solution is then to not call client_input() directly. It would have
also worked to just remove the assert though, but this fix is cleaner.
Aki Tuomi [Tue, 3 Sep 2019 08:58:18 +0000 (11:58 +0300)]
lib-dcrypt: Add static keyword to ECDSA_SIG_get0
Otherwise compilers complain as it's not declared anywhere.
Aki Tuomi [Tue, 3 Sep 2019 08:57:51 +0000 (11:57 +0300)]
lib-dcrypt: Free EVP_MD_CTX in dcrypt_openssl_digest
Aki Tuomi [Tue, 3 Sep 2019 08:57:17 +0000 (11:57 +0300)]
lib-dcrypt: Free existing BIGNUMs in setters
Aki Tuomi [Tue, 3 Sep 2019 06:10:13 +0000 (09:10 +0300)]
lib-dcrypt: Add ECDSA_SIG_set0 and ECDSA_SIG_get0 when missing
These are needed for low-level operations
Aki Tuomi [Tue, 3 Sep 2019 06:06:29 +0000 (09:06 +0300)]
m4: Check for ECDSA_SIG_set0 and ECDSA_SIG_get0
These are not present in older libssl
Aki Tuomi [Mon, 2 Sep 2019 11:09:04 +0000 (14:09 +0300)]
lib-ssl-iostream: Remove problematic unit tests
These unit tests are unreliable with new versions of openssl
present in ubuntu 18 and debian buster.
Timo Sirainen [Sun, 1 Sep 2019 17:50:05 +0000 (20:50 +0300)]
auth: winbind - Make static analyzer happier
Aki Tuomi [Mon, 2 Sep 2019 11:17:50 +0000 (14:17 +0300)]
lib-dcrypt: Ignore padding when decoding base64url
Aki Tuomi [Mon, 2 Sep 2019 09:54:12 +0000 (12:54 +0300)]
dcrypt: Add signature format
Needed to implement RFC7515
Timo Sirainen [Fri, 26 Jul 2019 07:31:12 +0000 (10:31 +0300)]
global: Use mail_user_deinit() wherever possible
This makes sure that the user is fully deinitialized in the places where we
expect it to be.
This mainly makes sure that lmtp won't continue running code for the user
after lmtp has already switched to running as root. That could then end up
reading/writing files as root. This can happen only if there are bugs in
the code that leaks user references. Normally user is supposed to be fully
unreferenced before switching to root, so this change just adds an assert
to make sure it is.
Timo Sirainen [Fri, 26 Jul 2019 07:31:07 +0000 (10:31 +0300)]
lib-storage: Add mail_user_deinit()
Timo Sirainen [Fri, 30 Aug 2019 15:28:05 +0000 (18:28 +0300)]
man: Update "doveadm fts rescan" to say it usually just deletes FTS indexes
Aki Tuomi [Thu, 29 Aug 2019 14:09:55 +0000 (17:09 +0300)]
lib-dcrypt: Only use compressed points with dovecot internal formats
Aki Tuomi [Thu, 29 Aug 2019 13:54:27 +0000 (16:54 +0300)]
lib-dcrypt: Implement dcrypt_ecdh_derive_secret for OpenSSL
Aki Tuomi [Thu, 29 Aug 2019 13:43:45 +0000 (16:43 +0300)]
lib-dcrypt: Move shared secret derivation to dcrypt_openssl_echd_derive_secret
Makes it possible to expose it on next commit.
Aki Tuomi [Thu, 29 Aug 2019 13:52:51 +0000 (16:52 +0300)]
lib-dcrypt: Add API for dcrypt_ecdh_derive_secret
Aki Tuomi [Thu, 29 Aug 2019 09:56:21 +0000 (12:56 +0300)]
lib-dcrypt: Return value from RSA_set0_crt_params
Aki Tuomi [Thu, 29 Aug 2019 09:52:46 +0000 (12:52 +0300)]
lib-dcrypt: Fix key format in raw & jwk keys
It needs to be point compressed with named curve
Aki Tuomi [Thu, 29 Aug 2019 09:25:07 +0000 (12:25 +0300)]
lib-dcrypt: Use correct variables names in RSA_set0_key
Broken in
79e9ccdc4a536f3881ec2b9304020514d1f92590
Aki Tuomi [Thu, 29 Aug 2019 09:24:42 +0000 (12:24 +0300)]
lib-dcrypt: Use ERR_R_PASSED_NULL_PARAMETER
It's the correct error and exists for older OpenSSL
Added in
79e9ccdc4a536f3881ec2b9304020514d1f92590
Aki Tuomi [Tue, 27 Aug 2019 07:09:30 +0000 (10:09 +0300)]
lib-dcrypt: Fix memory leak in raw key test
Aki Tuomi [Mon, 23 Jan 2017 12:56:54 +0000 (14:56 +0200)]
lib-dcrypt: Add unit tests for changes
Aki Tuomi [Mon, 23 Jan 2017 12:56:38 +0000 (14:56 +0200)]
dcrypt-openssl: Implement signature API for OpenSSL
Aki Tuomi [Mon, 23 Jan 2017 15:40:01 +0000 (17:40 +0200)]
lib-dcrypt: Add padding parameter for RSA encrypt/decrypt