]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
11 years agolib-index: Optimize removing large number of expunges.
Timo Sirainen [Wed, 28 May 2014 12:53:58 +0000 (15:53 +0300)] 
lib-index: Optimize removing large number of expunges.

11 years agolib-storage: "Message has no NUL characters" flag was being set wrong to cache file.
Timo Sirainen [Wed, 28 May 2014 01:20:58 +0000 (04:20 +0300)] 
lib-storage: "Message has no NUL characters" flag was being set wrong to cache file.
Only the first MIME part was checked for its existence.

When this flag was wrong, IMAP FETCH may have returned NUL characters
instead of converting them to 0x80 character. This apparently caused Outlook
to hang.

11 years agoCompiler warning fix
Timo Sirainen [Tue, 27 May 2014 20:11:07 +0000 (23:11 +0300)] 
Compiler warning fix

11 years agoauth: checkpassword callback callback type bike-shedding
Phil Carmody [Tue, 27 May 2014 18:17:34 +0000 (21:17 +0300)] 
auth: checkpassword callback callback type bike-shedding
This change doesn't change the compiler's (gcc) view on the correctness of
the code. It moves sparse's attention of where the potential issues are
though. Sparse used to complain about dodgy function pointer conversions on
both the way out (passing the callback function pointer), and on the way in
(entering the callback). Making the callback not lie about what it receives
gets rid of the way in warnings, but adds warnings as we pass the new
function pointer out. However, it already complains about that call anyway.
So it complains about 6 things in 3 functions rather than 6 things in 6
functions.

Of dubious worth, but it at least reduces the number of lines you need to
inspect to verify correctness.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
11 years agoimap: exit imap_fetch_binary_init() identically on all failures
Phil Carmody [Tue, 27 May 2014 18:17:34 +0000 (21:17 +0300)] 
imap: exit imap_fetch_binary_init() identically on all failures
This changes the behaviour, as -1 is TRUE as a boolean.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
11 years agoimap: use human-readable helper macro in remote_ip_is_usable
Phil Carmody [Tue, 27 May 2014 18:17:34 +0000 (21:17 +0300)] 
imap: use human-readable helper macro in remote_ip_is_usable
More readable, but helpfully shuts up sparse which complained about some
constants being long.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
11 years agoimap: cmd_getmetadata_stream_continue returns bool, not int
Phil Carmody [Tue, 27 May 2014 18:17:34 +0000 (21:17 +0300)] 
imap: cmd_getmetadata_stream_continue returns bool, not int
The behaviour is unchanged, but we shouldn't pretend that -1 is different
from TRUE in a boolean context. Its only caller only cares about whether
it's 0 or not.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
11 years agoindexer: fix indexer_queue_cancel_all behaviour
Phil Carmody [Tue, 27 May 2014 18:17:34 +0000 (21:17 +0300)] 
indexer: fix indexer_queue_cancel_all behaviour
-1 is TRUE. Presumably -1 was intended to be passed to the callbacks via
indexer_queue_request_status_int(), not 100.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
11 years agoauth: master-connection - bail on malformed list
Phil Carmody [Tue, 27 May 2014 18:17:34 +0000 (21:17 +0300)] 
auth: master-connection - bail on malformed list
If master is not communicating to us in a syntax we understand, just ask for
it to be unplugged. This changes the behaviour in this error case.

Previously, we returned -1, which is TRUE when converted to a boolean, and
thus this changes the error semantics, and may be horribly wrong. However,
the i_error()s in auth_master_input_line follow the same pattern.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
11 years agoauth: set_credentials callback being passed an enum, not a bool
Phil Carmody [Tue, 27 May 2014 18:17:34 +0000 (21:17 +0300)] 
auth: set_credentials callback being passed an enum, not a bool
This changes the behaviour, as the error case is now mapped onto FALSE.
All non-zero values of course get squashed into true. Found by sparse.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
11 years agolib-otp: cast to the correct type of function pointer
Phil Carmody [Tue, 27 May 2014 18:17:34 +0000 (21:17 +0300)] 
lib-otp: cast to the correct type of function pointer
sparse complains about the result of the F() cast being the wrong type
for the initialisation, which is true. So just cast to the right type
in the first place.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
11 years agoimap: fix missing-command check
Phil Carmody [Tue, 27 May 2014 18:17:34 +0000 (21:17 +0300)] 
imap: fix missing-command check
It's impossible for the command's pointer to be NULL at this point.
Previously, the command_find() would have returned NULL, but this check
presumably short-circuits that search in the trivial case, so has some
real use.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
11 years agolib-imap: API change - add const to imap_url *base parameter
Phil Carmody [Tue, 27 May 2014 18:17:34 +0000 (21:17 +0300)] 
lib-imap: API change - add const to imap_url *base parameter
We do not change what's there, therefore we can promise to not change what
is there.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
11 years agoauth: sparse static cleanup, and some const cleanup
Phil Carmody [Tue, 27 May 2014 18:17:34 +0000 (21:17 +0300)] 
auth: sparse static cleanup, and some const cleanup
All the consts that are added to pointers represent deep const semantics.
There are other shallow consts that I've not added, as sometimes it's
better to not be const than have something you rely on change when you
think it won't.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
11 years agovarious - 'static' sparse cleanup
Phil Carmody [Tue, 27 May 2014 18:17:34 +0000 (21:17 +0300)] 
various - 'static' sparse cleanup
Signed-off-by: Phil Carmody <phil@dovecot.fi>
11 years agolib-mail: tests - trivial sparse cleanups
Phil Carmody [Tue, 27 May 2014 18:17:34 +0000 (21:17 +0300)] 
lib-mail: tests - trivial sparse cleanups
One static const, and one more obviously not-an-int integer.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
11 years agolib-imap: tests - trivial static and const sparse cleanups
Phil Carmody [Tue, 27 May 2014 18:17:34 +0000 (21:17 +0300)] 
lib-imap: tests - trivial static and const sparse cleanups
Signed-off-by: Phil Carmody <phil@dovecot.fi>
11 years agolib-http: trivial sparse cleanups - statics and explicit NULLs
Phil Carmody [Tue, 27 May 2014 18:17:34 +0000 (21:17 +0300)] 
lib-http: trivial sparse cleanups - statics and explicit NULLs
Signed-off-by: Phil Carmody <phil@dovecot.fi>
11 years agovarious - trivial NULL-related sparse cleanups
Phil Carmody [Tue, 27 May 2014 18:17:34 +0000 (21:17 +0300)] 
various - trivial NULL-related sparse cleanups
These zero-alikes are all pointers, so should explicitly be NULL.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
11 years agotreewide - mass cleanup of 0 used to end a settings list
Phil Carmody [Tue, 27 May 2014 18:17:34 +0000 (21:17 +0300)] 
treewide - mass cleanup of 0 used to end a settings list
This also includes a change to the perl script which generates the
all-settings.c file.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
11 years agolib: pair VA_COPY with va_end
Phil Carmody [Tue, 27 May 2014 18:17:34 +0000 (21:17 +0300)] 
lib: pair VA_COPY with va_end
A va_copy creates a initialised va_list, as if a va_start had been done on it.
Therefore, pedantically, a va_end should also be done on it. On most platforms
this is a no-op, and for those where it isn't, the pairing is important.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
11 years agofts: parser-html - parser can fail on attributes='with values in single quotes'
Phil Carmody [Tue, 27 May 2014 18:17:34 +0000 (21:17 +0300)] 
fts: parser-html - parser can fail on attributes='with values in single quotes'
If that value were to contain an odd number of double quotes, then the
HTML_STATE_TAG_(D)QUOTED state would be entered and not exited.

The two quoting types behave basically the same, so just add two new cases
and duplicate the state transition code.

11 years agofts: parser-html - parse_tag_name returns wrong value for comments
Phil Carmody [Tue, 27 May 2014 18:17:34 +0000 (21:17 +0300)] 
fts: parser-html - parse_tag_name returns wrong value for comments
This function returns 1 more than the number of additional
characters to be swallowed up by the state transition.

11 years agofts: parser-html - parse_tag_name really does return an integer not a bool
Phil Carmody [Tue, 27 May 2014 18:17:34 +0000 (21:17 +0300)] 
fts: parser-html - parse_tag_name really does return an integer not a bool
It seems to return 1 more than the number of additional characters
(after '<') are swallowed up by the state change, not a bool. This
would imply that '3' is wrong.

11 years agolib-storage: functions returning bool actually return ints
Phil Carmody [Tue, 27 May 2014 18:17:34 +0000 (21:17 +0300)] 
lib-storage: functions returning bool actually return ints
Their return values are compared as if they are at least tri-state
(-ve, 0, +ve), so really aren't bools at all.

Note - this should cause the code to change in behaviour, and thus might
introduce regressions as previously all non-zeroes would have been mapped
to 1.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
11 years agolib-storage: context's dotlock_last_stale really is bool
Phil Carmody [Tue, 27 May 2014 18:17:34 +0000 (21:17 +0300)] 
lib-storage: context's dotlock_last_stale really is bool
It's only ever read as if it's a bool, so it really is a bool. Fix a write
treating it as an int.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
11 years agolib-http: Fixed assertion failure in http_client_request_send_payload() caused by...
Stephan Bosch [Tue, 27 May 2014 14:01:15 +0000 (17:01 +0300)] 
lib-http: Fixed assertion failure in http_client_request_send_payload() caused by inappropriate retry attempt.

11 years agovirtual: Crashfix: Don't deinitialize search args that haven't been initialized.
Timo Sirainen [Mon, 26 May 2014 01:26:01 +0000 (04:26 +0300)] 
virtual: Crashfix: Don't deinitialize search args that haven't been initialized.

11 years agolib-storage: Avoid refreshing mailbox list index too often.
Timo Sirainen [Mon, 26 May 2014 01:05:34 +0000 (04:05 +0300)] 
lib-storage: Avoid refreshing mailbox list index too often.

11 years agolib-storage: Optimize mailbox_exists() with mailbox_list_index=yes
Timo Sirainen [Mon, 26 May 2014 00:58:16 +0000 (03:58 +0300)] 
lib-storage: Optimize mailbox_exists() with mailbox_list_index=yes
We can return the existence from the index itself to avoid stat()s.

11 years agolib-storage: Added mailbox_list_index_very_dirty_syncs setting.
Timo Sirainen [Thu, 22 May 2014 01:12:05 +0000 (18:12 -0700)] 
lib-storage: Added mailbox_list_index_very_dirty_syncs setting.
This setting assumes that the mailbox list index is up to date and uses it
without stat()ing backend mailbox files/dirs. (As a possible future TODO it
might be useful to still do the stat()ing, but only rarely.)

11 years agoimap: If we're waiting for client to read data, show in process title how many bytes...
Timo Sirainen [Wed, 21 May 2014 13:28:36 +0000 (06:28 -0700)] 
imap: If we're waiting for client to read data, show in process title how many bytes are buffered.

11 years agolib: Added o_stream_is_corked().
Timo Sirainen [Wed, 21 May 2014 13:21:16 +0000 (06:21 -0700)] 
lib: Added o_stream_is_corked().

11 years agolib-imap: Use case-insensitive comparisons everywhere for imap_id_send setting parsing.
Timo Sirainen [Thu, 15 May 2014 20:41:55 +0000 (23:41 +0300)] 
lib-imap: Use case-insensitive comparisons everywhere for imap_id_send setting parsing.
"os" and "os-version" were case-sensitive while others were not.
Patch by Apple.

11 years agovirtual: If backend mailbox hasn't changed, we still need to build its uidmap.
Timo Sirainen [Thu, 15 May 2014 10:26:40 +0000 (13:26 +0300)] 
virtual: If backend mailbox hasn't changed, we still need to build its uidmap.

11 years agoimap: Fixed enabling METADATA if imap_capability string was explicitly set
Timo Sirainen [Wed, 14 May 2014 09:46:25 +0000 (12:46 +0300)] 
imap: Fixed enabling METADATA if imap_capability string was explicitly set

11 years agolib-fs: Make sure we don't leak data stack.
Timo Sirainen [Wed, 14 May 2014 09:28:17 +0000 (12:28 +0300)] 
lib-fs: Make sure we don't leak data stack.

11 years agolib-storage: Don't leak memory if mailbox_save_set_flags() is used multiple times...
Timo Sirainen [Tue, 13 May 2014 13:46:01 +0000 (15:46 +0200)] 
lib-storage: Don't leak memory if mailbox_save_set_flags() is used multiple times for keywords.
This affected only some external plugins.

11 years agodsync: If incremental sync fails because of desync, log the reason why
Timo Sirainen [Mon, 12 May 2014 10:21:28 +0000 (13:21 +0300)] 
dsync: If incremental sync fails because of desync, log the reason why

11 years agodsync: mailbox_metadata.cache_fields must be copied to permanent memory.
Timo Sirainen [Mon, 12 May 2014 09:51:50 +0000 (12:51 +0300)] 
dsync: mailbox_metadata.cache_fields must be copied to permanent memory.
Any other call to mailbox_get_metadata() would have cleared the memory.

11 years agoacl: Empty negative rights list should be the same as NULL negative rights list.
Timo Sirainen [Mon, 12 May 2014 09:18:46 +0000 (12:18 +0300)] 
acl: Empty negative rights list should be the same as NULL negative rights list.
There may be other places where this should be fixed, but this at least
fixes errors with dsync where "-user" entry without any rights was attempted
to be synced in dovecot-acl (although such entry shouldn't really have
existed in the first place).

11 years agolib-mail: Compiler warning fix
Timo Sirainen [Sun, 11 May 2014 19:52:30 +0000 (22:52 +0300)] 
lib-mail: Compiler warning fix

11 years agoAdded signature for changeset c55c660d6e9d
Timo Sirainen [Sun, 11 May 2014 19:33:21 +0000 (22:33 +0300)] 
Added signature for changeset c55c660d6e9d

11 years agoAdded tag 2.2.13 for changeset c55c660d6e9d
Timo Sirainen [Sun, 11 May 2014 19:33:08 +0000 (22:33 +0300)] 
Added tag 2.2.13 for changeset c55c660d6e9d

11 years agoReleased v2.2.13. 2.2.13
Timo Sirainen [Sun, 11 May 2014 19:33:08 +0000 (22:33 +0300)] 
Released v2.2.13.

11 years agolib-mail: test-message-header-decoder unit test fixed
Timo Sirainen [Sun, 11 May 2014 19:32:19 +0000 (22:32 +0300)] 
lib-mail: test-message-header-decoder unit test fixed

11 years agolib-mail: Fix to previous message_header_encode() commit
Timo Sirainen [Sun, 11 May 2014 19:31:54 +0000 (22:31 +0300)] 
lib-mail: Fix to previous message_header_encode() commit

11 years agodoveadm penalty: Fixed using -a parameter
Timo Sirainen [Sun, 11 May 2014 19:19:15 +0000 (22:19 +0300)] 
doveadm penalty: Fixed using -a parameter

11 years agolib-mail: message_header_encode() now preserves folding whitespace
Timo Sirainen [Sun, 11 May 2014 19:15:08 +0000 (22:15 +0300)] 
lib-mail: message_header_encode() now preserves folding whitespace
This function could still use some cleaning up, but good enough for now..

Also it should try to minimize the encoded words, not necessarily encoding
everything between the first and the last words that have to be encoded.

11 years agolib-mail: message_header_encode_[bq]() now explicitly takes the first line length...
Timo Sirainen [Sun, 11 May 2014 18:08:51 +0000 (21:08 +0300)] 
lib-mail: message_header_encode_[bq]() now explicitly takes the first line length parameter.
So this change partially reverts the previous change, because
message_header_encode() was actually internally relying on this behavior.
The explicit parameter makes it clearer.

11 years agolib-mail: message_header_encode() no longer tries to lookup the first line's length...
Timo Sirainen [Sun, 11 May 2014 15:28:03 +0000 (18:28 +0300)] 
lib-mail: message_header_encode() no longer tries to lookup the first line's length from output string.
This function is used only by Pigeonhole, which only uses it for empty
output strings, so it's not useful there. Also that behavior is somewhat
unexpected and confusing.

11 years agoAdded signature for changeset 791ec610422c
Timo Sirainen [Thu, 8 May 2014 15:07:30 +0000 (18:07 +0300)] 
Added signature for changeset 791ec610422c

11 years agoAdded tag 2.2.13.rc1 for changeset 791ec610422c
Timo Sirainen [Thu, 8 May 2014 15:07:23 +0000 (18:07 +0300)] 
Added tag 2.2.13.rc1 for changeset 791ec610422c

11 years agoReleased v2.2.13.rc1. 2.2.13.rc1
Timo Sirainen [Thu, 8 May 2014 15:07:23 +0000 (18:07 +0300)] 
Released v2.2.13.rc1.

11 years agotreewide - use of explicit NULL in pointer comparisons rather than 0-alikes
Phil Carmody [Thu, 8 May 2014 12:53:27 +0000 (15:53 +0300)] 
treewide - use of explicit NULL in pointer comparisons rather than 0-alikes

Found by sparse.

11 years agolib-storage: maildir - don't use a bool to store a char
Phil Carmody [Thu, 8 May 2014 14:01:26 +0000 (17:01 +0300)] 
lib-storage: maildir - don't use a bool to store a char

11 years agolib-storage: pop3c - fix invalid blank password check
Phil Carmody [Thu, 8 May 2014 12:56:25 +0000 (15:56 +0300)] 
lib-storage: pop3c - fix invalid blank password check

The pointer will never be NULL, as it's initialised pointing to an empty
string, and can only be overridden by setting it to another string. So
the test always failed. Instead, check the 1st character of the password.

11 years agolib-storage: Removed unnecessary code.
Timo Sirainen [Thu, 8 May 2014 14:02:19 +0000 (17:02 +0300)] 
lib-storage: Removed unnecessary code.
mailbox_dir_name is never NULL, and when it's empty it can be handled
exactly the same as when it's non-empty.

11 years agoRemoved unnecessary #includes.
Teemu Huovila [Thu, 8 May 2014 12:11:26 +0000 (15:11 +0300)] 
Removed unnecessary #includes.

11 years agorun-tests.sh: Add support for reading valgrind suppressions if they exist.
Teemu Huovila [Thu, 8 May 2014 11:57:56 +0000 (14:57 +0300)] 
run-tests.sh: Add support for reading valgrind suppressions if they exist.

11 years agolib: fd_read() didn't check the msg.msg_controllen size correctly
Timo Sirainen [Thu, 8 May 2014 11:34:39 +0000 (14:34 +0300)] 
lib: fd_read() didn't check the msg.msg_controllen size correctly

11 years agolib: cosmetic - rename parameters so that .h and .c files match
Phil Carmody [Tue, 6 May 2014 09:44:38 +0000 (12:44 +0300)] 
lib: cosmetic - rename parameters so that .h and .c files match

These functions were flagging sparse warnings, but those warnings are
trivially (robotically) dismissable if the parameters are identically
named in the two contexts. Opted for whichever name seemed to be more
meaningful or sensible. e.g. char** became p rather than s, as it's
a pointer more than a string.

11 years agolib: wildcard-match - use NULL not 0 for pointers
Phil Carmody [Thu, 8 May 2014 08:20:36 +0000 (11:20 +0300)] 
lib: wildcard-match - use NULL not 0 for pointers

Flagged by sparse.

11 years agolib: a couple of trivial sparse cleanups
Phil Carmody [Wed, 7 May 2014 13:52:22 +0000 (16:52 +0300)] 
lib: a couple of trivial sparse cleanups

The #include isn't needed on modern linux, as the macros are already defined
The compiler seems to silently ignore redefinitions in system header files,
so didn't throw a warning, but probably should have, as redefinitions can lead
to insanity.

The cast just makes it explicit that we're changing the prototype.

11 years agolib-storage: Make struct fail_storage/mailbox/mail_vfuncs properly extern.
Timo Sirainen [Thu, 8 May 2014 11:11:46 +0000 (14:11 +0300)] 
lib-storage: Make struct fail_storage/mailbox/mail_vfuncs properly extern.
These could be useful when implementing some new dummy storage backends.

11 years agotreewide sparse cleanup - make single-unit-only data static
Phil Carmody [Tue, 6 May 2014 15:10:55 +0000 (18:10 +0300)] 
treewide sparse cleanup - make single-unit-only data static

Helps keep the global namespace clean. Not all the things suggested by
sparse have been moved. All DOVECOT_ABI_VERSION strings, and anything
replicated in all-settings.c by src/config/settings-get.pl has been
left untouched. Some of the latter could be moved, but the script would
need to be modified to replicate the 'static' (it outputs 'extern').

11 years agolib-storage: Code cleanups and potential crashfix.
Timo Sirainen [Thu, 8 May 2014 10:45:37 +0000 (13:45 +0300)] 
lib-storage: Code cleanups and potential crashfix.
Usually in blocks_count_lines() the full_input stream reading doesn't return
eof=true in the last read but only on the next. If this had changed for some
reason the code would have crashed in the assert checks.

11 years agofts-tika: Removed lib-http kludgy workaround, which is no longer needed.
Timo Sirainen [Thu, 8 May 2014 10:27:43 +0000 (13:27 +0300)] 
fts-tika: Removed lib-http kludgy workaround, which is no longer needed.

11 years agoMake static analyzer happier
Timo Sirainen [Thu, 8 May 2014 09:39:10 +0000 (12:39 +0300)] 
Make static analyzer happier

11 years agoFixed compiling when building without SSL support.
Timo Sirainen [Thu, 8 May 2014 08:29:34 +0000 (11:29 +0300)] 
Fixed compiling when building without SSL support.

11 years agorun-test.sh: Valgrind version check was broken for v3.10+, removed it entirely.
Timo Sirainen [Thu, 8 May 2014 07:21:56 +0000 (10:21 +0300)] 
run-test.sh: Valgrind version check was broken for v3.10+, removed it entirely.
RHEL 5.9 has valgrind v3.5 already, so there shouldn't really be any
important OSes using old valgrind that we need to support.

11 years agodsync: Make static analyzer happier (hopefully)
Timo Sirainen [Wed, 7 May 2014 20:32:28 +0000 (23:32 +0300)] 
dsync: Make static analyzer happier (hopefully)

11 years agolib-mail: Added asserts to make static analyzer happier
Timo Sirainen [Wed, 7 May 2014 20:26:57 +0000 (23:26 +0300)] 
lib-mail: Added asserts to make static analyzer happier

11 years agoFixed compiling on systems without MAP_ANONYMOUS
Timo Sirainen [Wed, 7 May 2014 20:25:50 +0000 (23:25 +0300)] 
Fixed compiling on systems without MAP_ANONYMOUS
For example OSX.

11 years agoauth: Minor code cleanup
Timo Sirainen [Wed, 7 May 2014 20:22:13 +0000 (23:22 +0300)] 
auth: Minor code cleanup

11 years agoauth: LDAP errors may have crashed the auth process.
Timo Sirainen [Wed, 7 May 2014 17:24:05 +0000 (20:24 +0300)] 
auth: LDAP errors may have crashed the auth process.

11 years agolib-index: Fixed detecting broken strmap index file (thread index).
Teemu Huovila [Wed, 7 May 2014 17:21:02 +0000 (20:21 +0300)] 
lib-index: Fixed detecting broken strmap index file (thread index).

11 years agopop3: Remove dead assignment detected by scan-build.
Teemu Huovila [Wed, 7 May 2014 17:18:39 +0000 (20:18 +0300)] 
pop3: Remove dead assignment detected by scan-build.

11 years agodoveadm: table formatter printed header unaligned if it had hidden titles.
Timo Sirainen [Wed, 7 May 2014 17:14:32 +0000 (20:14 +0300)] 
doveadm: table formatter printed header unaligned if it had hidden titles.
This was broken by the previous table formatter change.

11 years agolib-imap: IMAP parser didn't parse atoms correctly that started with '~' character.
Timo Sirainen [Wed, 7 May 2014 16:47:12 +0000 (19:47 +0300)] 
lib-imap: IMAP parser didn't parse atoms correctly that started with '~' character.
literal8 begins only after "~{", not immediately after "~" which is a valid
ATOM-CHAR.

11 years agolib: fix md4/md5 buffer read overrun
Phil Carmody [Wed, 7 May 2014 15:39:23 +0000 (18:39 +0300)] 
lib: fix md4/md5 buffer read overrun

uint_fast32_t may be 64 bits and read too many bytes at the end of the buffer.
This didn't actually break anything as long as there was 32 bits of readable
memory past the buffer.

11 years agofts-lucene: Don't mix definite + maybe queries for now, since it returns broken results.
Timo Sirainen [Wed, 7 May 2014 16:34:42 +0000 (19:34 +0300)] 
fts-lucene: Don't mix definite + maybe queries for now, since it returns broken results.

11 years ago*-login: SSL connections didn't get closed when the client got destroyed.
Timo Sirainen [Wed, 7 May 2014 14:26:21 +0000 (17:26 +0300)] 
*-login: SSL connections didn't get closed when the client got destroyed.

11 years agoacl: Global ACL file used only the first matching rights line, not merging all the...
Timo Sirainen [Wed, 7 May 2014 14:12:19 +0000 (17:12 +0300)] 
acl: Global ACL file used only the first matching rights line, not merging all the matches.

11 years agolib-storage: Fixed assert-crash when looking up private flags for a mail being saved.
Timo Sirainen [Wed, 7 May 2014 13:41:34 +0000 (16:41 +0300)] 
lib-storage: Fixed assert-crash when looking up private flags for a mail being saved.

11 years agomdbox: Fixed race condition when creating a new mailbox and another process getting...
Timo Sirainen [Wed, 7 May 2014 13:36:54 +0000 (16:36 +0300)] 
mdbox: Fixed race condition when creating a new mailbox and another process getting its GUID.

11 years agoliblib: Added unit test for hash methods to make sure they don't do read access beyon...
Timo Sirainen [Wed, 7 May 2014 10:02:29 +0000 (13:02 +0300)] 
liblib: Added unit test for hash methods to make sure they don't do read access beyond buffer.
This currently fails for MD4 and MD5, so they need to be fixed/replaced..

11 years agolib-compression: Added some unit testing for lib-compression.
Timo Sirainen [Wed, 7 May 2014 10:01:17 +0000 (13:01 +0300)] 
lib-compression: Added some unit testing for lib-compression.
Not perfect in any way, but at least tests if things are completely broken.

11 years agolib-compression: gz compression didn't handle multiple flushes correctly.
Timo Sirainen [Wed, 7 May 2014 09:27:36 +0000 (12:27 +0300)] 
lib-compression: gz compression didn't handle multiple flushes correctly.

11 years agolib-compression: istream-lz4 shouldn't crash when closing the stream multiple times.
Timo Sirainen [Wed, 7 May 2014 09:26:58 +0000 (12:26 +0300)] 
lib-compression: istream-lz4 shouldn't crash when closing the stream multiple times.

11 years agolib-compression: Fixed LZMA compression.
Timo Sirainen [Wed, 7 May 2014 09:26:38 +0000 (12:26 +0300)] 
lib-compression: Fixed LZMA compression.
The code now looks more like the doc/examples/01_compress_easy.c distributed
with xz-utils. Most importantly this changes LZMA_OK to be allowed as a
result for lzma_code(zs, LZMA_FINISH).

11 years agopop3: Fixed assert-crash with some settings when there are 0 mails.
Timo Sirainen [Tue, 6 May 2014 12:34:00 +0000 (15:34 +0300)] 
pop3: Fixed assert-crash with some settings when there are 0 mails.

11 years agomkdir_parents(): Handle mkdir() EEXIST errors that may happen during race conditions.
Timo Sirainen [Mon, 5 May 2014 15:37:16 +0000 (18:37 +0300)] 
mkdir_parents(): Handle mkdir() EEXIST errors that may happen during race conditions.
We don't care about EEXIST errors that happen when trying to mkdir() parent
directories, only if it happens when mkdir()ing the last directory.

11 years agoauth: If authentication fails, never send back "nologin" field.
Timo Sirainen [Mon, 5 May 2014 13:24:53 +0000 (16:24 +0300)] 
auth: If authentication fails, never send back "nologin" field.
This only causes confusion.

11 years agomessage_header_decode_utf8() wasn't used correctly with NULL instead of FALSE parameter.
Timo Sirainen [Mon, 5 May 2014 13:02:48 +0000 (16:02 +0300)] 
message_header_decode_utf8() wasn't used correctly with NULL instead of FALSE parameter.

11 years agolib-storage: mail_get_headers_utf8() now replaces NULs with spaces.
Timo Sirainen [Mon, 5 May 2014 13:01:58 +0000 (16:01 +0300)] 
lib-storage: mail_get_headers_utf8() now replaces NULs with spaces.
Perhaps there should also be another API function which actually allows
returning strings with NULs in them.

11 years agodoveadm mail fetch: Use mail_get_headers_utf8() when fetching hdr.*.utf8
Timo Sirainen [Mon, 5 May 2014 13:00:52 +0000 (16:00 +0300)] 
doveadm mail fetch: Use mail_get_headers_utf8() when fetching hdr.*.utf8
This doesn't really matter but may allow minor optimizations later.

11 years agolib-mail: Added message_header_encode_data() to support encoding also NUL characters.
Timo Sirainen [Mon, 5 May 2014 12:39:58 +0000 (15:39 +0300)] 
lib-mail: Added message_header_encode_data() to support encoding also NUL characters.

11 years agoliblib: Added str_append_data(), which is simply a wrapper to buffer_append()
Timo Sirainen [Mon, 5 May 2014 12:05:20 +0000 (15:05 +0300)] 
liblib: Added str_append_data(), which is simply a wrapper to buffer_append()
This is intended for appending data that may contain NUL characters that are
wanted to be added to the string.

11 years agolib: quell sparse "warning: Using plain integer as NULL pointer"
Phil Carmody [Mon, 5 May 2014 12:09:27 +0000 (15:09 +0300)] 
lib: quell sparse "warning: Using plain integer as NULL pointer"

The first element of the structure is a pointer, make that explicit.