]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
Timo Sirainen [Sat, 10 Sep 2016 08:32:28 +0000 (11:32 +0300)]
doveadm-auth: Handle unexpected auth "continue" request without crashing.
Timo Sirainen [Sat, 10 Sep 2016 08:28:38 +0000 (11:28 +0300)]
lib-lda: Cleanup error handling in LMTP client code.
If there are no successful recipients, we'll need to deinit the client.
But at that point we've already called all the callbacks, so the line
parameter to lmtp_client_fail_full() isn't actually used anywhere.
This was confusing static analyzer because global_fail_string was used
as parameter, which could have been NULL and wouldn't have been valid
for the callbacks.
Timo Sirainen [Sat, 10 Sep 2016 08:16:05 +0000 (11:16 +0300)]
lib-master: Fixed memory leak when IPC server is handling commands.
This mainly meant that when login processes responded to doveadm proxy
list/kick commands memory was leaked.
Timo Sirainen [Sat, 10 Sep 2016 08:13:58 +0000 (11:13 +0300)]
dict-client: Don't crash if dict-server returns broken reply.
Just treat missing <tab>value as empty value.
Timo Sirainen [Fri, 9 Sep 2016 15:18:32 +0000 (18:18 +0300)]
auth: Make sure auth_request_log_info() doesn't crash when there are no passdbs
auth_request_is_disabled_master_user() could have caused such crash.
Timo Sirainen [Fri, 9 Sep 2016 15:12:41 +0000 (18:12 +0300)]
auth: Explicitly ignore return value to make static analyzer happier.
Timo Sirainen [Fri, 9 Sep 2016 15:10:29 +0000 (18:10 +0300)]
Added asserts to make static analyzer happier.
Timo Sirainen [Fri, 9 Sep 2016 15:07:15 +0000 (18:07 +0300)]
Removed dead code to make static analyzer happier.
Timo Sirainen [Fri, 9 Sep 2016 14:55:20 +0000 (17:55 +0300)]
lib-storage: Fix potential crash when userdb-returns "key+=value" for a nonexistent setting.
type would have also happened to be initialized to SET_STR for the crash to
happen.
Timo Sirainen [Fri, 9 Sep 2016 14:36:39 +0000 (17:36 +0300)]
lib-imap-urlauth: Don't access freed memory on errors.
Timo Sirainen [Tue, 13 Sep 2016 04:22:03 +0000 (07:22 +0300)]
imap, pop3: Added rawlog_dir setting to store IMAP/POP3 traffic logs.
This at least partially replaces the "rawlog" post-login binary. For now
the "rawlog" binary supports some parameters, which aren't configurable
for rawlog_dir.
Aki Tuomi [Fri, 9 Sep 2016 12:51:43 +0000 (15:51 +0300)]
pop3-migration-plugin: Add to index after successful retry
Also change return value to indicate that the hash
has been assigned to header.
Aki Tuomi [Mon, 12 Sep 2016 06:47:26 +0000 (09:47 +0300)]
doveconf: Hide any _api_key
Aki Tuomi [Tue, 16 Aug 2016 09:28:27 +0000 (12:28 +0300)]
doveconf: hide ssl_key without -P
Phil Carmody [Mon, 5 Sep 2016 13:26:56 +0000 (16:26 +0300)]
plugins: fts - replace i_assert under _expunge_log_subtract with warning (API change)
The helper whose interface is changing currently has no other known
clients (there's little need for it to be exposed at all).
This should never happen, but if it does, just tally the number of times
it happened, and squirt out a warning message after the whole subtract.
If it happens at all, there's no reason not to expect a lot, so only
warn once per file.
In particular - do not assert crash when this is seen - it has been seen
on live test systems where file corruption seems to have occured. As
this can only be associated with corrupt fts indexes, seeing this error
implies that the whole FTS index should be rebuilt for that user.
Signed-off-by: Phil Carmody <phil@dovecot.fi>
Aki Tuomi [Wed, 10 Aug 2016 10:07:01 +0000 (13:07 +0300)]
lib-storage: Limit folder full name only
Before we had limit of 16 levels and 255 bytes per name
which is same as 4096 bytes. Now we limit only the total
length of the name to MAILBOX_LIST_NAME_MAX_LENGTH. For
compability reasons, we are restricting individual component
names to 255 characters.
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.
Timo Sirainen [Thu, 8 Sep 2016 23:48:45 +0000 (02:48 +0300)]
fs-randomfail: Fixed assert-crash in fs_write_stream_abort_error()
Timo Sirainen [Thu, 8 Sep 2016 22:42:50 +0000 (01:42 +0300)]
imap-hibernate: Increased imap-master communication timeout from 5s to 30s
Looks like 5s isn't enough in loaded environments. It's also not really a
problem if the timeout is large, it's just going to take a while longer to
restore the connection. When timeout is reached the client would just get
disconnected anyway.
Timo Sirainen [Fri, 9 Sep 2016 11:07:11 +0000 (14:07 +0300)]
lib-storage: Fixed accessing user as root when user has no uid.
This shouldn't normally be done, but might as well fix it. Fixes:
Fatal: mail-storage-service: seteuid(
4294967295 ) failed: Invalid argument
Timo Sirainen [Thu, 8 Sep 2016 21:59:53 +0000 (00:59 +0300)]
lib-index: Fixed mail_index_modseq_get_next_log_offset() when accessing .log.2
file->sync_offset was set only after header, so sync_highest_modseq was also
same as initial_modseq. The previous code then just returned offset pointing
to sync_offset, which was too early.
Timo Sirainen [Thu, 8 Sep 2016 20:54:22 +0000 (23:54 +0300)]
lib-index: Make sure new dovecot.index.log files start tracking modseqs.
This will make mail_index_modseq_get_next_log_offset() work correctly even
if modseqs haven't been explicitly enabled.
Timo Sirainen [Tue, 23 Aug 2016 19:36:08 +0000 (22:36 +0300)]
lib-storage: Code cleanup for mailbox_get_expunge*()
The previous code did actually work as well, but it wasn't very obvious that
it did.
Timo Sirainen [Thu, 8 Sep 2016 22:31:46 +0000 (01:31 +0300)]
imap: When hibernating, wait for old imap process to cleanup before creating new ones.
This fixes stats errors:
stats: Error: FIFO input error: CONNECT: Duplicate session ID Y7Q6E4U7xO1/AAAB for user testuser service imap
stats: Warning: Couldn't find session ID: Y7Q6E4U7xO1/AAAB
Timo Sirainen [Thu, 8 Sep 2016 23:50:27 +0000 (02:50 +0300)]
lib-fs: Moved fs_write_stream_abort_parent() to fs-api-private.h
Only fs wrapper drivers are supposed to call it.
Martti Rannanjärvi [Thu, 8 Sep 2016 16:01:54 +0000 (19:01 +0300)]
lib-index: limit mail_index error prints to one per ioloop_time
This is to prevent log flooding.
Timo Sirainen [Fri, 9 Sep 2016 07:38:10 +0000 (10:38 +0300)]
lib-test: Added missing va_end() call.
Timo Sirainen [Fri, 9 Sep 2016 00:05:39 +0000 (03:05 +0300)]
lib-test: test_expect_errors() now works for the entire log string, not just format parameter
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>
Phil Carmody [Tue, 12 Jul 2016 10:28:54 +0000 (13:28 +0300)]
lib-test: enable naming of tests, such that only a subset is run
How to use these will become clear in a subsequent patch. Even if you
don't want to name tests, the macros can reduce redundancy in the code,
as the list of test function prototypes and the list of test functions
to call become the same lists, expanded through 2 different macros.
Signed-off-by: Phil Carmody <phil@dovecot.fi>
Phil Carmody [Wed, 1 Jun 2016 10:57:34 +0000 (13:57 +0300)]
lib-test: improve expected error handling
If we expect a specific error string, then when we see it, suppress it.
We do not suppress errors expected by count, because if we get unexpected
errors, then we do not want them suppressed, and we have no way of
distinguishing between the expected and unexpected errors.
This of course favours the use of the expected string version of the helper,
but alas that's not always usable, as you can only expect one at a time.
Additionally, if we failed to see an expected message, then when we no longer
expect to see it, reset the expected message state to not cascade further
test assertion failures.
Signed-off-by: Phil Carmody <phil@dovecot.fi>
Conflicts:
src/lib-test/test-common.c
Timo Sirainen [Thu, 8 Sep 2016 22:08:59 +0000 (01:08 +0300)]
stats: Include PIDs in "Duplicate session ID" errors.
Timo Sirainen [Thu, 8 Sep 2016 19:08:11 +0000 (22:08 +0300)]
lib-index: mail_index_modseq_get_next_log_offset() shouldn't return offset beyond view's head
This also allows removing the same workaround from dsync code.
Timo Sirainen [Wed, 7 Sep 2016 08:52:00 +0000 (11:52 +0300)]
imap: Avoid wrongly assert-crashing in client_check_command_hangs()
Fixes assert:
Panic: file imap-client.c: line 837 (client_check_command_hangs): assertion failed: (client->io != NULL)
Timo Sirainen [Thu, 8 Sep 2016 17:23:35 +0000 (20:23 +0300)]
stats plugin: Don't send any stats before CONNECT was successfully sent.
After stats write failures this fixes warnings like:
Warning: stats: Couldn't find session ID: smqAXQE8pIp/AAAB
Timo Sirainen [Thu, 8 Sep 2016 17:18:46 +0000 (20:18 +0300)]
lib-stats: stats_connection_send() now returns whether it succeeded or not
Timo Sirainen [Thu, 8 Sep 2016 13:50:02 +0000 (16:50 +0300)]
doveadm flags: Sync mailbox after committing transaction.
Aki Tuomi [Wed, 7 Sep 2016 19:06:55 +0000 (22:06 +0300)]
lmtp: Always read settings before dropping privs
If lmtp is ran explicitly as root, settings were not read.
Timo Sirainen [Wed, 7 Sep 2016 19:00:14 +0000 (22:00 +0300)]
imap: Fixed assert-crash if un-hibernation failed to initialize user.
master_service_client_connection_destroyed() was also being called in
imap_master_client_destroy() so it was done twice.
Fixes:
Panic: file master-service.c: line 775 (master_service_client_connection_destroyed): assertion failed: (service->total_available_count > 0)
Aki Tuomi [Mon, 5 Sep 2016 09:42:08 +0000 (12:42 +0300)]
fs-api: Retrieve errno before dest->copy_output is NULL'ed
CID 10144: When aborting output, errno retrieval
is attempted after dest->copy_output has already
been unreffed. Found by coverity.
Aki Tuomi [Tue, 6 Sep 2016 06:24:06 +0000 (09:24 +0300)]
lib-storage: Check that UID is set before caching
Aki Tuomi [Tue, 6 Sep 2016 06:23:54 +0000 (09:23 +0300)]
lib-imap-storage: Check that UID is assigned before caching
Aki Tuomi [Mon, 5 Sep 2016 12:56:05 +0000 (15:56 +0300)]
zlib-plugin: Check that UID is assigned
When caching, code has to check whether UID is
assigned to avoid reusing cache for different
email since they all have UID = 0 before they
are actually committed.
Aki Tuomi [Tue, 6 Sep 2016 13:17:13 +0000 (16:17 +0300)]
quota: Flush quota after recalc
Correctly fix issue where the dict commit
is left unfinished.
Aki Tuomi [Tue, 6 Sep 2016 13:02:26 +0000 (16:02 +0300)]
lib-dict: Discard result when callback is NULL on async call
Timo Sirainen [Mon, 5 Sep 2016 23:56:39 +0000 (02:56 +0300)]
lib-dcrypt: Avoid infinite loop if istream header is too large.
We'll return an error now instead. We can't just return -2 here, because nothing
was actually being returned to the caller. Attempting to do that would just trigger
an assert:
Panic: file istream.c: line 182 (i_stream_read): assertion failed: (_stream->skip != _stream->pos)
Aki Tuomi [Thu, 25 Aug 2016 09:27:51 +0000 (12:27 +0300)]
dcrypt: Test for stream prefetch
Aki Tuomi [Thu, 25 Aug 2016 09:26:55 +0000 (12:26 +0300)]
dcrypt: Allow stream prefetch
We might get stream that has already been buffered, so we
must try read it in case buffer is full.
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
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.
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.
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
Aki Tuomi [Tue, 23 Aug 2016 17:12:47 +0000 (20:12 +0300)]
lib-fts: Add missing include
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.
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.
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.
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 11:48:50 +0000 (14:48 +0300)]
pop3: Fix deleted_count expansion
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 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 [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
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.
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)