]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
Timo Sirainen [Thu, 1 Sep 2016 05:41:28 +0000 (08:41 +0300)]
lib: If DEBUG is enabled, use a pointer type for data_stack_frame_t
This allows telling static analyzers to treat t_push() and t_pop() similarly
to malloc()/free() and check for leaks.
Timo Sirainen [Thu, 1 Sep 2016 05:24:19 +0000 (08:24 +0300)]
lib: Changed t_pop() API to make it a bit more like free()
Timo Sirainen [Thu, 1 Sep 2016 05:34:22 +0000 (08:34 +0300)]
lib-master: master_service_init_finish() now verifies that t_pop() wasn't leaked
Timo Sirainen [Thu, 1 Sep 2016 05:31:14 +0000 (08:31 +0300)]
lib: Created data_stack_frame_t type for data_stack_frame
Timo Sirainen [Thu, 1 Sep 2016 05:13:36 +0000 (19:13 -1000)]
lib: Small code cleanup to data-stack - use explicit data_stack_initialized
This will make it easier to change data_stack_frame's type.
Timo Sirainen [Thu, 1 Sep 2016 05:11:46 +0000 (19:11 -1000)]
lib: Minor t_push() optimization - use unlikely()
Stephan Bosch [Sun, 28 Aug 2016 22:03:54 +0000 (00:03 +0200)]
lib: var-expand: Removed var_expand_table_build().
Replaced it with explicit table construction at the one place it was used.
Clang -Wvargargs complained about passing a char argument to va_start().
Phil Carmody [Wed, 31 Aug 2016 17:14:41 +0000 (20:14 +0300)]
Fix control flow and T_BEGIN/T_END hygiene
You mustn't goto, break, continue, or return from out of a
T_BEGIN {...} T_END block, as that will lose a t_pop().
This has been seen in the wild: Panic: Leaked t_pop() call
Signed-off-by: Phil Carmody <phil@dovecot.fi>
Aki Tuomi [Wed, 31 Aug 2016 06:20:49 +0000 (09:20 +0300)]
lib-fs: Do not abort parent of parent
Stephan Bosch [Mon, 29 Aug 2016 08:40:24 +0000 (10:40 +0200)]
configure.ac: Forgot to invoke DOVECOT_WANT_VPOPMAIL.
It was thereby impossible to enable Vpopmail support.
Aki Tuomi [Sun, 28 Aug 2016 15:40:01 +0000 (18:40 +0300)]
doveadm-server: Reset error code between calls
Aki Tuomi [Sun, 28 Aug 2016 16:55:29 +0000 (19:55 +0300)]
stats: Reset nearly all global mail stats
We leave num_connected_sessions alone.
Aki Tuomi [Sun, 28 Aug 2016 16:14:08 +0000 (19:14 +0300)]
stats: Fix user login counters
Before we would count all users twice,
because the same counters would get increment
in both CONNECT and ADD-USER. Now we do not
increment them at all on ADD-USER.
Stephan Bosch [Sun, 28 Aug 2016 15:00:30 +0000 (17:00 +0200)]
auth: GSSAPI mechanism: Fix CLang -Wstrict-bool warnings.
The GSS_ERROR() macro yields an integer rather than an actual bool value.
The krb5_kuserok() function returns a krb_boolean type, which is unsigned int rather than a bool.
Josef 'Jeff' Sipek [Wed, 24 Aug 2016 07:56:44 +0000 (03:56 -0400)]
lib-master: don't leak config path
The config path can already be non-NULL thanks to the default config path
code or the CONFIG_PATH environmental variable.
Aki Tuomi [Tue, 23 Aug 2016 20:31:40 +0000 (23:31 +0300)]
lib-fs: abort parent in fs_file_write_stream_abort_parent
Timo Sirainen [Tue, 23 Aug 2016 10:06:09 +0000 (13:06 +0300)]
imap: Track how much time was spent on waiting for locks.
Timo Sirainen [Tue, 23 Aug 2016 09:55:24 +0000 (12:55 +0300)]
dict-client: In slow query warnings, log time spent in ioloop and lock waits.
Possibly we want to remove the warnings entirely if most of the time has been
spent on lock waits (or alternatively: not spent in ioloop).
Timo Sirainen [Tue, 23 Aug 2016 09:48:21 +0000 (12:48 +0300)]
lib: Track how much time has been spent on waiting for locks.
Aki Tuomi [Tue, 23 Aug 2016 17:12:47 +0000 (20:12 +0300)]
lib-fts: Add missing include
Timo Sirainen [Tue, 23 Aug 2016 11:08:11 +0000 (14:08 +0300)]
imap: Fixed expunge handling when un-hiberanting
Fixes these errors:
Failed to import client state: Message count mismatch after handling expunges
Message UIDs CRC32 mismatch
Timo Sirainen [Tue, 16 Aug 2016 11:07:14 +0000 (14:07 +0300)]
lib: Changed unlink_directory() API to return error string.
There are many different reasons why it could fail, which a simple errno
can't very clearly indicate.
Timo Sirainen [Fri, 19 Aug 2016 10:15:09 +0000 (13:15 +0300)]
global: Added uchar_empty_ptr and use it instead of &uchar_nul.
This makes Coverity happier about not treating a char as an array.
For now this is a pointer to a 0, but could as well become a pointer
that crashes if dereferenced. Shouldn't be NULL anyway because clang's
-fsanitize=nonnull-attribute will complain about them.
Timo Sirainen [Tue, 23 Aug 2016 10:41:38 +0000 (13:41 +0300)]
lib-fs: Fixes to previous fs_write_stream_abort*() changes.
Timo Sirainen [Tue, 23 Aug 2016 10:40:50 +0000 (13:40 +0300)]
lib-storage: Fixed istream-attachment-extractor error handling.
Timo Sirainen [Tue, 23 Aug 2016 10:40:35 +0000 (13:40 +0300)]
lib-mail: Clarify istream-attachment-extractor's error handling API usage.
Aki Tuomi [Mon, 22 Aug 2016 06:42:26 +0000 (09:42 +0300)]
lib-fs: Add fs_write_stream_abort_parent and use it
Will do all the things abort_error does, but leaves
error untouched. You are expected to set one yourself.
Aki Tuomi [Fri, 19 Aug 2016 15:57:23 +0000 (18:57 +0300)]
lib-fs: Remove fs_write_stream_abort
Do not use fs_write_stream_abort anymore, instead use
fs_write_stream_abort_error to provide upstream some
reason when it's used.
Aki Tuomi [Fri, 19 Aug 2016 13:00:30 +0000 (16:00 +0300)]
fs-api: Add and use fs_write_stream_abort_error
This lets caller to specify error instead of setting it
with fs_error. Doing it like this lets us percolate the
error upwards.
Timo Sirainen [Tue, 23 Aug 2016 07:53:28 +0000 (10:53 +0300)]
lib-storage: Added mailbox_recent_flags_expunge_uid()
For storage backends where it's useful.
Teemu Huovila [Mon, 22 Aug 2016 20:41:05 +0000 (23:41 +0300)]
lib-fts: Change normalizer filter to use new truncate.
Teemu Huovila [Sun, 21 Aug 2016 19:12:33 +0000 (22:12 +0300)]
lib-fts: Cut overlong strings in lowercase filter.
Added new common truncate function for filters. It also removes any partial
characters, that would remain from plain truncation.
Teemu Huovila [Wed, 17 Aug 2016 13:47:19 +0000 (16:47 +0300)]
lib-fts: Add max_length to common filter struct. Reorder fields.
The latter is for for imaginary alignment enhancements.
Timo Sirainen [Mon, 22 Aug 2016 13:13:32 +0000 (16:13 +0300)]
fs-metawrap: Added assert to make sure we don't create empty files.
It seems like this could be happening in some situation.
Aki Tuomi [Fri, 19 Aug 2016 11:47:33 +0000 (14:47 +0300)]
quota-dict: Make sure all transactions complete
Aki Tuomi [Thu, 18 Aug 2016 10:37:28 +0000 (13:37 +0300)]
systemd.service: Add required attributes
Aki Tuomi [Thu, 18 Aug 2016 11:48:50 +0000 (14:48 +0300)]
pop3: Fix deleted_count expansion
Phil Carmody [Mon, 8 Aug 2016 15:14:07 +0000 (18:14 +0300)]
lib: test-json-tree - decouple from internals
Use the new helper functions, so that implementation can change without
needing to change the tests.
Patch best viewed with git diff/show --color-words.
Signed-off-by: Phil Carmody <phil@dovecot.fi>
Phil Carmody [Wed, 22 Jun 2016 08:17:09 +0000 (11:17 +0300)]
lib: json-tree - API change to permit more featureful implementation
Provide accessors for the innards of the tree's nodes, so that the node
internals can be changed freely (needed for DAPI). Constify params where
sensible.
NOTE: this enforced const-correctness may *break* (cause a failure to build)
some clients that didn't use const where they could have. Only obox2 is known
to break.
Add sibling functions with more parameters to expand the range of functionality,
and inline rewire the old simple functions to call the more generic ones.
Signed-off-by: Phil Carmody <phil@dovecot.fi>
Timo Sirainen [Thu, 18 Aug 2016 08:22:09 +0000 (11:22 +0300)]
lmtp: Support %{userdb:*} variables in mail_log_prefix
Timo Sirainen [Mon, 15 Aug 2016 20:43:33 +0000 (23:43 +0300)]
quota, last-login: Disable "slow dict commit" warnings
Anything (especially long lock waits) can happen between the commit and when
we read their replies.
Timo Sirainen [Mon, 15 Aug 2016 20:40:59 +0000 (23:40 +0300)]
lib-dict: Added dict_transaction_no_slowness_warning()
Timo Sirainen [Mon, 15 Aug 2016 20:36:13 +0000 (23:36 +0300)]
dict-client: Keep transaction's pointer in command until it's finished.
Timo Sirainen [Mon, 15 Aug 2016 20:16:03 +0000 (23:16 +0300)]
dict-client: Improve "slow dict operation" warnings in error conditions.
There's no need to log both an error and a warning.
Martti Rannanjärvi [Wed, 17 Aug 2016 14:57:16 +0000 (17:57 +0300)]
imap-hibernate: fix input_pending check in client_unhibernate_cmp
Check c2->input_pending instead of c1->input_pending when calculating
comparison value for c2.
Timo Sirainen [Wed, 17 Aug 2016 14:20:21 +0000 (17:20 +0300)]
lib-dcrypt: Fixed accessing out-of-bounds data in istream.
Also some small cleanups to make it clearer what's actually happening.
Timo Sirainen [Wed, 17 Aug 2016 13:25:12 +0000 (16:25 +0300)]
lib-dcrypt: Fixed partial reads in header and limit header's max size.
Also fixes test-stream to actually test nonblocking reads correctly.
Aki Tuomi [Tue, 16 Aug 2016 11:49:35 +0000 (14:49 +0300)]
fts-squat: Ensure child is not NULL
Makes static analysers happy
Aki Tuomi [Tue, 16 Aug 2016 11:47:35 +0000 (14:47 +0300)]
lib-master: Check for NULL in input/output
Makes static analysers happy
Aki Tuomi [Tue, 16 Aug 2016 11:46:08 +0000 (14:46 +0300)]
auth: Ensure username can't be left unset in APOP
Makes static analysers happy
Aki Tuomi [Tue, 16 Aug 2016 11:42:41 +0000 (14:42 +0300)]
imapc: Make sure imail.stream is not NULL
Makes static analysers happy
Aki Tuomi [Tue, 16 Aug 2016 11:39:37 +0000 (14:39 +0300)]
lib-storage: Make sure data->stream isn't NULL
Makes static analysers happy
Aki Tuomi [Tue, 16 Aug 2016 11:36:07 +0000 (14:36 +0300)]
auth: Check for NULL auth token
Makes static analysers happy
Aki Tuomi [Tue, 16 Aug 2016 10:49:01 +0000 (13:49 +0300)]
lib: Fix SENTRY_CHAR to different kind of number
Makes static analysers happier
Aki Tuomi [Tue, 16 Aug 2016 10:46:09 +0000 (13:46 +0300)]
lib-http: Ensure fstream is not NULL in test
Makes static analysers happier
Aki Tuomi [Tue, 16 Aug 2016 10:44:27 +0000 (13:44 +0300)]
lib-index: Do not do pointless memmove
Makes static analysers happier, since moving the data
when days is 0 or days is 8 is effectively non-op.
Aki Tuomi [Tue, 16 Aug 2016 10:31:48 +0000 (13:31 +0300)]
test-priorityq: Ensure item is not NULL
Makes static analysers happy
Aki Tuomi [Tue, 16 Aug 2016 10:30:36 +0000 (13:30 +0300)]
md5: Initialize block
Makes static analysers happy
Timo Sirainen [Tue, 16 Aug 2016 14:15:16 +0000 (17:15 +0300)]
config: Fixed pkgsysconfdir path in ssl_dh warnings.
Aki Tuomi [Tue, 16 Aug 2016 09:41:00 +0000 (12:41 +0300)]
doveconf: Fix ssl_dh parameter handling some more
Move empty check to master-service ssl settings,
also handle ENOENT in read as well. Do not touch
the setting if it could not be composed due to
no such file.
Aki Tuomi [Tue, 16 Aug 2016 09:28:27 +0000 (12:28 +0300)]
doveconf: hide ssl_key and ssl_dh without -P
Timo Sirainen [Tue, 16 Aug 2016 11:53:24 +0000 (14:53 +0300)]
lib-storage: If chdir to home doesn't work, chdir to root instead.
Most importantly this fixes unlink_directory() when current directory
after dropping privileges can't be open()ed.
Timo Sirainen [Tue, 16 Aug 2016 11:04:13 +0000 (14:04 +0300)]
lib-storage: Minor error message fix
Timo Sirainen [Tue, 16 Aug 2016 08:05:25 +0000 (11:05 +0300)]
lib-mail: Compiling fix for message-snippet change - U'x' isn't standard.
nikwrt [Tue, 29 Mar 2016 20:30:17 +0000 (22:30 +0200)]
fts-squat: fix Corrupted squat uidlist bug
Aki Tuomi [Tue, 16 Aug 2016 07:11:04 +0000 (10:11 +0300)]
config: Only require ssl_dh is ssl is turned on
Aki Tuomi [Mon, 15 Aug 2016 16:22:31 +0000 (19:22 +0300)]
lib-mail: Fix snippet generation
Now we won't add leading whitespace for no reason, and also
strip BOM when found.
Aki Tuomi [Mon, 15 Aug 2016 10:30:44 +0000 (13:30 +0300)]
dcrypt: Fix encrypted test keys
Aki Tuomi [Mon, 15 Aug 2016 08:32:31 +0000 (11:32 +0300)]
dcrypt: Update v2 sample
Aki Tuomi [Mon, 15 Aug 2016 08:27:04 +0000 (11:27 +0300)]
dcrypt: Retrieve key length correctly
Martti Rannanjärvi [Fri, 12 Aug 2016 23:26:16 +0000 (02:26 +0300)]
lib-storage: remove set_cache_corrupted_reason from mail_vfuncs
Change set_cache_corrupted signature to what set_cache_corrupted_reason
used to be.
Timo Sirainen [Sat, 13 Aug 2016 11:31:08 +0000 (14:31 +0300)]
lib: Avoid compiler warning if off_t has the same size as ssize_t.
Martti Rannanjärvi [Fri, 12 Aug 2016 22:18:03 +0000 (01:18 +0300)]
lib-storage: remove mailbox-recent-flags.h from index-storage.h
Timo Sirainen [Sat, 13 Aug 2016 11:16:55 +0000 (14:16 +0300)]
dsync: Further fixes to received_timestamp and virtual_size parsing (-t and -S parameters)
Martti Rannanjärvi [Fri, 12 Aug 2016 20:57:59 +0000 (23:57 +0300)]
lib: move sort and search from strfuncs.h to sort.h
Martti Rannanjärvi [Fri, 12 Aug 2016 21:20:43 +0000 (00:20 +0300)]
auth: remove #define default_cache_key cache_key
Martti Rannanjärvi [Fri, 12 Aug 2016 21:35:23 +0000 (00:35 +0300)]
lib-http: rename http_header_field.key to name
Martti Rannanjärvi [Fri, 12 Aug 2016 21:50:57 +0000 (00:50 +0300)]
lib-http: remove http_header_field from http_response
Martti Rannanjärvi [Fri, 12 Aug 2016 22:02:42 +0000 (01:02 +0300)]
lib-lda: remove obsolete smtp-client code
Martti Rannanjärvi [Fri, 12 Aug 2016 22:30:51 +0000 (01:30 +0300)]
lib-storage: remove obsolete constants
Martti Rannanjärvi [Fri, 12 Aug 2016 23:10:52 +0000 (02:10 +0300)]
lib-storage: remove obsolete MAIL_FETCH_UIDL_FILE_NAME
Timo Sirainen [Fri, 12 Aug 2016 22:00:13 +0000 (01:00 +0300)]
dsync: Added missing fields to ibc-stream.
Stephan Bosch [Thu, 11 Aug 2016 23:24:16 +0000 (01:24 +0200)]
lib: Implemented i_stream_create_copy_from_data().
Unlike i_stream_create_from_data(), this function makes a copy of the provided data block. This way, the application does not need to worry about keeping it allocated for the lifetime of the stream.
The copied data is allocated durably on the system pool and freed once the stream is destroyed.
Martti Rannanjärvi [Mon, 25 Jul 2016 07:24:44 +0000 (10:24 +0300)]
lib,lib-test: stop calling memcmp and memcpy with NULL in tests
Martti Rannanjärvi [Mon, 25 Jul 2016 07:21:43 +0000 (10:21 +0300)]
lib-mail: stop calling str_append_n and memcmp with NULL in tests
Martti Rannanjärvi [Fri, 22 Jul 2016 08:23:11 +0000 (11:23 +0300)]
lib: iterate all fds in fd_debug_verify_leaks, fail with i_fatal
There is no benefit in failing with i_panic here since the error is most
likely not in the stack trace here.
Martti Rannanjärvi [Tue, 19 Jul 2016 15:34:08 +0000 (18:34 +0300)]
lib: stop using first_fd as loop counter in fd_debug_verify_leaks
Use a separate int fd to iterate [first_fd, last_fd] instead.
Timo Sirainen [Mon, 8 Aug 2016 10:12:15 +0000 (13:12 +0300)]
Moved cc-wrapper.sh handling to dovecot.m4
When configuring Dovecot --without-shared-libs and pointing external plugins
to uninstalled sources --with-dovecot, any binaries complied for plugins
weren't using cc-wrapper.sh, which could have caused runtime failures when
they attempted to load plugins dynamically. Now it's possible to add
DC_CC_WRAPPER to plugins' configure.ac to build with the cc-wrapper.sh.
Aki Tuomi [Thu, 11 Aug 2016 11:34:05 +0000 (14:34 +0300)]
configure: Fix dcrypt build conditionals
Martti Rannanjärvi [Wed, 10 Aug 2016 12:40:23 +0000 (15:40 +0300)]
lib-storage: don't crash when pop3c-client timeouts
Aki Tuomi [Thu, 11 Aug 2016 09:46:42 +0000 (12:46 +0300)]
doveadm-dump: Add missing include
Timo Sirainen [Thu, 11 Aug 2016 14:27:24 +0000 (17:27 +0300)]
-Wstrict-bool warning fixes
Timo Sirainen [Thu, 11 Aug 2016 14:23:48 +0000 (17:23 +0300)]
doveadm sync: Fixed -S parameter parsing to actually work.
Timo Sirainen [Fri, 1 Jul 2016 11:30:24 +0000 (14:30 +0300)]
doveadm sync/backup: Added -S <max size> parameter to skip too large mails.
Aki Tuomi [Wed, 13 Jul 2016 06:51:08 +0000 (09:51 +0300)]
auth-db-dict: Allow key name expansion
This allows expansion of dictionary keys based on userdb
variables on dict lookup mapping. Example:
key userdb {
key = %{userdb:nspace:default}/userdb
format = json
}
Phil Carmody [Tue, 9 Aug 2016 15:29:19 +0000 (18:29 +0300)]
lib-test: test-exit helper to stop valgrind complaining about fork()s
fork()s that want to _exit() will cause valgrind's full memory leak
checker to complain a lot - this performs a quick cleanup first.
Before:
phil@phil:~/repos/dovecot-core$ valgrind --trace-children=yes --leak-check=full --show-leak-kinds=all src/lib/test-lib --match unix
==19576== total heap usage: 4 allocs, 0 frees, 17,858 bytes allocated
istream unix ......................................................... : ok
0 / 1 tests failed
==19575== total heap usage: 7 allocs, 7 frees, 19,327 bytes allocated
After:
phil@phil:~/repos/dovecot-core$ valgrind --trace-children=yes --leak-check=full --show-leak-kinds=all src/lib/test-lib --match unix
istream unix ......................................................... : ok
==4993== total heap usage: 4 allocs, 4 frees, 17,858 bytes allocated
0 / 1 tests failed
==4992== total heap usage: 7 allocs, 7 frees, 19,327 bytes allocated
Signed-off-by: Phil Carmody <phil@dovecot.fi>
Aki Tuomi [Tue, 9 Aug 2016 08:48:10 +0000 (11:48 +0300)]
openssl: Fix v1.1 compability
Aki Tuomi [Mon, 8 Aug 2016 12:31:50 +0000 (15:31 +0300)]
OpenSSL: link against OpenSSL libs explicitly
Martti Rannanjärvi [Sat, 23 Jul 2016 20:40:15 +0000 (23:40 +0300)]
doveadm: add doveadm-dump-dcrypt-key
Aki Tuomi [Tue, 7 Jun 2016 11:54:43 +0000 (14:54 +0300)]
config: Use ssl-parameters.dat if ssl_dh is missing