]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
8 years agolib-dict: Compiler warning fix
Timo Sirainen [Tue, 17 Jan 2017 17:21:08 +0000 (19:21 +0200)] 
lib-dict: Compiler warning fix

8 years agodict-file: Fix potential crash when doing other dict calls during iteration.
Timo Sirainen [Mon, 16 Jan 2017 14:58:31 +0000 (16:58 +0200)] 
dict-file: Fix potential crash when doing other dict calls during iteration.

If file was refreshed, the hash table was cleared, which broke the existing
iterators.

8 years agolib-dict: Add assert to make sure all iterators are deinitialized.
Timo Sirainen [Mon, 16 Jan 2017 15:12:41 +0000 (17:12 +0200)] 
lib-dict: Add assert to make sure all iterators are deinitialized.

8 years agolib: Add asserts to make sure hash table isn't freed while it's frozen.
Timo Sirainen [Mon, 16 Jan 2017 14:57:21 +0000 (16:57 +0200)] 
lib: Add asserts to make sure hash table isn't freed while it's frozen.

8 years agofts-solr: Escape {} chars when sending queries
Timo Sirainen [Mon, 16 Jan 2017 21:55:17 +0000 (23:55 +0200)] 
fts-solr: Escape {} chars when sending queries

Fixes:
java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986

Based on patch by Michael Welsh Duggan

8 years agolib-http: server: Do not generate a payload for a failure response for a HEAD request.
Stephan Bosch [Tue, 17 Jan 2017 00:37:25 +0000 (01:37 +0100)] 
lib-http: server: Do not generate a payload for a failure response for a HEAD request.

8 years agolib-http: server: Prevent sending response payload when it is not allowed by the...
Stephan Bosch [Tue, 17 Jan 2017 00:36:10 +0000 (01:36 +0100)] 
lib-http: server: Prevent sending response payload when it is not allowed by the specification.

For a HEAD request, the payload is omitted, but the associated headers are generated.
For the other cases, an assert failure is now triggered.

8 years agodict-sql: Fix flushing
Aki Tuomi [Mon, 16 Jan 2017 07:37:05 +0000 (09:37 +0200)] 
dict-sql: Fix flushing

Remove flushing from set, and add it to unset. Fixes
signal 11 crash caused by infinite recursion.

8 years agolib-storage: Add vsize extension to index
Aki Tuomi [Tue, 3 Jan 2017 15:21:33 +0000 (17:21 +0200)] 
lib-storage: Add vsize extension to index

Keep virtual size in index, instead of cache
when it's less than 2^32-1. This helps when
cache becomes corrupted, and goes away, we
still have virtual sizes for quota calculations.

8 years agolib-storage: Fix assert-crash on mailbox_copy/move() failure
Timo Sirainen [Sun, 15 Jan 2017 17:56:32 +0000 (19:56 +0200)] 
lib-storage: Fix assert-crash on mailbox_copy/move() failure

If mailbox_save_cancel() was being called outside mail_storage_copy()
it assert-crashed:

Panic: file mail-storage.c: line 2168 (mailbox_save_context_reset): assertion failed: (ctx->copying_via_save)

8 years agolib-storage: If namespaces weren't successfully created, don't autoexpunge at deinit.
Timo Sirainen [Sat, 14 Jan 2017 14:11:37 +0000 (16:11 +0200)] 
lib-storage: If namespaces weren't successfully created, don't autoexpunge at deinit.

8 years agolib-storage: Add struct mail_user.namespaces_created
Timo Sirainen [Sat, 14 Jan 2017 14:12:56 +0000 (16:12 +0200)] 
lib-storage: Add struct mail_user.namespaces_created

This makes it easier to determine in mail_namespaces_added hook if the
namespaces being added are the initial ones or later ones.

8 years agolib-storage: Stop namespaces_added|created hooks immediately when user has failed
Timo Sirainen [Sat, 14 Jan 2017 14:12:03 +0000 (16:12 +0200)] 
lib-storage: Stop namespaces_added|created hooks immediately when user has failed

8 years agodoveadm dict get: Support printing multiple values.
Timo Sirainen [Sat, 14 Jan 2017 14:10:15 +0000 (16:10 +0200)] 
doveadm dict get: Support printing multiple values.

8 years agodict-sql: Support multiple values for lookups
Timo Sirainen [Mon, 9 Jan 2017 18:32:12 +0000 (20:32 +0200)] 
dict-sql: Support multiple values for lookups

The value's fields must be comma-separated without spaces, for example:

map {
  value_field = field1,field2
  value_type = string,uint
  ...

Only the first field is used for INSERTs and UPDATEs.

8 years agodict-client: Support multiple values for lookups
Timo Sirainen [Thu, 12 Jan 2017 18:35:12 +0000 (20:35 +0200)] 
dict-client: Support multiple values for lookups

8 years agolib-dict: Add support for lookup to return multiple values
Timo Sirainen [Thu, 12 Jan 2017 18:22:38 +0000 (20:22 +0200)] 
lib-dict: Add support for lookup to return multiple values

Implements only the initial stubs to the drivers.

8 years agodict-sql: Remove unnecessary "affected rows" tracking from dict_set()
Timo Sirainen [Sat, 14 Jan 2017 14:54:34 +0000 (16:54 +0200)] 
dict-sql: Remove unnecessary "affected rows" tracking from dict_set()

This was useful for dict_atomic_inc(), but not for dict_set().

Fixes assert-crash with Cassandra:
Panic: file driver-cassandra.c: line 1350 (driver_cassandra_update): assertion failed: (affected_rows == NULL)

8 years agodict-sql: Fix previous "merge sets" to flush at commit
Timo Sirainen [Sat, 14 Jan 2017 14:45:06 +0000 (16:45 +0200)] 
dict-sql: Fix previous "merge sets" to flush at commit

The last dict_set() within transaction was being ignored.

8 years agolib-storage: Fix accessing the same "raw" mailbox multiple times in process.
Timo Sirainen [Sat, 14 Jan 2017 13:10:17 +0000 (15:10 +0200)] 
lib-storage: Fix accessing the same "raw" mailbox multiple times in process.

If the same file was opened as the raw mailbox multiple times, the previous
mail_index was cached by mail-index-alloc-cache. Opening it the second time
already contained a mail in the index, so trying to add another one logged
an error:

Error: Log synchronization error at seq=1,offset=256 for (in-memory index): Append with UID 1, but next_uid = 2

8 years agoimapc: Fix re-sending retryable commands after reconnect
Timo Sirainen [Fri, 13 Jan 2017 18:39:42 +0000 (20:39 +0200)] 
imapc: Fix re-sending retryable commands after reconnect

8 years agolib-storage: Allow namespaces_created hook to return failure via user error.
Timo Sirainen [Thu, 12 Jan 2017 14:20:40 +0000 (16:20 +0200)] 
lib-storage: Allow namespaces_created hook to return failure via user error.

8 years agolib-storage: Improve namespace error message - include separator char.
Timo Sirainen [Wed, 11 Jan 2017 22:53:54 +0000 (00:53 +0200)] 
lib-storage: Improve namespace error message - include separator char.

It wasn't always obvious what the character should have been when
namespace didn't have an explicitly configured separator.

8 years agolib-dict-sql: Try merge sets to single update
Aki Tuomi [Wed, 11 Jan 2017 17:43:30 +0000 (19:43 +0200)] 
lib-dict-sql: Try merge sets to single update

This attempts to put mergeable keys into same
update instead of using multiple SQL statements.

8 years agolib-dcrypt: istream-decrypt - set stream_errno=EPIPE on unexpected EOF
Timo Sirainen [Fri, 23 Dec 2016 18:17:06 +0000 (13:17 -0500)] 
lib-dcrypt: istream-decrypt - set stream_errno=EPIPE on unexpected EOF

8 years agoconfigure: Link libsmtp before libdns
Timo Sirainen [Tue, 10 Jan 2017 17:23:30 +0000 (19:23 +0200)] 
configure: Link libsmtp before libdns

Fixes linking LIBDOVECOT when using .a libraries

8 years agolib-storage: Compile & indent fix for previous change.
Timo Sirainen [Tue, 10 Jan 2017 12:45:20 +0000 (14:45 +0200)] 
lib-storage: Compile & indent fix for previous change.

8 years agolib-storage: Prevent recursion in header parsing
Aki Tuomi [Thu, 5 Jan 2017 08:50:55 +0000 (10:50 +0200)] 
lib-storage: Prevent recursion in header parsing

If header parsing error occurs and error handling tries
to get fields, such as Message-ID, it will cause
crash. This fixes problem by preventing reading from
non-cached headers while they are being parsed.

Fixes lmtp: Panic: file ../../../src/lib/array.h: line 219 (array_idx_i):
assertion failed: (idx * array->element_size < array->buffer->used)

8 years agocassandra: Support configuring heartbeat_interval and idle_timeout
Timo Sirainen [Mon, 9 Jan 2017 15:48:56 +0000 (17:48 +0200)] 
cassandra: Support configuring heartbeat_interval and idle_timeout

8 years agodirector: Fix assert-crash when flush script takes too long
Timo Sirainen [Tue, 10 Jan 2017 11:29:34 +0000 (13:29 +0200)] 
director: Fix assert-crash when flush script takes too long

Fixes:
Panic: file director.c: line 966 (director_user_move_timeout): assertion failed: (user->kill_ctx->kill_state != USER_KILL_STATE_FLUSHING)

8 years agocassandra: Add support for "bigint" value type.
Timo Sirainen [Mon, 9 Jan 2017 18:31:35 +0000 (20:31 +0200)] 
cassandra: Add support for "bigint" value type.

8 years agodict-client: When failing to resend commands after reconnect, their success is uncertain.
Timo Sirainen [Mon, 9 Jan 2017 20:39:09 +0000 (22:39 +0200)] 
dict-client: When failing to resend commands after reconnect, their success is uncertain.

It's possible that the writes before the disconnection did actually finish
successfully. If any of them were commits, we need to return
DICT_COMMIT_RET_WRITE_UNCERTAIN.

8 years agodict-sql: Support transaction timestamps with Cassandra driver
Timo Sirainen [Mon, 9 Jan 2017 15:05:14 +0000 (17:05 +0200)] 
dict-sql: Support transaction timestamps with Cassandra driver

8 years agodict-client: Pass through transaction timestamp to dict-server
Timo Sirainen [Mon, 9 Jan 2017 17:16:04 +0000 (19:16 +0200)] 
dict-client: Pass through transaction timestamp to dict-server

8 years agolib-dict: Add dict_transaction_set_timestamp()
Timo Sirainen [Mon, 9 Jan 2017 14:55:45 +0000 (16:55 +0200)] 
lib-dict: Add dict_transaction_set_timestamp()

8 years agodict-ldap|fs: Explicitly specify used dict_vfuncs methods.
Timo Sirainen [Mon, 9 Jan 2017 17:10:25 +0000 (19:10 +0200)] 
dict-ldap|fs: Explicitly specify used dict_vfuncs methods.

This was done for other dict drivers in
ade5567577dadb0b275c840208d3ad21a9f00a36

8 years agoconfig: Fix checking if <path needs to be expanded
Timo Sirainen [Thu, 29 Dec 2016 18:17:57 +0000 (13:17 -0500)] 
config: Fix checking if <path needs to be expanded

8 years agolmtp: Don't deliver truncated email when client disconnects before "." line
Timo Sirainen [Mon, 9 Jan 2017 13:12:48 +0000 (15:12 +0200)] 
lmtp: Don't deliver truncated email when client disconnects before "." line

This didn't happen always, because the EOF was handled in two different
places in different ways.

8 years agoauth-policy: Add missing settings
Aki Tuomi [Mon, 9 Jan 2017 07:57:58 +0000 (09:57 +0200)] 
auth-policy: Add missing settings

8 years agoauth-policy: Enable SSL connections
Aki Tuomi [Sun, 8 Jan 2017 18:09:33 +0000 (20:09 +0200)] 
auth-policy: Enable SSL connections

8 years agoauth-policy: hashed_password will always be blank, tell buffer it has data so str_len...
Greg C [Wed, 4 Jan 2017 22:02:28 +0000 (14:02 -0800)] 
auth-policy: hashed_password will always be blank, tell buffer it has data so str_len works when converting to hex

8 years agolib-program-client: Do not call program_client_fail twice
Aki Tuomi [Sun, 8 Jan 2017 16:44:32 +0000 (18:44 +0200)] 
lib-program-client: Do not call program_client_fail twice

Fixes crash in program-client caused by use of freed memory.

8 years agoistream-mmap: Mark stream eof on error and copy errno
Aki Tuomi [Sun, 25 Dec 2016 08:14:07 +0000 (10:14 +0200)] 
istream-mmap: Mark stream eof on error and copy errno

8 years agolib, lib-http: add HTTP_URL_ALLOW_PCT_NUL flag
Martti Rannanjärvi [Fri, 16 Dec 2016 18:27:09 +0000 (20:27 +0200)] 
lib, lib-http: add HTTP_URL_ALLOW_PCT_NUL flag

This allows a URL to contain %00.

8 years agoautoexpunge: Consider last_rename_stamp on expunge
Aki Tuomi [Tue, 27 Dec 2016 12:01:14 +0000 (14:01 +0200)] 
autoexpunge: Consider last_rename_stamp on expunge

When expunging by saved date, see if last_rename_stamp
is more recent than saved date, and use that instead.

This prevents mails getting deleted on a folder that
was just renamed, the user probably expects autoexpunge
to consider these emails as fresh.

8 years agoindex-storage: Update mailbox last_rename_stamp on rename
Aki Tuomi [Wed, 28 Dec 2016 20:45:22 +0000 (22:45 +0200)] 
index-storage: Update mailbox last_rename_stamp on rename

8 years agolib-lda: Moved LMTP client to lib-smtp.
Stephan Bosch [Fri, 30 Dec 2016 15:20:12 +0000 (16:20 +0100)] 
lib-lda: Moved LMTP client to lib-smtp.

This makes the LMTP client available without dependency on lib-storage.
For Dovecot v2.3, the newly created lib-smtp will evolve into a full client/server SMTP implementation.
That will then remove the remaining SMTP code from lib-lda.

8 years agoUpdated copyright notices to include the year 2017.
Stephan Bosch [Sun, 1 Jan 2017 12:31:30 +0000 (13:31 +0100)] 
Updated copyright notices to include the year 2017.

8 years agolib-mail: header filter should call callback for added EOH
Josef 'Jeff' Sipek [Tue, 27 Dec 2016 20:03:51 +0000 (15:03 -0500)] 
lib-mail: header filter should call callback for added EOH

If we add a EOH because there wasn't one and
HEADER_FILTER_ADD_MISSING_EOH was specified, we should invoke the
callback for it.  Otherwise, it is unnecessarily difficult for consumers
to add a header since there is no way to know if EOH will be present
ahead of time.

8 years agolib-mail: refactor header filter test code
Josef 'Jeff' Sipek [Wed, 28 Dec 2016 15:49:49 +0000 (10:49 -0500)] 
lib-mail: refactor header filter test code

8 years agomaster: revert i_zero change on sd-daemon.c
Martti Rannanjärvi [Tue, 27 Dec 2016 13:50:31 +0000 (15:50 +0200)] 
master: revert i_zero change on sd-daemon.c

8 years agolib: add separator also if arr[0] is empty in string array joins
Martti Rannanjärvi [Sun, 4 Dec 2016 12:58:14 +0000 (14:58 +0200)] 
lib: add separator also if arr[0] is empty in string array joins

Also add a couple test cases.

8 years agolib-compression: use LZ4_compress_default if can
Martti Rannanjärvi [Wed, 21 Dec 2016 05:53:52 +0000 (07:53 +0200)] 
lib-compression: use LZ4_compress_default if can

LZ4_compress is deprecated.

8 years agolib-storage: Update mail_get_headers() API comment
Timo Sirainen [Sun, 18 Dec 2016 10:03:10 +0000 (12:03 +0200)] 
lib-storage: Update mail_get_headers() API comment

The API was changed by 990d55ce3fc461eeacce3ef830b1c5dde5c3f150

8 years agoglobal: Replaced all instances of memset(p, 0, sizeof(*p)) with the new i_zero()...
Stephan Bosch [Sun, 18 Dec 2016 12:22:15 +0000 (13:22 +0100)] 
global: Replaced all instances of memset(p, 0, sizeof(*p)) with the new i_zero() macro.

Used the following script:

C_FILES=`git ls-files *.c`
H_FILES=`git ls-files *.h`
for F in "$C_FILES $H_FILES"; do
        echo "$F"
  perl -p -i -e 's/safe_memset\(&\(?([^,]*)\)?,\s*0,\s*sizeof\(\g1\)\)/i_zero_safe(&$1)/g' $F
  perl -p -i -e 's/safe_memset\(([^,]*),\s*0,\s*sizeof\(\*\g1\)\)/i_zero_safe($1)/g' $F
  perl -p -i -e 's/memset\(&\(?([^,]*)\)?,\s*0,\s*sizeof\(\g1\)\)/i_zero(&$1)/g' $F
  perl -p -i -e 's/memset\(([^,]*),\s*0,\s*sizeof\(\*\g1\)\)/i_zero($1)/g' $F
done

8 years agolib: Created i_zero() wrapper for memset(p, 0, sizeof(*p)).
Stephan Bosch [Sun, 18 Dec 2016 12:20:20 +0000 (13:20 +0100)] 
lib: Created i_zero() wrapper for memset(p, 0, sizeof(*p)).

Also creates an i_zero_safe() version for safe_memset().

8 years agoglobal: Made all struct initialization using memset() use the same style.
Stephan Bosch [Sat, 17 Dec 2016 12:12:39 +0000 (13:12 +0100)] 
global: Made all struct initialization using memset() use the same style.

8 years agoFix link failure against libressl.
Nick Wallingford [Fri, 23 Dec 2016 21:58:38 +0000 (13:58 -0800)] 
Fix link failure against libressl.

8 years agolib-mail: Fix memory leak in test-istream-attachment
Timo Sirainen [Fri, 23 Dec 2016 19:15:49 +0000 (14:15 -0500)] 
lib-mail: Fix memory leak in test-istream-attachment

8 years agolib: Add unit test for istream-sized
Timo Sirainen [Fri, 23 Dec 2016 17:53:49 +0000 (12:53 -0500)] 
lib: Add unit test for istream-sized

8 years agolib: istream-sized - consistently set stream_errno=EINVAL if stream is too large
Timo Sirainen [Fri, 23 Dec 2016 17:52:45 +0000 (12:52 -0500)] 
lib: istream-sized - consistently set stream_errno=EINVAL if stream is too large

Earlier it was sometimes done and sometimes not, depending on whether the
parent istream happened to stop at the expected boundary.

8 years agolib: istream-sized - set stream_errno=EPIPE if stream is too small
Timo Sirainen [Fri, 23 Dec 2016 17:51:41 +0000 (12:51 -0500)] 
lib: istream-sized - set stream_errno=EPIPE if stream is too small

8 years agolib: istream-sized - remove explicit i_error() logging
Timo Sirainen [Fri, 23 Dec 2016 17:26:17 +0000 (12:26 -0500)] 
lib: istream-sized - remove explicit i_error() logging

The stream_errno is set, so it's the caller's responsibility to log the
error. There's no need to log it twice.

8 years agolib-compression: istream-{bzlib|lz4} - set stream_errno=EPIPE on unexpected EOF
Timo Sirainen [Fri, 23 Dec 2016 18:19:50 +0000 (13:19 -0500)] 
lib-compression: istream-{bzlib|lz4} - set stream_errno=EPIPE on unexpected EOF

8 years agolib-mail: istream-qp-decoder: set stream_errno=EPIPE on unexpected EOF
Timo Sirainen [Fri, 23 Dec 2016 18:30:56 +0000 (13:30 -0500)] 
lib-mail: istream-qp-decoder: set stream_errno=EPIPE on unexpected EOF

8 years agolib-fs: istream-metawrap - set stream_errno=EPIPE on unexpected EOF
Timo Sirainen [Fri, 23 Dec 2016 18:23:39 +0000 (13:23 -0500)] 
lib-fs: istream-metawrap - set stream_errno=EPIPE on unexpected EOF

8 years agolib-storage: istream-mail - Use EPIPE if istream is too small
Timo Sirainen [Fri, 23 Dec 2016 18:14:43 +0000 (13:14 -0500)] 
lib-storage: istream-mail - Use EPIPE if istream is too small

8 years agolib-mail: Improve istream-attachment-extractor unit test for EIO errors
Timo Sirainen [Fri, 23 Dec 2016 18:08:59 +0000 (13:08 -0500)] 
lib-mail: Improve istream-attachment-extractor unit test for EIO errors

8 years agolib-mail: istream-attachment-extractor - use EIO for internal errors
Timo Sirainen [Fri, 23 Dec 2016 17:59:13 +0000 (12:59 -0500)] 
lib-mail: istream-attachment-extractor - use EIO for internal errors

These happen only if the attachment writing failed for some reason.
The input stream itself can't have any errors, so EINVAL isn't proper.

8 years agolib-mail: istream-attachment-extractor - remove unnecessary code
Timo Sirainen [Fri, 23 Dec 2016 17:56:24 +0000 (12:56 -0500)] 
lib-mail: istream-attachment-extractor - remove unnecessary code

It's enough to set the stream_errno.

8 years agolib: istream-jsonstr - return EPIPE if end-of-string quote isn't seen
Timo Sirainen [Fri, 23 Dec 2016 16:57:59 +0000 (11:57 -0500)] 
lib: istream-jsonstr - return EPIPE if end-of-string quote isn't seen

8 years agolib: Add istream-jsonstr unit test.
Timo Sirainen [Fri, 23 Dec 2016 16:28:48 +0000 (11:28 -0500)] 
lib: Add istream-jsonstr unit test.

8 years agolib: istream-jsonstr - minor code cleanup
Timo Sirainen [Wed, 21 Dec 2016 16:35:05 +0000 (18:35 +0200)] 
lib: istream-jsonstr - minor code cleanup

If ret==0 here, it means dest wasn't changed, which must mean that i==0.
Make it clear to avoid confusion.

8 years agolib: istream-base64-decoder - use stream_errno=EPIPE for unexpected EOF
Timo Sirainen [Fri, 23 Dec 2016 17:13:16 +0000 (12:13 -0500)] 
lib: istream-base64-decoder - use stream_errno=EPIPE for unexpected EOF

8 years agoglobal: Use const for all test_functions[] arrays
Timo Sirainen [Fri, 23 Dec 2016 16:22:53 +0000 (11:22 -0500)] 
global: Use const for all test_functions[] arrays

8 years agolib-test: test_run*() - use const for test_functions[] array
Timo Sirainen [Fri, 23 Dec 2016 16:22:11 +0000 (11:22 -0500)] 
lib-test: test_run*() - use const for test_functions[] array

8 years agoglobal: Use "static const" for all struct tests[] arrays
Timo Sirainen [Fri, 23 Dec 2016 15:57:16 +0000 (17:57 +0200)] 
global: Use "static const" for all struct tests[] arrays

8 years agolib-test: test_run_named*() - use const for tests[] array
Timo Sirainen [Fri, 23 Dec 2016 15:48:19 +0000 (17:48 +0200)] 
lib-test: test_run_named*() - use const for tests[] array

8 years ago*-login, imapc: Fix new lib-sasl API usage
Timo Sirainen [Fri, 23 Dec 2016 13:38:54 +0000 (15:38 +0200)] 
*-login, imapc: Fix new lib-sasl API usage

Forgot to include these in a669d351502e15802b121e1a0bd83f27d1d95f01

8 years agolib-index: Fix assert-crash if .log creation unexpectedly fails at the end
Timo Sirainen [Mon, 19 Dec 2016 13:31:50 +0000 (15:31 +0200)] 
lib-index: Fix assert-crash if .log creation unexpectedly fails at the end

Pretty much the only reason for this to happen is if the index directory
was deleted while another process still had the index open. Even this
doesn't normally trigger this crash, because there are other checks earlier
that usually catch it. So it crashes only in some race conditions.

Fixes:
Error: rename(.../dovecot.index.log.newlock, .../dovecot.index.log) failed: No such file or directory
Panic: file mail-transaction-log-file.c: line 105 (mail_transaction_log_file_free): assertion failed: (!file->locked)

8 years agostats: use o_stream_nsend in client-export
Martti Rannanjärvi [Tue, 20 Dec 2016 11:40:17 +0000 (13:40 +0200)] 
stats: use o_stream_nsend in client-export

8 years agofs-randomfail: Fix failure handling for fs_read()
Timo Sirainen [Thu, 22 Dec 2016 16:58:29 +0000 (11:58 -0500)] 
fs-randomfail: Fix failure handling for fs_read()

8 years agolib-index: Fix checking if cache file becomes >4GB
Timo Sirainen [Wed, 21 Dec 2016 18:56:58 +0000 (20:56 +0200)] 
lib-index: Fix checking if cache file becomes >4GB

8 years agoimap: use o_stream_nsend when not checking failure
Martti Rannanjärvi [Tue, 20 Dec 2016 11:34:43 +0000 (13:34 +0200)] 
imap: use o_stream_nsend when not checking failure

8 years agoreplication: ignore o_stream_send errors in doveadm-connection
Martti Rannanjärvi [Tue, 20 Dec 2016 08:03:40 +0000 (10:03 +0200)] 
replication: ignore o_stream_send errors in doveadm-connection

8 years agolib-mail: message_binary_part_deserialize(): Return error if body line count is too...
Timo Sirainen [Thu, 22 Dec 2016 16:53:06 +0000 (11:53 -0500)] 
lib-mail: message_binary_part_deserialize(): Return error if body line count is too large

The input was unsigned int, so output must also fit into unsigned int.

8 years agodovecot.service.in: Improve [service] examples
Timo Sirainen [Thu, 22 Dec 2016 15:48:27 +0000 (10:48 -0500)] 
dovecot.service.in: Improve [service] examples

Move them inside [service] section so that simply uncommenting them works.
Also give a better example of how Environment might be used.

8 years agoreplication plugin: Error handling code cleanup
Timo Sirainen [Wed, 21 Dec 2016 19:33:35 +0000 (21:33 +0200)] 
replication plugin: Error handling code cleanup

The old code happened to work in all cases, but it was more of an accident.

8 years agolib-sasl: API change - use size_t type for input/output lengths
Timo Sirainen [Wed, 21 Dec 2016 18:43:38 +0000 (20:43 +0200)] 
lib-sasl: API change - use size_t type for input/output lengths

It's highly unlikely that the length is ever >4GB, but this avoids any
potential problems with integer truncation.

8 years agolib-fts: Change fts_icu_*() to use ARRAY_TYPE(icu_utf16) for UTF16 input.
Timo Sirainen [Wed, 21 Dec 2016 18:39:37 +0000 (20:39 +0200)] 
lib-fts: Change fts_icu_*() to use ARRAY_TYPE(icu_utf16) for UTF16 input.

This makes it clearer how the API is intended to be used.

8 years agoFix compiling when compiler doesn't support typeof()
Timo Sirainen [Wed, 21 Dec 2016 17:50:10 +0000 (19:50 +0200)] 
Fix compiling when compiler doesn't support typeof()

8 years agolib-index: Make sure buffer is not null before freeing
Aki Tuomi [Mon, 19 Dec 2016 10:16:20 +0000 (12:16 +0200)] 
lib-index: Make sure buffer is not null before freeing

Fixes signal 11 crash under stress.

8 years agoconfigure: Define __STDC_LIMIT_MACROS for CXXFLAGS
Timo Sirainen [Sun, 18 Dec 2016 20:54:11 +0000 (22:54 +0200)] 
configure: Define __STDC_LIMIT_MACROS for CXXFLAGS

Fixes SIZE_MAX being undefined when building fts-lucene.

8 years agomaster: Update assert to make sure optind != 0
Timo Sirainen [Sun, 18 Dec 2016 11:20:39 +0000 (13:20 +0200)] 
master: Update assert to make sure optind != 0

Hopefully prevents Coverity warning about "doubleops[optind]" access being
uninitialized.

8 years agolib: Remove dead code from unit test
Timo Sirainen [Sun, 18 Dec 2016 10:54:34 +0000 (12:54 +0200)] 
lib: Remove dead code from unit test

8 years agolib: Allow only known %chars in printf_format_fix_noalloc()
Timo Sirainen [Tue, 29 Nov 2016 21:37:43 +0000 (23:37 +0200)] 
lib: Allow only known %chars in printf_format_fix_noalloc()

Otherwise if some libc adds a new unsupported character, our %n check might
break.

8 years agolib: Fix %n detection in printf_format_fix_noalloc()
Timo Sirainen [Tue, 29 Nov 2016 21:29:04 +0000 (23:29 +0200)] 
lib: Fix %n detection in printf_format_fix_noalloc()

It's undefined how flags, precision or length modifiers are handled with %n,
so make sure we catch all of them to detect an unwanted %n.

8 years agolib: Optimize printf_format_fix_noalloc()
Timo Sirainen [Tue, 29 Nov 2016 21:21:17 +0000 (23:21 +0200)] 
lib: Optimize printf_format_fix_noalloc()

Using strchr() is faster than looping through the characters manually.
Since this function is being called a lot, it's worth optimizing.

8 years agolib-imap-client: Fixed boolean vs integer mixup in debug message format argument.
Stephan Bosch [Sat, 17 Dec 2016 19:03:46 +0000 (20:03 +0100)] 
lib-imap-client: Fixed boolean vs integer mixup in debug message format argument.

Found with Clang -Wstrict-bool.

8 years agolib-http: client: Added test for premature connection loss to test-http-client-errors.
Stephan Bosch [Fri, 16 Dec 2016 22:38:58 +0000 (23:38 +0100)] 
lib-http: client: Added test for premature connection loss to test-http-client-errors.