]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
9 years agodoveadm fs get: Fixed logging error messages.
Timo Sirainen [Wed, 21 Sep 2016 09:19:18 +0000 (12:19 +0300)] 
doveadm fs get: Fixed logging error messages.

The error is in istream, not in fs.

9 years agoimap-login: Add missing brace
Aki Tuomi [Tue, 20 Sep 2016 18:06:22 +0000 (21:06 +0300)] 
imap-login: Add missing brace

9 years agoimap-proxy: Fix typo in comment
Aki Tuomi [Tue, 20 Sep 2016 15:51:18 +0000 (18:51 +0300)] 
imap-proxy: Fix typo in comment

9 years agoimap-login: Honor nopipelining during preauth
Aki Tuomi [Tue, 20 Sep 2016 12:02:42 +0000 (15:02 +0300)] 
imap-login: Honor nopipelining during preauth

9 years agolib-storage: remove unused internal_attribute argument from attribute_{get,set}
Josef 'Jeff' Sipek [Tue, 20 Sep 2016 12:51:29 +0000 (08:51 -0400)] 
lib-storage: remove unused internal_attribute argument from attribute_{get,set}

This removes an argument added in 9f37ef2a9192e7d47e3d7ac959080fd01120f2e9
but obsoleted (but not removed) in d1147c225f64596fc5eeb1cb2aab31b3c57d5215.

Not only does this change simplify the codebase, it actually brings the API
closer to what it was back in 2.2.

9 years agolib-dcrypt: Set NOPLUGIN_LDFLAGS to empty
Aki Tuomi [Tue, 20 Sep 2016 09:47:32 +0000 (12:47 +0300)] 
lib-dcrypt: Set NOPLUGIN_LDFLAGS to empty

Avoids -Wl,--as-needed here

9 years agolib-dcrypt: Makefile.am fix
Aki Tuomi [Tue, 20 Sep 2016 07:52:08 +0000 (10:52 +0300)] 
lib-dcrypt: Makefile.am fix

Remove dcrypt.c from openssl library and add missing slash

9 years agolib: Ensure handler_context is not NULL
Aki Tuomi [Fri, 16 Sep 2016 12:50:22 +0000 (15:50 +0300)] 
lib: Ensure handler_context is not NULL

handler context must not be NULL here.

9 years agolib: Prevent crash in ioloop
Aki Tuomi [Fri, 16 Sep 2016 12:49:36 +0000 (15:49 +0300)] 
lib: Prevent crash in ioloop

If only non-fd sources and no timeouts are
in ioloop, prevent crash and unnecessary
waiting when there are pending IOs.

9 years agolib: Assert if i_stream_create_seekable_path(temp_path_prefix==NULL)
Timo Sirainen [Mon, 19 Sep 2016 13:20:14 +0000 (16:20 +0300)] 
lib: Assert if i_stream_create_seekable_path(temp_path_prefix==NULL)

If the stream becomes large enough it would crash then in a callback
function, which makes debugging more difficult.

9 years agofts-plugin: Remove NULL assert
Aki Tuomi [Mon, 19 Sep 2016 09:27:16 +0000 (12:27 +0300)] 
fts-plugin: Remove NULL assert

fts_backend_update_deinit will set box to NULL and call
update_set_mailbox then. NULL check needs to be done
in backends.

9 years agofts-backend-solr: Check that box is not NULL
Aki Tuomi [Mon, 19 Sep 2016 09:26:46 +0000 (12:26 +0300)] 
fts-backend-solr: Check that box is not NULL

fts_backend_update_deinit will set box to NULL and call
update_set_mailbox then.

9 years agofts-backend-lucene: Check that box is not NULL
Aki Tuomi [Mon, 19 Sep 2016 09:26:08 +0000 (12:26 +0300)] 
fts-backend-lucene: Check that box is not NULL

fts_backend_update_deinit will set box to NULL and call
update_set_mailbox then.

9 years agolib-ssl-iostream: The final fix to make the SSL plugin loading not fail..
Timo Sirainen [Mon, 19 Sep 2016 08:08:08 +0000 (11:08 +0300)] 
lib-ssl-iostream: The final fix to make the SSL plugin loading not fail..

9 years agolib-ssl-iostream: Fixed OpenSSL module to be actually initialized.
Timo Sirainen [Sun, 18 Sep 2016 13:33:07 +0000 (16:33 +0300)] 
lib-ssl-iostream: Fixed OpenSSL module to be actually initialized.

9 years agoauth-policy: Ref/unref auth request
Aki Tuomi [Sat, 17 Sep 2016 09:57:00 +0000 (12:57 +0300)] 
auth-policy: Ref/unref auth request

If auth_request is not referenced it can go away
before HTTP response is handled.

9 years agofs-randomfail: Operation is unfinished on EAGAIN, not ENOENT.
Timo Sirainen [Fri, 16 Sep 2016 14:13:24 +0000 (17:13 +0300)] 
fs-randomfail: Operation is unfinished on EAGAIN, not ENOENT.

This caused crashes and other problems when using randomfail with
asynchronous fs drivers.

9 years agolib-http: Link test-http-client libssl_iostream_openssl.so directly.
Timo Sirainen [Fri, 16 Sep 2016 05:39:24 +0000 (08:39 +0300)] 
lib-http: Link test-http-client libssl_iostream_openssl.so directly.

This way it can be run without having to do make install first.

9 years agolib-ssl-iostream: Use more standard _init() & _deinit() to initialize SSL plugin
Timo Sirainen [Fri, 16 Sep 2016 05:35:55 +0000 (08:35 +0300)] 
lib-ssl-iostream: Use more standard _init() & _deinit() to initialize SSL plugin

This is mainly to make it easier for test programs to link to the plugin
directly.

9 years agolib: safe_mkstemp*() didn't always truncate prefix back to original on failure.
Timo Sirainen [Thu, 15 Sep 2016 08:30:15 +0000 (11:30 +0300)] 
lib: safe_mkstemp*() didn't always truncate prefix back to original on failure.

This caused repeated safe_mkstemp*() calls with the same prefix to keep
increasing its size. It probably didn't really break anything (unless it was
called enough many times to reach 255 filename length), but the filenames
were still confusingly ugly.

9 years agopop3-migration: Fixed crash when not specifying pop3_migration_mailbox setting.
Timo Sirainen [Thu, 15 Sep 2016 07:23:41 +0000 (10:23 +0300)] 
pop3-migration: Fixed crash when not specifying pop3_migration_mailbox setting.

9 years agoiostream-temp: If write() to temp file fails at any time, move it back to memory.
Timo Sirainen [Wed, 14 Sep 2016 11:19:39 +0000 (14:19 +0300)] 
iostream-temp: If write() to temp file fails at any time, move it back to memory.

Similarly to if the write() to temp fails during the initial move attempt.
This way even if write() fails due to out of disk space, it's not visible
to caller. An error message is logged in any case.

9 years agopop3-migration: Avoid unnecessarily using stream's hdr_size.
Timo Sirainen [Wed, 14 Sep 2016 16:06:29 +0000 (19:06 +0300)] 
pop3-migration: Avoid unnecessarily using stream's hdr_size.

Shouldn't change any behavior, except reduce CPU usage a little bit.

9 years agoimapc: mail_get_stream() shouldn't return cached hdr_size
Timo Sirainen [Wed, 14 Sep 2016 15:57:43 +0000 (18:57 +0300)] 
imapc: mail_get_stream() shouldn't return cached hdr_size

9 years agodoveadm: refactor mailbox attribute get/set/unset/list to share more code
Josef 'Jeff' Sipek [Wed, 14 Sep 2016 11:13:50 +0000 (07:13 -0400)] 
doveadm: refactor mailbox attribute get/set/unset/list to share more code

9 years agodoveadm: allow access to server attributes via empty mailbox name
Josef 'Jeff' Sipek [Tue, 13 Sep 2016 11:50:04 +0000 (07:50 -0400)] 
doveadm: allow access to server attributes via empty mailbox name

9 years agolib-storage: remove attribute accessibility checks
Josef 'Jeff' Sipek [Tue, 13 Sep 2016 11:49:41 +0000 (07:49 -0400)] 
lib-storage: remove attribute accessibility checks

index_storage_attribute_{set,get} should assume that the caller performed
due diligence and checked whether or not the user is allowed to store under
the key.

9 years agodoveadm: lowercase attribute names before trying to parse them
Josef 'Jeff' Sipek [Tue, 13 Sep 2016 07:33:06 +0000 (03:33 -0400)] 
doveadm: lowercase attribute names before trying to parse them

This now matches what the imap server does.

9 years agolib-storage: document mailbox and server attribute handling
Josef 'Jeff' Sipek [Tue, 13 Sep 2016 07:32:06 +0000 (03:32 -0400)] 
lib-storage: document mailbox and server attribute handling

9 years agolib-http: client: Fixed hang occurring when nested ioloops are used in response callb...
Stephan Bosch [Tue, 13 Sep 2016 20:54:02 +0000 (22:54 +0200)] 
lib-http: client: Fixed hang occurring when nested ioloops are used in response callbacks.

To prevent missing disconnect events, i_stream_read() is called once a change in ioloop is detected.
However, if something was actually read into the stream, the input handler was never called.
So, a response could linger in the stream buffer, without being handled, thereby causing the connection to hang indefinitely.
An additional input event could end the hang, but sometimes this doesn't happen before the request times out.

This problem was seen in test-http-payload once in about 10 invocations.
Obox uses nested ioloops, to this applies there.

9 years agolib-http: test-http-payload: Fixed problem in nested ioloop test.
Stephan Bosch [Sun, 11 Sep 2016 20:10:44 +0000 (22:10 +0200)] 
lib-http: test-http-payload: Fixed problem in nested ioloop test.

The running ioloop was not always stopped properly at the end of the test.
This caused an assert failure in the running ioloop.

9 years agolib-http: test-http-payload: Improved logging of nested ioloop tests.
Stephan Bosch [Sun, 11 Sep 2016 20:06:54 +0000 (22:06 +0200)] 
lib-http: test-http-payload: Improved logging of nested ioloop tests.

9 years agodoveadm-auth: Handle unexpected auth "continue" request without crashing.
Timo Sirainen [Sat, 10 Sep 2016 08:32:28 +0000 (11:32 +0300)] 
doveadm-auth: Handle unexpected auth "continue" request without crashing.

9 years agolib-lda: Cleanup error handling in LMTP client code.
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.

9 years agolib-master: Fixed memory leak when IPC server is handling commands.
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.

9 years agodoveadm: Don't allow doveadm_print_header(title==NULL) anymore.
Timo Sirainen [Sat, 10 Sep 2016 08:15:00 +0000 (11:15 +0300)] 
doveadm: Don't allow doveadm_print_header(title==NULL) anymore.

It's not used anywhere, and if it was used it would have crashed with at
least "tab" backend.

9 years agodict-client: Don't crash if dict-server returns broken reply.
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.

9 years agoauth: Make sure auth_request_log_info() doesn't crash when there are no passdbs
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.

9 years agoauth: Explicitly ignore return value to make static analyzer happier.
Timo Sirainen [Fri, 9 Sep 2016 15:12:41 +0000 (18:12 +0300)] 
auth: Explicitly ignore return value to make static analyzer happier.

9 years agoAdded asserts 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.

9 years agoRemoved dead code 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.

9 years agolib-storage: Fix potential crash when userdb-returns "key+=value" for a nonexistent...
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.

9 years agolib-test: Fixed NULL pointer dereference when using --enable-static-checker
Timo Sirainen [Fri, 9 Sep 2016 14:50:43 +0000 (17:50 +0300)] 
lib-test: Fixed NULL pointer dereference when using --enable-static-checker

9 years agopgsql: Fixed clearing sql_commit_result.error_type
Timo Sirainen [Fri, 9 Sep 2016 14:46:51 +0000 (17:46 +0300)] 
pgsql: Fixed clearing sql_commit_result.error_type

error was correctly set to NULL with the earlier memset(), but error_type
may have been garbage. This shouldn't have caused any actual problems.

9 years agofts-squat: Fixed memory leak on corrupted uidlist handling
Timo Sirainen [Fri, 9 Sep 2016 14:40:58 +0000 (17:40 +0300)] 
fts-squat: Fixed memory leak on corrupted uidlist handling

9 years agodict-file: Don't leak a lock on temp file creation failure.
Timo Sirainen [Fri, 9 Sep 2016 14:39:43 +0000 (17:39 +0300)] 
dict-file: Don't leak a lock on temp file creation failure.

9 years agolib-imap-urlauth: Don't access freed memory on errors.
Timo Sirainen [Fri, 9 Sep 2016 14:36:39 +0000 (17:36 +0300)] 
lib-imap-urlauth: Don't access freed memory on errors.

9 years agoimap, pop3: Added rawlog_dir setting to store IMAP/POP3 traffic logs.
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.

9 years agoconfigure: hardening logic is backwards
Josef 'Jeff' Sipek [Mon, 12 Sep 2016 20:22:24 +0000 (16:22 -0400)] 
configure: hardening logic is backwards

Before this change, the argument parsing was busted.  The --help string only
compounded the incorrect behavior by suggesting that --disable-hardening
could take a yes/no argument.

                                      | before   | after
        ------------------------------+----------+--------
        <no option>                   | enable   | enable
        --enable-hardening            | disable  | enable
        --enable-hardening=yes        | disable  | enable
        --enable-hardening=no         | enable   | disable
        --disable-hardening           | enable   | disable
        --disable-hardening=yes       | error    | error
        --disable-hardening=no        | error    | error

9 years agopop3-migration-plugin: Add to index after successful retry
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.

9 years agodoveconf: Hide any _api_key
Aki Tuomi [Mon, 12 Sep 2016 06:47:26 +0000 (09:47 +0300)] 
doveconf: Hide any _api_key

9 years agoplugins: fts - replace i_assert under _expunge_log_subtract with warning (API change)
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>
9 years agolib-storage: Limit folder full name only
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.

9 years agofs-metawrap: Fixed assert that checks we don't create empty files.
Timo Sirainen [Fri, 9 Sep 2016 11:34:12 +0000 (14:34 +0300)] 
fs-metawrap: Fixed assert that checks we don't create empty files.

If the entire write failed, offset could be 0.

9 years agolib-storage: Fixed accessing user as root when user has no uid.
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

9 years agolib-test: Added missing va_end() call.
Timo Sirainen [Fri, 9 Sep 2016 07:38:10 +0000 (10:38 +0300)] 
lib-test: Added missing va_end() call.

9 years agolib-index: Fixed mail_index_modseq_get_next_log_offset() when accessing .log.2
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.

9 years agolib-index: Make sure new dovecot.index.log files start tracking modseqs.
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.

9 years agolib-storage: Code cleanup for mailbox_get_expunge*()
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.

9 years agoimap: When hibernating, wait for old imap process to cleanup before creating new...
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

9 years agolib-fs: Moved fs_write_stream_abort_parent() to fs-api-private.h
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.

9 years agofs-randomfail: Fixed assert-crash in fs_write_stream_abort_error()
Timo Sirainen [Thu, 8 Sep 2016 23:48:45 +0000 (02:48 +0300)] 
fs-randomfail: Fixed assert-crash in fs_write_stream_abort_error()

9 years agolib-index: limit mail_index error prints to one per ioloop_time
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.

9 years agolib-test: test_expect_errors() now works for the entire log string, not just format...
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

9 years agoimap-hibernate: Increased imap-master communication timeout from 5s to 30s
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.

9 years agostats: Include PIDs in "Duplicate session ID" errors.
Timo Sirainen [Thu, 8 Sep 2016 22:08:59 +0000 (01:08 +0300)] 
stats: Include PIDs in "Duplicate session ID" errors.

9 years agolib-index: mail_index_modseq_get_next_log_offset() shouldn't return offset beyond...
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.

9 years agoimap-acl: acl plugin deinit returns 1 on non-empty
Aki Tuomi [Thu, 8 Sep 2016 20:00:56 +0000 (23:00 +0300)] 
imap-acl: acl plugin deinit returns 1 on non-empty

9 years agoacl: Deinit will return 1 on non-empty
Aki Tuomi [Thu, 8 Sep 2016 19:59:58 +0000 (22:59 +0300)] 
acl: Deinit will return 1 on non-empty

9 years agolib: Allow static analyzers to check for t_pop() leaks.
Timo Sirainen [Thu, 8 Sep 2016 18:31:37 +0000 (21:31 +0300)] 
lib: Allow static analyzers to check for t_pop() leaks.

They should be able to detect the missing free() call from code paths
missing a t_pop().

9 years agoconfigure: Added --enable-static-checker parameter
Timo Sirainen [Thu, 8 Sep 2016 18:31:25 +0000 (21:31 +0300)] 
configure: Added --enable-static-checker parameter

9 years agoimap: Avoid wrongly assert-crashing in client_check_command_hangs()
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)

9 years agostats plugin: Don't send any stats before CONNECT was successfully sent.
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

9 years agolib-stats: stats_connection_send() now returns whether it succeeded or not
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

9 years agodoveadm flags: Sync mailbox after committing transaction.
Timo Sirainen [Thu, 8 Sep 2016 13:50:02 +0000 (16:50 +0300)] 
doveadm flags: Sync mailbox after committing transaction.

9 years agoacl-plugin: Adjust to API changes
Aki Tuomi [Wed, 7 Sep 2016 13:45:09 +0000 (16:45 +0300)] 
acl-plugin: Adjust to API changes

9 years agolmtp: Always read settings before dropping privs
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.

9 years agoimap: Fixed assert-crash if un-hibernation failed to initialize user.
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)

9 years agofs-api: Retrieve errno before dest->copy_output is NULL'ed
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.

9 years agoacl-plugin: Whitespace fixes
Aki Tuomi [Sat, 3 Sep 2016 12:26:39 +0000 (15:26 +0300)] 
acl-plugin: Whitespace fixes

9 years agoacl-plugin: Deinit acl_iter on deinit too
Aki Tuomi [Sat, 3 Sep 2016 12:23:11 +0000 (15:23 +0300)] 
acl-plugin: Deinit acl_iter on deinit too

9 years agoacl-plugin: Make iterators more conforming
Aki Tuomi [Sat, 3 Sep 2016 10:14:29 +0000 (13:14 +0300)] 
acl-plugin: Make iterators more conforming

The *_next functions return true/false, deinit will
report errors and end result.

9 years agolib-storage: Check that UID is set before caching
Aki Tuomi [Tue, 6 Sep 2016 06:24:06 +0000 (09:24 +0300)] 
lib-storage: Check that UID is set before caching

9 years agolib-imap-storage: Check that UID is assigned 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

9 years agozlib-plugin: Check that UID is assigned
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.

9 years agoquota: Flush quota after recalc
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.

9 years agolib-dcrypt: Avoid infinite loop if istream header is too large.
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)

9 years agodovecot.service.in: removed ExecStartPre and ExecStopPost default definitions
Ville Savolainen [Mon, 5 Sep 2016 08:21:30 +0000 (11:21 +0300)] 
dovecot.service.in: removed ExecStartPre and ExecStopPost default definitions

Additional definitions currently added to dovecot.service.d/ by packaging

9 years agodcrypt: Test for stream prefetch
Aki Tuomi [Thu, 25 Aug 2016 09:27:51 +0000 (12:27 +0300)] 
dcrypt: Test for stream prefetch

9 years agodcrypt: Allow 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.

9 years agolib: If DEBUG is enabled, use a pointer type for data_stack_frame_t
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.

9 years agolib: Changed t_pop() API to make it a bit more like free()
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()

9 years agolib-master: master_service_init_finish() now verifies that t_pop() wasn't leaked
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

9 years agolib: Created data_stack_frame_t type for data_stack_frame
Timo Sirainen [Thu, 1 Sep 2016 05:31:14 +0000 (08:31 +0300)] 
lib: Created data_stack_frame_t type for data_stack_frame

9 years agolib: Small code cleanup to data-stack - use explicit data_stack_initialized
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.

9 years agolib: Minor t_push() optimization - use unlikely()
Timo Sirainen [Thu, 1 Sep 2016 05:11:46 +0000 (19:11 -1000)] 
lib: Minor t_push() optimization - use unlikely()

9 years agolib: var-expand: Removed var_expand_table_build().
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().

9 years agoFix control flow and T_BEGIN/T_END hygiene
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>
9 years agolib-fs: Do not abort parent of parent
Aki Tuomi [Wed, 31 Aug 2016 06:20:49 +0000 (09:20 +0300)] 
lib-fs: Do not abort parent of parent

9 years agoconfigure.ac: Forgot to invoke DOVECOT_WANT_VPOPMAIL.
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.