]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
Josef 'Jeff' Sipek [Mon, 29 Jan 2018 13:41:03 +0000 (08:41 -0500)]
global: start relying on mailbox_header_lookup_unref(NULL) being a no-op
Cleanup performed with the following semantic patch:
@@
expression E;
@@
- if (E != NULL) {
- mailbox_header_lookup_unref(&E);
- }
+ mailbox_header_lookup_unref(&E);
Josef 'Jeff' Sipek [Mon, 29 Jan 2018 13:40:27 +0000 (08:40 -0500)]
lib-storage: mailbox_header_lookup_unref(NULL) should be a no-op
Josef 'Jeff' Sipek [Mon, 29 Jan 2018 13:38:45 +0000 (08:38 -0500)]
lib-mail: start relying on mail_html2text_deinit(NULL) being a no-op
Cleanup performed with the following semantic patch:
@@
expression E;
@@
- if (E != NULL) {
- mail_html2text_deinit(&E);
- }
+ mail_html2text_deinit(&E);
Josef 'Jeff' Sipek [Mon, 29 Jan 2018 13:38:16 +0000 (08:38 -0500)]
lib-mail: mail_html2text_deinit(NULL) should be a no-op
Josef 'Jeff' Sipek [Thu, 9 Nov 2017 15:37:34 +0000 (10:37 -0500)]
global: start relying on ssl_iostream_destroy(NULL) being a no-op
Cleanup performed with the following semantic patch:
@@
expression E;
@@
- if (E != NULL) {
- ssl_iostream_destroy(&E);
- }
+ ssl_iostream_destroy(&E);
Josef 'Jeff' Sipek [Thu, 9 Nov 2017 15:39:25 +0000 (10:39 -0500)]
ssl-iostream: ssl_iostream_destroy(NULL) should be a no-op
Josef 'Jeff' Sipek [Thu, 9 Nov 2017 15:34:21 +0000 (10:34 -0500)]
global: start relying on iostream_proxy_unref(NULL) being a no-op
Cleanup performed with the following semantic patch:
@@
expression E;
@@
- if (E != NULL) {
- iostream_proxy_unref(&E);
- }
+ iostream_proxy_unref(&E);
Josef 'Jeff' Sipek [Thu, 9 Nov 2017 15:36:02 +0000 (10:36 -0500)]
lib: iostream_proxy_unref(NULL) should be a no-op
Josef 'Jeff' Sipek [Thu, 9 Nov 2017 15:30:51 +0000 (10:30 -0500)]
global: start relying on str_free(NULL) being a no-op
Cleanup performed with the following semantic patch:
@@
expression E;
@@
- if (E != NULL) {
- str_free(&E);
- }
+ str_free(&E);
Josef 'Jeff' Sipek [Thu, 9 Nov 2017 15:32:32 +0000 (10:32 -0500)]
lib: str_free(NULL) should be a no-op
Phil Carmody [Tue, 30 Jan 2018 12:14:42 +0000 (14:14 +0200)]
lib/randgen - warn when DOVECOT_SRAND is not able to be used
As suggested by Jeff, it's friendly to warn if we're unable to act
upon the request for reproduceable random numbers because we're not
built for that.
Note, this deliberately permits a blank string, so that you can
silence the warning by prefixing a command with an empty
DOVECOT_SRAND=
which is taken as an explicit attempt to disable use of the feature.
Signed-off-by: Phil Carmody <phil@dovecot.fi>
Phil Carmody [Tue, 30 Jan 2018 11:47:18 +0000 (13:47 +0200)]
lib/randgen - always print the DOVECOT_SRAND seed, not just on fatals
Devs might want to reproduce "working" pathways that show slight
misbehaviour, not just crashing ones. The later print upon a crash/
fatal is left in, as the heads of logs can become separated from the
tails of logs quite easily, it's only one extra line per run.
Signed-off-by: Phil Carmody <phil@dovecot.fi>
Phil Carmody [Tue, 30 Jan 2018 16:48:51 +0000 (18:48 +0200)]
lib/randgen - use KISS as intended, not as originally posted to sci.crypt
The original KISS, as posted to sci.crypt, had a SHR3 component with
short cycles. The buggy version contradicted Marsaglia's original
cycle length claim, and it had already been fixed in KISS11, so it's
fair to assume this was always the intended implementation.
For details see G. Rose "KISS: A Bit Too Simple".
Whilst dealing with that issue, fix seeding so w and z can't both
be short (length 2) cycles, as also pointed out in the Rose paper.
Signed-off-by: Phil Carmody <phil@dovecot.fi>
Stephan Bosch [Mon, 29 Jan 2018 18:10:38 +0000 (19:10 +0100)]
doveadm: dsync: Switch ioloop for input/output streams while making TCP connection.
This task is performed in a sub-ioloop, and when returning from that ioloop, the
output stream would sometimes still have an object on the sub-ioloop that was
just destroyed.
Stephan Bosch [Mon, 29 Jan 2018 17:28:25 +0000 (18:28 +0100)]
lib-ssl-iostream: openssl: Make verbose logging robust against i_debug() writing to stream itself.
In dsync, i_debug() is overridden to write to the SSL stream itself through a
multiplexed data stream. So, during the i_debug() call all kinds of things can
happen to the persisted error string in the stream, which caused problems.
Stephan Bosch [Tue, 16 Jan 2018 01:02:11 +0000 (02:02 +0100)]
lib-http: client: Make sure all ioloop objects are created on the ioloop that the client/context is switched to.
Stephan Bosch [Tue, 16 Jan 2018 23:37:37 +0000 (00:37 +0100)]
lib-dns: Allow setting the ioloop that the dns_lookup/dns_client is started on.
Stephan Bosch [Wed, 17 Jan 2018 01:50:05 +0000 (02:50 +0100)]
lib: connection: Allow switching to a specific ioloop.
Stephan Bosch [Wed, 17 Jan 2018 01:49:44 +0000 (02:49 +0100)]
lib: ostream: Allow switching to a specific ioloop.
Stephan Bosch [Wed, 17 Jan 2018 01:48:43 +0000 (02:48 +0100)]
lib: istream: Allow switching to a specific ioloop.
Stephan Bosch [Wed, 24 Jan 2018 22:02:03 +0000 (23:02 +0100)]
lib: iostream: Record the ioloop that the iostream was last switched to.
Stephan Bosch [Tue, 16 Jan 2018 18:37:46 +0000 (19:37 +0100)]
lib: ioloop: Add functions for adding/moving timeouts and ios to a specific ioloop.
Stephan Bosch [Mon, 29 Jan 2018 21:17:44 +0000 (22:17 +0100)]
imap-login: Fix copyright notice in imap-login-cmd-id.c.
Aki Tuomi [Fri, 26 Jan 2018 08:55:54 +0000 (10:55 +0200)]
lib-auth: Remove request after abort
Otherwise the request will still stay in hash table
and get dereferenced when all requests are aborted
causing an attempt to access free'd memory.
Found by Apollon Oikonomopoulos <apoikos@debian.org>
Broken in
1a29ed2f96da1be22fa5a4d96c7583aa81b8b060
Stephan Bosch [Sat, 27 Jan 2018 23:14:21 +0000 (00:14 +0100)]
submission: Properly handle omission of required authentication for relay connection.
Particularly, do not forward the 530 error to the client. Instead, log the
problem and close the client connection with an internal error.
Stephan Bosch [Sat, 27 Jan 2018 23:10:11 +0000 (00:10 +0100)]
lib-smtp: server: Fix overwriting a previously submitted reply.
The submitted flag was not reset, nor was the replies_submitted counter
decreased. This caused assertion failures.
Stephan Bosch [Sun, 28 Jan 2018 20:39:07 +0000 (21:39 +0100)]
lib-http: client: Assert that req->client != NULL in http_client_request_send_error().
Applies when blocking payload output API is being used.
Addresses a report by scan-build.
Stephan Bosch [Sun, 28 Jan 2018 10:44:26 +0000 (11:44 +0100)]
lib-smtp: client: Fix timeout leak sometimes occurring at unexpected remote disconnect.
While disconnected, newly submitted commands are queued, yet scheduled for
immediate failure. The timeout used for that was not cleaned up.
Stephan Bosch [Fri, 26 Jan 2018 19:37:32 +0000 (20:37 +0100)]
lib-program-client: Make an explicit enum for the exit code.
Before, the meaning of the code was confusing, since the actual program returns
a different set of values.
Stephan Bosch [Sat, 20 Jan 2018 20:32:07 +0000 (21:32 +0100)]
lib-program-client: local: Add test for big data I/O.
Stephan Bosch [Wed, 24 Jan 2018 00:17:59 +0000 (01:17 +0100)]
lib-program-client: Document the purpose of the use_dotstream setting.
Stephan Bosch [Tue, 23 Jan 2018 20:14:18 +0000 (21:14 +0100)]
lib-program-client: Add comments to program_input/program_output functions.
Stephan Bosch [Mon, 22 Jan 2018 22:43:18 +0000 (23:43 +0100)]
lib-program-client: Flush/finish the output stream after o_stream_send_istream().
There may still be data in the output stream buffer. Failing to flush this
leads to truncated output. For the output towards the program o_stream_finish()
is used, since there may be an ostream_dot in between (or something else for
future features).
Stephan Bosch [Wed, 24 Jan 2018 00:09:16 +0000 (01:09 +0100)]
lib-program-client: remote: Don't change exit_code in program_client_remote_disconnect() when program_input is already NULL.
When the program_input is NULL, the stream is finished, meaning that the
exit_code is set based on the return code. There can be a program_input for
remote streams, even when the program produces no output.
Stephan Bosch [Tue, 23 Jan 2018 20:38:27 +0000 (21:38 +0100)]
lib-program-client: Simplify cleanup of dot input stream in program_client_program_input().
Stephan Bosch [Tue, 23 Jan 2018 20:24:35 +0000 (21:24 +0100)]
lib-program-client: Restructure reading input from program to simplify handling of dot input stream.
Stephan Bosch [Mon, 22 Jan 2018 22:25:34 +0000 (23:25 +0100)]
lib-program-client: Use reliable means of checking for input stream EOF.
Stephan Bosch [Wed, 24 Jan 2018 20:48:07 +0000 (21:48 +0100)]
lib-program-client: Remove check for -2 returned from i_stream_read_more().
The stream must have space for at least 1 byte.
Stephan Bosch [Tue, 23 Jan 2018 21:16:26 +0000 (22:16 +0100)]
lib-program-client: Remove useless stream eof check.
It also looks to be problematic.
Sergey Kitov [Mon, 8 Jan 2018 09:38:37 +0000 (11:38 +0200)]
lib-imap-client: continue imapc operation on parsing errors.
Stephan Bosch [Thu, 25 Jan 2018 21:24:05 +0000 (22:24 +0100)]
lib-smtp: client: Fix ignoring invalid certificate from server.
Although it initially allowed the invalid certificate, it would still fail later
on while reading/writing the SSL streams.
Timo Sirainen [Thu, 25 Jan 2018 10:27:41 +0000 (12:27 +0200)]
lib-storage: Fix adding body.snippet to cache
Unless body.snippet was in mail_always_cache_fields, it didn't get added to
the cache file.
Timo Sirainen [Thu, 25 Jan 2018 10:35:51 +0000 (12:35 +0200)]
lib-storage: Add comment to how mail_cache_field_can/want_add() is used
Timo Sirainen [Thu, 25 Jan 2018 10:35:35 +0000 (12:35 +0200)]
lib-index: Update comments for mail_cache_decision_*()
Timo Sirainen [Mon, 18 Dec 2017 14:50:51 +0000 (16:50 +0200)]
lib-auth: Fix memory leak in auth_client_request_abort()
This caused memory leaks when authentication was aborted. For example
with IMAP:
a AUTHENTICATE PLAIN
*
Broken by
9137c55411aa39d41c1e705ddc34d5bd26c65021
Timo Sirainen [Wed, 24 Jan 2018 11:47:50 +0000 (13:47 +0200)]
lib: i_stream_read_more() - assert it can't return -2
Timo Sirainen [Wed, 24 Jan 2018 16:01:48 +0000 (18:01 +0200)]
lib-index: Write forced cache decision changes immediately to cache file
When mail_always/never_cache_fields doesn't match the current caching
decisions in the cache file, write the updated decisions to the file.
Timo Sirainen [Wed, 24 Jan 2018 16:01:23 +0000 (18:01 +0200)]
lib-index: Code cleanup for reading caching decisions
No functional changes.
Timo Sirainen [Wed, 24 Jan 2018 15:58:57 +0000 (17:58 +0200)]
lib-index: Finish fixing removal of forced cache decisions from existing cache files
6ef2504d020461b0f480766c41596595a4300023 didn't fix it for already known
fields.
Aki Tuomi [Wed, 24 Jan 2018 12:48:36 +0000 (14:48 +0200)]
lib-storage: Rename .vsize.lock file to dovecot-vsize.lock
.vsize.lock can break maildir++ because it looks like a maildir folder,
so rename it to dovecot-vsize.lock.
Introduced in
9963bef6
Aki Tuomi [Tue, 23 Jan 2018 08:51:26 +0000 (10:51 +0200)]
push-notification: PUSH_NOTIFICATION_USER_CONTEXT is now required
Satisfies static analyzers
Aki Tuomi [Tue, 23 Jan 2018 08:49:40 +0000 (10:49 +0200)]
fts-lucene: Add and use FTS_LUCENE_USER_CONTEXT_REQUIRE
Satisfies static analyzers
Aki Tuomi [Tue, 23 Jan 2018 08:47:49 +0000 (10:47 +0200)]
welcome: WELCOME_CONTEXT is now required
Satisfies static analyzers
Aki Tuomi [Tue, 23 Jan 2018 08:46:30 +0000 (10:46 +0200)]
expire: DOVEADM_EXPIRE_MAIL_CMD_CONTEXT is now required
Satisfied static analyzers
Aki Tuomi [Tue, 23 Jan 2018 08:44:02 +0000 (10:44 +0200)]
virtual: Contexts are now required or checked
Satisfies static analyzers
Aki Tuomi [Tue, 23 Jan 2018 08:41:35 +0000 (10:41 +0200)]
quota: Add and use QUOTA_USER_CONTEXT_REQUIRE
Satisfies static analyzers
Aki Tuomi [Tue, 23 Jan 2018 08:40:23 +0000 (10:40 +0200)]
imap-zlib: Context is now required
Satisfies static analyzers
Aki Tuomi [Tue, 23 Jan 2018 08:39:30 +0000 (10:39 +0200)]
lazy-expunge: Fix context checking
Was not done properly in
462a3d92adcde4bfa9a575875bd8ae740b89ce9e
Aki Tuomi [Mon, 22 Jan 2018 12:04:47 +0000 (14:04 +0200)]
mail-crypt: Add and use MAIL_CRYPT_USER_CONTEXT_REQUIRE
Satisfies static analyzers
Aki Tuomi [Mon, 22 Jan 2018 12:02:39 +0000 (14:02 +0200)]
fts-solr: Add and use FTS_SOLR_USER_CONTEXT_REQUIRE
Satisfies static analyzers
Aki Tuomi [Tue, 23 Jan 2018 09:37:41 +0000 (11:37 +0200)]
acl: Fix ACL_CONTEXT check
Was incorrect in
3131b3878de3245db7552234e66d437e8fde9351
Aki Tuomi [Tue, 23 Jan 2018 08:38:41 +0000 (10:38 +0200)]
acl: Add and use ACL_USER_CONTEXT_REQUIRE
Satisfies static analyzers
Aki Tuomi [Mon, 22 Jan 2018 12:00:37 +0000 (14:00 +0200)]
acl: Add and use ACL_LIST_CONTEXT_REQUIRE
Satisfies static analyzers
Aki Tuomi [Mon, 22 Jan 2018 11:57:12 +0000 (13:57 +0200)]
lib-storage: imapc - Ensure search ctx is not NULL
Satisfies static analyzers
Aki Tuomi [Mon, 22 Jan 2018 11:54:58 +0000 (13:54 +0200)]
lib-storage: Add and use MAIL_STORAGE_CONTEXT_REQUIRE
Satisfies static analyzers
Aki Tuomi [Mon, 22 Jan 2018 11:52:37 +0000 (13:52 +0200)]
lib-storage: Add and use MAIL_THREAD_CONTEXT_REQUIRE
Satisfies static analyzers
Aki Tuomi [Mon, 22 Jan 2018 11:50:37 +0000 (13:50 +0200)]
lib-index: Add and use CACHE_TRANS_CONTEXT_REQUIRE
Satisfies static analyzers
Aki Tuomi [Mon, 22 Jan 2018 07:38:26 +0000 (09:38 +0200)]
lib-storage: Add and use INDEX_LIST_CONTEXT_REQUIRE
Satisfies static analyzers
Aki Tuomi [Sat, 20 Jan 2018 18:42:02 +0000 (20:42 +0200)]
mail-log: Contexts are now required or checked
Satisfies static analyzers
Aki Tuomi [Sat, 20 Jan 2018 13:44:56 +0000 (15:44 +0200)]
auth: db-lua - Do not assert-crash if given parameter was not auth_request
Use luaL_error instead that will back out more gracefully.
Fixes Panic: file db-lua.c: line 279 (auth_lua_check_auth_request): assertion failed: (lua_istable(script->L, arg))
Aki Tuomi [Sat, 20 Jan 2018 18:33:01 +0000 (20:33 +0200)]
auth: db-lua - Use luaL_error correctly
Timo Sirainen [Mon, 22 Jan 2018 22:04:28 +0000 (00:04 +0200)]
lib-index: Fix removal of forced cache decisions from existing cache files
The forced-flags are written to the cache file when the file is created.
They were also read back, and the force-flag was preserved even when the
configuration was removed.
Timo Sirainen [Mon, 22 Jan 2018 15:38:32 +0000 (17:38 +0200)]
lib-index: Fix adding forced cache decisions to existing cache files
If a field already existed in the cache file, the cache decision from the
file was always used. This caused force-decisions to be ignored.
Stephan Bosch [Mon, 22 Jan 2018 17:51:21 +0000 (18:51 +0100)]
submission: Enable verbose reporting of relay server certificate problems.
Josef 'Jeff' Sipek [Mon, 22 Jan 2018 20:58:51 +0000 (15:58 -0500)]
lib: cast {,CONST_}PTR_OFFSET's offset argument to size_t
This fixes build on 32-bit systems where the addition may cause integer
promotion to an integer type larger than uintptr_t.
gcc 6.3.0 warning:
file-cache.c: In function 'file_cache_write':
macros.h:25:3: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
((void *) (((uintptr_t) (ptr)) + (offset)))
Stephan Bosch [Fri, 19 Jan 2018 22:32:31 +0000 (23:32 +0100)]
lib-smtp: client: Assign only connection settings during connection initialization.
Due to some copy-paste mistake, some global client settings were assigned
instead.
Stephan Bosch [Fri, 19 Jan 2018 22:31:05 +0000 (23:31 +0100)]
lib-smtp: client: Always use per-connection settings in connection.
Some part of the connection code referred to global client settings.
Stephan Bosch [Fri, 19 Jan 2018 15:05:18 +0000 (16:05 +0100)]
lib-smtp: client: Properly allow per-connection SSL configuration.
Although this was already partially possible, the connection was still always
using the global client SSL context.
Stephan Bosch [Fri, 19 Jan 2018 13:44:50 +0000 (14:44 +0100)]
lib-smtp: client: Fix segfault occurring in connection when SSL certificate is invalid.
The connection is using its own local SSL settings to determine whether an
invalid certificate is allowed. However, these local settings were not properly
initialized.
Timo Sirainen [Mon, 22 Jan 2018 11:33:29 +0000 (13:33 +0200)]
Stephan Bosch [Sat, 20 Jan 2018 17:48:00 +0000 (18:48 +0100)]
lib-http: test-http-payload: Initialize http_context in test_client_create_clients().
Fixes complaint from scan-build.
Stephan Bosch [Sat, 20 Jan 2018 15:48:03 +0000 (16:48 +0100)]
lib-smtp: address: Remove useless local variable initialization in smtp_address_clone().
Fixes complaint from scan-build.
Josef 'Jeff' Sipek [Thu, 4 Jan 2018 17:44:16 +0000 (12:44 -0500)]
imap: support for FETCH SNIPPET
Aki Tuomi [Fri, 19 Jan 2018 08:27:09 +0000 (10:27 +0200)]
old-stats-plugin: Fix context requirements
Fixes Panic: Module context stats_storage_module missing
Broken by
6afdf0b6fce26c5492d5e56f6f16fb8a4d869566
Aki Tuomi [Thu, 18 Jan 2018 13:29:42 +0000 (15:29 +0200)]
pop3-migration-plugin: Fix context requirements
Fixes Panic: Module context pop3_migration_storage_module missing
Broken by
a8703ce24540b7efaa51a8c7d3c72e72727f9789
Josef 'Jeff' Sipek [Thu, 4 Jan 2018 17:41:23 +0000 (12:41 -0500)]
global: don't cast NULL to void *
NULL is guaranteed to be a void * thanks to
dd6043c05e32a8e8db1233ed711a2c74d1477a89 .
Aki Tuomi [Mon, 8 Jan 2018 13:08:10 +0000 (15:08 +0200)]
auth: passdb-cache - Verify credentials with worker when enabled
Aki Tuomi [Mon, 8 Jan 2018 13:00:17 +0000 (15:00 +0200)]
auth: Expose auth_request_verify_plain_callback_finish
Aki Tuomi [Mon, 8 Jan 2018 13:09:28 +0000 (15:09 +0200)]
auth-worker: Support PASSW request
This will attempt to verify given credentials.
Aki Tuomi [Mon, 8 Jan 2018 12:52:10 +0000 (14:52 +0200)]
auth-worker: Add auth_worker_auth_request_new
Replaces worker_auth_request_new, moves in
check for username and service. Simplifies code.
Aki Tuomi [Tue, 2 Jan 2018 10:33:50 +0000 (12:33 +0200)]
auth: passdb-blocking - Expose passdb_blocking_auth_worker_reply_parse
Enables sharing code with passdb cache
Aki Tuomi [Wed, 17 Jan 2018 10:15:16 +0000 (12:15 +0200)]
last-login: Contexts are now required or checked
Satisfies static analyzers
Aki Tuomi [Wed, 17 Jan 2018 10:14:22 +0000 (12:14 +0200)]
mail-crypt: Contexts are now required or checked
Satisfies static analyzers
Aki Tuomi [Wed, 17 Jan 2018 08:28:48 +0000 (10:28 +0200)]
old-stats: Contexts are now required or checked
Satisfies static analyzers
Aki Tuomi [Wed, 17 Jan 2018 08:23:05 +0000 (10:23 +0200)]
quota-clone: Contexts are now required or checked
Satisfies static analyzers
Aki Tuomi [Wed, 17 Jan 2018 08:21:52 +0000 (10:21 +0200)]
zlib: Contexts are now required or checked
Satisfies static analyzers
Aki Tuomi [Wed, 17 Jan 2018 08:10:41 +0000 (10:10 +0200)]
mailbox-alias: Contexts are now required or checked
Satisfies static analyzers
Aki Tuomi [Wed, 17 Jan 2018 08:07:37 +0000 (10:07 +0200)]
mail-filter: Contexts are now required or checked
Satisfies static analyzers
Aki Tuomi [Wed, 17 Jan 2018 08:06:25 +0000 (10:06 +0200)]
notify: Contexts are now required or checked
Satisfied static analyzers
Aki Tuomi [Wed, 17 Jan 2018 07:31:44 +0000 (09:31 +0200)]
pop3-migration: Contexts are now required or checked
Satisfies static analyzers