]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
5 years agolib-index: Update last_used field immediately when adding a new cache field
Timo Sirainen [Sun, 5 Apr 2020 17:41:28 +0000 (20:41 +0300)] 
lib-index: Update last_used field immediately when adding a new cache field

Otherwise the newly added field could be dropped immediately on the next
purge.

5 years agolib-index: Make sure purging clears saved bitmask offsets state between mails
Timo Sirainen [Wed, 1 Apr 2020 21:29:07 +0000 (00:29 +0300)] 
lib-index: Make sure purging clears saved bitmask offsets state between mails

This is just to make sure it doesn't try to use previous mail's offset when
merging bitmasks. This shouldn't have been possible anyway, because
field_seen array guaranteed that the bitmask_pos was always set before
reading it. This just makes extra sure of it.

5 years agolib-index: Fix mail_cache_get_first_new_seq() when all mails are old
Timo Sirainen [Wed, 1 Apr 2020 21:27:43 +0000 (00:27 +0300)] 
lib-index: Fix mail_cache_get_first_new_seq() when all mails are old

Instead of returning "all messages are old", it returned "all messages are
new".

5 years agolib-index: mail_cache_get_missing_reason() - Add "Mail is already expunged" as reason
Timo Sirainen [Wed, 1 Apr 2020 13:42:35 +0000 (16:42 +0300)] 
lib-index: mail_cache_get_missing_reason() - Add "Mail is already expunged" as reason

5 years agolib-index: Remove mail_cache_try_lock()
Timo Sirainen [Wed, 1 Apr 2020 19:24:59 +0000 (22:24 +0300)] 
lib-index: Remove mail_cache_try_lock()

5 years agolib-index: Wait for lock in cache compression, not just try once
Timo Sirainen [Tue, 31 Mar 2020 15:53:33 +0000 (18:53 +0300)] 
lib-index: Wait for lock in cache compression, not just try once

Sometimes there's an important reason for the cache to be compressed, and it
shouldn't give up just because there's a race condition with another process
that just happens to be writing to it.

5 years agolib-index: After cache is marked corrupted, don't log error if cache file isn't found
Timo Sirainen [Tue, 31 Mar 2020 14:50:42 +0000 (17:50 +0300)] 
lib-index: After cache is marked corrupted, don't log error if cache file isn't found

It's just an unnecessary extra error.

5 years agolib-index: Don't compress cache file if there are cache transactions with changes
Timo Sirainen [Wed, 1 Apr 2020 19:19:52 +0000 (22:19 +0300)] 
lib-index: Don't compress cache file if there are cache transactions with changes

The cache compression could have lost changes in the uncommitted
transactions if they had already written some changes to the file.
This seems to have happened sometimes at least with dsync.

5 years agolib-index: Cache compression could have lost data for recently added mails
Timo Sirainen [Wed, 1 Apr 2020 13:31:32 +0000 (16:31 +0300)] 
lib-index: Cache compression could have lost data for recently added mails

mail_index_sync_ctx.view may not have seen all the newly added mails,
which caused compression to skip those mails. Use a whole new view
instead, which guarantees that all mails are seen.

5 years agolib-index: Fix cache lookup for a newly added field in non-committed transaction
Timo Sirainen [Tue, 31 Mar 2020 09:08:43 +0000 (12:08 +0300)] 
lib-index: Fix cache lookup for a newly added field in non-committed transaction

The cache lookup didn't return anything unless the field already existed in
the current cache file. It could still have already been added to the
transaction and found from there.

5 years agolib-index: Don't even try to add fields to cache that exceed record_max_size
Timo Sirainen [Tue, 31 Mar 2020 08:40:58 +0000 (11:40 +0300)] 
lib-index: Don't even try to add fields to cache that exceed record_max_size

Previously these were temporarily added to memory and later on the whole
cache record was just dropped. But usually not all the cache fields are
huge, so it's better to add some fields to cache than none.

5 years agolib-index: Fix assert-crash if cache record has no content after all
Timo Sirainen [Wed, 1 Apr 2020 15:02:43 +0000 (18:02 +0300)] 
lib-index: Fix assert-crash if cache record has no content after all

This couldn't have happened yet, but will happen after the next commit.

5 years agolib-index: Use cache record's exact size when checking if it should be flushed
Timo Sirainen [Tue, 31 Mar 2020 08:37:39 +0000 (11:37 +0300)] 
lib-index: Use cache record's exact size when checking if it should be flushed

The field_idx wasn't included in the calculation.

5 years agolib-index: Replace mail_cache_flush_and_unlock() with mail_cache_unlock() where it...
Timo Sirainen [Mon, 30 Mar 2020 14:39:46 +0000 (17:39 +0300)] 
lib-index: Replace mail_cache_flush_and_unlock() with mail_cache_unlock() where it's better

In various error handling code paths it's not useful to try to flush any
headers. It might just make things worse.

5 years agolib-index: Remove backward compatibility code for Dovecot v2.1 and older
Timo Sirainen [Mon, 30 Mar 2020 14:49:35 +0000 (17:49 +0300)] 
lib-index: Remove backward compatibility code for Dovecot v2.1 and older

We can still read old cache files, but Dovecot v2.1 can't anymore read these
newer cache files.

5 years agolib-index: Cache transaction rollback used too small value to increase deleted_record...
Timo Sirainen [Wed, 1 Apr 2020 19:11:21 +0000 (22:11 +0300)] 
lib-index: Cache transaction rollback used too small value to increase deleted_record_count

Rollback used records_written to update it, but that was actually counting
the number of transaction flushes, not the number of individual mail cache
records that were written.

5 years agolib-index: mail_cache_transaction_rollback() - fix updating deleted_record_count
Timo Sirainen [Mon, 30 Mar 2020 14:34:45 +0000 (17:34 +0300)] 
lib-index: mail_cache_transaction_rollback() - fix updating deleted_record_count

The deleted_record_count in cache header wasn't actually being updated
because hdr_modified wasn't TRUE.

5 years agolib-index: Add mail_cache_unlock() that doesn't flush any headers
Timo Sirainen [Mon, 30 Mar 2020 14:28:41 +0000 (17:28 +0300)] 
lib-index: Add mail_cache_unlock() that doesn't flush any headers

5 years agolib-index: Rename mail_cache_unlock() to mail_cache_flush_and_unlock()
Timo Sirainen [Mon, 30 Mar 2020 14:22:38 +0000 (17:22 +0300)] 
lib-index: Rename mail_cache_unlock() to mail_cache_flush_and_unlock()

This describes better what it does, because it's not just unlocking.

5 years agolib-index: Make mail_cache_need_reopen() static
Timo Sirainen [Mon, 30 Mar 2020 14:14:10 +0000 (17:14 +0300)] 
lib-index: Make mail_cache_need_reopen() static

Nothing else besides mail_cache_*lock() needs to be calling it anymore.

5 years agolib-index: mail_cache_lookup_offset() - Use mail_cache_sync_reset_id()
Timo Sirainen [Mon, 30 Mar 2020 14:12:50 +0000 (17:12 +0300)] 
lib-index: mail_cache_lookup_offset() - Use mail_cache_sync_reset_id()

This avoids race conditions where cache fields aren't found during cache
compression.

5 years agolib-index: Make mail_cache_sync_reset_id() public
Timo Sirainen [Mon, 30 Mar 2020 14:07:14 +0000 (17:07 +0300)] 
lib-index: Make mail_cache_sync_reset_id() public

Also it no longer requires that cache is already locked when being called.

5 years agolib-index: Mark cache corrupted after finding that reset_id permanently wrong
Timo Sirainen [Mon, 30 Mar 2020 14:04:24 +0000 (17:04 +0300)] 
lib-index: Mark cache corrupted after finding that reset_id permanently wrong

5 years agolib-index: mail_cache_*lock() - On reset_id mismatch wait for cache compression to...
Timo Sirainen [Mon, 30 Mar 2020 13:48:21 +0000 (16:48 +0300)] 
lib-index: mail_cache_*lock() - On reset_id mismatch wait for cache compression to finish

It was possible that the reset_id mismatch happened because cache
compression had already recreated the .cache file, but hadn't yet written
the new reset_id to the .log file. By waiting for the .log lock, we can be
sure that this won't happen.

5 years agolib-index: mail_cache_sync_reset_id() - Rewrite to simplify
Timo Sirainen [Mon, 30 Mar 2020 12:45:57 +0000 (15:45 +0300)] 
lib-index: mail_cache_sync_reset_id() - Rewrite to simplify

This doesn't change any functionality.

5 years agolib-index: mail_cache_*lock() - Handle syscall errors correctly
Timo Sirainen [Mon, 30 Mar 2020 12:13:56 +0000 (15:13 +0300)] 
lib-index: mail_cache_*lock() - Handle syscall errors correctly

If reading a cache file failed because of some temporary syscall error, it
was treated the same as if the cache was corrupted. This could have
caused compression to lose cached data.

5 years agolib-index: mail_cache_reopen_now() - Fix corruption handling remove checking if reset...
Timo Sirainen [Mon, 30 Mar 2020 13:16:46 +0000 (16:16 +0300)] 
lib-index: mail_cache_reopen_now() - Fix corruption handling remove checking if reset_id matches

reset_id checking is already done by all of the callers. Also simplify the
error vs corruption handling by using mail_cache_open_and_verify()

5 years agolib-index: Make mail_cache_need_reopen() public and require using it explicitly
Timo Sirainen [Mon, 30 Mar 2020 13:24:45 +0000 (16:24 +0300)] 
lib-index: Make mail_cache_need_reopen() public and require using it explicitly

mail_cache_reopen() no longer implicitly calls it.

5 years agolib-index: mail_cache_open_and_verify() - Separate error and corruption handling
Timo Sirainen [Mon, 30 Mar 2020 12:25:49 +0000 (15:25 +0300)] 
lib-index: mail_cache_open_and_verify() - Separate error and corruption handling

5 years agolib-index: mail_cache_need_reopen() - Don't skip reopen just because compression...
Timo Sirainen [Mon, 30 Mar 2020 12:07:40 +0000 (15:07 +0300)] 
lib-index: mail_cache_need_reopen() - Don't skip reopen just because compression is wanted

The new cache file may still be usable until the compression is done.

5 years agolib-index: mail_cache_map_all() - Separate error and corruption handling
Timo Sirainen [Mon, 30 Mar 2020 15:41:26 +0000 (18:41 +0300)] 
lib-index: mail_cache_map_all() - Separate error and corruption handling

5 years agolib-index: Remove cache compression dotlock
Timo Sirainen [Fri, 27 Mar 2020 20:57:14 +0000 (22:57 +0200)] 
lib-index: Remove cache compression dotlock

Now that .log file is guaranteed to be locked during cache compression,
there's no need for another exclusive lock.

5 years agolib-index: Fix checking if cache should be compressed because it's getting too large
Timo Sirainen [Tue, 31 Mar 2020 13:43:07 +0000 (16:43 +0300)] 
lib-index: Fix checking if cache should be compressed because it's getting too large

Most importantly fixed updating last_stat_size whenever cache is locked.
This now guarantees that it's always fully up-to-date when it's being
checked. Most of the other places updating last_stat_size are now
unnecessary, but I left them in case they'll be useful in the future.

Fixed also off-by-one where purging was done also when cache was exactly at
its maximum size.

5 years agolib-index: Check if maximum cache file size has reached only after locking
Timo Sirainen [Fri, 27 Mar 2020 16:26:23 +0000 (18:26 +0200)] 
lib-index: Check if maximum cache file size has reached only after locking

This avoids race conditions.

5 years agolib-index: mail_cache_compress_with_trans() - Don't return lock anymore
Timo Sirainen [Fri, 27 Mar 2020 11:02:37 +0000 (13:02 +0200)] 
lib-index: mail_cache_compress_with_trans() - Don't return lock anymore

Now that transaction log is always locked during cache compression, it
doesn't matter if the cache is unlocked before or after the transaction log
commit.

5 years agolib-index: mail_cache_compress_with_trans() - Require that transaction log is locked
Timo Sirainen [Fri, 27 Mar 2020 11:01:57 +0000 (13:01 +0200)] 
lib-index: mail_cache_compress_with_trans() - Require that transaction log is locked

This should be true now for all of its callers.

5 years agolib-index: mail_cache_compress() - Make sure compression sees the latest changes...
Timo Sirainen [Mon, 30 Mar 2020 15:05:42 +0000 (18:05 +0300)] 
lib-index: mail_cache_compress() - Make sure compression sees the latest changes in index

5 years agolib-index: mail_cache_compress() - Keep the .log file locked during compression
Timo Sirainen [Fri, 27 Mar 2020 10:53:32 +0000 (12:53 +0200)] 
lib-index: mail_cache_compress() - Keep the .log file locked during compression

5 years agolib-index: Remove mail_cache_compress_forced()
Timo Sirainen [Fri, 27 Mar 2020 10:44:27 +0000 (12:44 +0200)] 
lib-index: Remove mail_cache_compress_forced()

5 years agodoveadm: Rewrite "doveadm mailbox cache purge" to use mail_cache_compress()
Timo Sirainen [Fri, 27 Mar 2020 10:49:40 +0000 (12:49 +0200)] 
doveadm: Rewrite "doveadm mailbox cache purge" to use mail_cache_compress()

Also removed checks to verify whether the cache file existed or was usable.
Compression will create/fix the file, which is more likely to be the wanted
behavior than failing.

5 years agolib-index: mail_cache_compress*() - Add compress_file_seq parameter
Timo Sirainen [Fri, 27 Mar 2020 10:36:40 +0000 (12:36 +0200)] 
lib-index: mail_cache_compress*() - Add compress_file_seq parameter

This can be used to specify when the cache file should be compressed.
This was previously hidden in the cache->compress_file_seq field, but
now it's more explicit.

This commit also makes sure that cache is compressed when index rebuilding
is done.

5 years agolib-index: Use mail_cache_compress() where possible
Timo Sirainen [Fri, 27 Mar 2020 10:22:37 +0000 (12:22 +0200)] 
lib-index: Use mail_cache_compress() where possible

5 years agolib-index: Add mail_cache_compress()
Timo Sirainen [Fri, 27 Mar 2020 10:19:47 +0000 (12:19 +0200)] 
lib-index: Add mail_cache_compress()

5 years agolib-index: Rename mail_cache_compress() to mail_cache_compress_with_trans()
Timo Sirainen [Fri, 27 Mar 2020 10:16:02 +0000 (12:16 +0200)] 
lib-index: Rename mail_cache_compress() to mail_cache_compress_with_trans()

5 years agolib-index: mail_cache_decisions_copy() - Create transaction internally
Timo Sirainen [Fri, 27 Mar 2020 09:33:23 +0000 (11:33 +0200)] 
lib-index: mail_cache_decisions_copy() - Create transaction internally

5 years agolib-index: Simplify opening cache when locking transaction
Timo Sirainen [Thu, 26 Mar 2020 16:04:13 +0000 (18:04 +0200)] 
lib-index: Simplify opening cache when locking transaction

All this work is already done by mail_cache_lock() or
mail_cache_transaction_lock() after locking has failed.

5 years agolib-index: If cache transaction lock fails because reset_id mismatch, compress cache
Timo Sirainen [Fri, 27 Mar 2020 16:07:53 +0000 (18:07 +0200)] 
lib-index: If cache transaction lock fails because reset_id mismatch, compress cache

This is also done in mail_cache_transaction_open_if_needed(), so it usually
worked anyway. But that function is otherwise unnecessary, so it's going
away in the next commit.

5 years agolib-index: Refresh caching decisions from cache file once per transaction
Timo Sirainen [Thu, 26 Mar 2020 14:54:03 +0000 (16:54 +0200)] 
lib-index: Refresh caching decisions from cache file once per transaction

If another process had updated the decisions, mail_cache_field_want_add()
and mail_cache_field_can_add() may have returned obsolete values.

5 years agolib-index: If cache transaction flush fails, don't discard the last mail's cached...
Timo Sirainen [Thu, 26 Mar 2020 14:16:06 +0000 (16:16 +0200)] 
lib-index: If cache transaction flush fails, don't discard the last mail's cached data

The last mail's cached data could still be accessed within memory.

This can now be done because the field indexes are internal indexes instead
of file-specific indexes.

5 years agolib-index: If cache file is compressed during transaction, discard only flushed records
Timo Sirainen [Thu, 26 Mar 2020 14:44:26 +0000 (16:44 +0200)] 
lib-index: If cache file is compressed during transaction, discard only flushed records

Cache records that are still in memory can be written to the new file.

5 years agolib-index: Simplify code to add missing header fields to cache
Timo Sirainen [Thu, 26 Mar 2020 14:01:03 +0000 (16:01 +0200)] 
lib-index: Simplify code to add missing header fields to cache

5 years agolib-index: Add only used fields to cache header, not everything
Timo Sirainen [Thu, 26 Mar 2020 13:54:30 +0000 (15:54 +0200)] 
lib-index: Add only used fields to cache header, not everything

5 years agolib-index: Delay using file-specific field numbers in uncommited cache records
Timo Sirainen [Thu, 26 Mar 2020 12:59:30 +0000 (14:59 +0200)] 
lib-index: Delay using file-specific field numbers in uncommited cache records

While adding data to cache, it's first kept in memory. Previously already
at this time the memory contained cache field numbers specified to the
current cache file. If the cache file was compressed, all the cached data
had to be discarded because the field numbers changed.

This commit changes the file-specific field indexes to internal index
numbers and converts them to file-specific numbers only just before writing
them to the cache file. This sigfinicantly simplifies the code. It also
allows following commits to avoid having to discard the data when cache is
compressed.

This change also required changing the cache lookup code to realize that
the uncommitted data contains internal field indexes.

5 years agolib-index: Keep a linked list of mail_cache_views
Timo Sirainen [Wed, 1 Apr 2020 19:08:42 +0000 (22:08 +0300)] 
lib-index: Keep a linked list of mail_cache_views

Assert-crash on cache deinit if any views are still open.

5 years agolib-ntlm: Replace strncpy() with memset()+memcpy()
Timo Sirainen [Sat, 11 Apr 2020 17:23:54 +0000 (20:23 +0300)] 
lib-ntlm: Replace strncpy() with memset()+memcpy()

There was nothing wrong with it, except gcc 9.2 logs a warning about it.

5 years agolib-imap: test-imap-url - Fix error handling
Timo Sirainen [Sat, 11 Apr 2020 17:23:18 +0000 (20:23 +0300)] 
lib-imap: test-imap-url - Fix error handling

5 years agolib-http: Fix generating label for incomplete HTTP server request
Timo Sirainen [Sat, 11 Apr 2020 17:21:15 +0000 (20:21 +0300)] 
lib-http: Fix generating label for incomplete HTTP server request

5 years agolib-master: Fix error logging if reading "instances" file fails
Timo Sirainen [Sat, 11 Apr 2020 17:19:55 +0000 (20:19 +0300)] 
lib-master: Fix error logging if reading "instances" file fails

The path was written as "(null)" in the error message (or it crashed in some
OSes).

5 years agolib-program-client: Do not derefence set when it is NULL.
Aki Tuomi [Thu, 24 May 2018 17:01:43 +0000 (20:01 +0300)] 
lib-program-client: Do not derefence set when it is NULL.

Found by coverity. Broken in 23cfbf2451f7191dee1d9995011c898a7bf32bd4

5 years agolog: LOG_OPTION is not supported here
Aki Tuomi [Thu, 24 May 2018 17:16:33 +0000 (20:16 +0300)] 
log: LOG_OPTION is not supported here

Found by coverity, introduced in d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76

5 years agolib-mail: message_header_decode_encoded - ensure num is QCOUNT
Aki Tuomi [Thu, 24 May 2018 17:14:08 +0000 (20:14 +0300)] 
lib-mail: message_header_decode_encoded - ensure num is QCOUNT

Satisifies static analyzers

5 years agoauth: test-lua - Do not initialize NULL script
Aki Tuomi [Thu, 24 May 2018 17:00:31 +0000 (20:00 +0300)] 
auth: test-lua - Do not initialize NULL script

Satisfies code analyzers

5 years agolib-fts: Assert that data is non-NULL when size > 0
Aki Tuomi [Thu, 24 May 2018 16:58:16 +0000 (19:58 +0300)] 
lib-fts: Assert that data is non-NULL when size > 0

Satisfies code analyzers

5 years agolib-index: mail_cache_lookup_headers() - Use const for field_idxs[]
Timo Sirainen [Tue, 31 Mar 2020 19:53:35 +0000 (22:53 +0300)] 
lib-index: mail_cache_lookup_headers() - Use const for field_idxs[]

5 years agolib-index: Move MAIL_CACHE_MAX_WRITE_BUFFER to mail-cache-private.h
Timo Sirainen [Tue, 31 Mar 2020 19:23:37 +0000 (22:23 +0300)] 
lib-index: Move MAIL_CACHE_MAX_WRITE_BUFFER to mail-cache-private.h

This will help unit tests.

5 years agolib-index: unit tests: Split off test_mail_index_close/delete()
Timo Sirainen [Tue, 24 Mar 2020 20:23:19 +0000 (22:23 +0200)] 
lib-index: unit tests: Split off test_mail_index_close/delete()

5 years agolib-index: Remove mail_cache_field_private.adding field
Timo Sirainen [Thu, 26 Mar 2020 13:31:48 +0000 (15:31 +0200)] 
lib-index: Remove mail_cache_field_private.adding field

This was used to make sure that cache compression didn't drop a field that
was just being added. After previous commit the cache is locked before this
code is even reached, so it's no longer possible.

5 years agolib-index: Use mail_cache_map_all() wherever possible
Timo Sirainen [Mon, 30 Mar 2020 14:18:42 +0000 (17:18 +0300)] 
lib-index: Use mail_cache_map_all() wherever possible

5 years agolib-index: Add mail_cache_map_all()
Timo Sirainen [Mon, 30 Mar 2020 14:17:11 +0000 (17:17 +0300)] 
lib-index: Add mail_cache_map_all()

5 years agolib-index: mail_cache_transaction_update_index() - Return void since it can't fail
Timo Sirainen [Tue, 31 Mar 2020 09:51:57 +0000 (12:51 +0300)] 
lib-index: mail_cache_transaction_update_index() - Return void since it can't fail

5 years agolib-index: mail_cache_sync_reset_id() - Move cache unlocking to caller
Timo Sirainen [Wed, 1 Apr 2020 14:02:03 +0000 (17:02 +0300)] 
lib-index: mail_cache_sync_reset_id() - Move cache unlocking to caller

5 years agolib-index: Split off mail_cache_sync_reset_id()
Timo Sirainen [Wed, 1 Apr 2020 14:00:56 +0000 (17:00 +0300)] 
lib-index: Split off mail_cache_sync_reset_id()

5 years agolib-index: Split off mail_cache_lookup_rec_get_field()
Timo Sirainen [Thu, 26 Mar 2020 12:24:27 +0000 (14:24 +0200)] 
lib-index: Split off mail_cache_lookup_rec_get_field()

5 years agolib-index: Split off mail_cache_transaction_forget_flushed()
Timo Sirainen [Fri, 20 Mar 2020 14:36:17 +0000 (16:36 +0200)] 
lib-index: Split off mail_cache_transaction_forget_flushed()

5 years agolib-index: mail_cache_header_add_field_locked() - Move unlocking to caller
Timo Sirainen [Fri, 20 Mar 2020 14:42:45 +0000 (16:42 +0200)] 
lib-index: mail_cache_header_add_field_locked() - Move unlocking to caller

5 years agolib-index: Split off mail_cache_header_add_field_locked()
Timo Sirainen [Fri, 20 Mar 2020 14:29:17 +0000 (16:29 +0200)] 
lib-index: Split off mail_cache_header_add_field_locked()

5 years agolib-index: mail_cache_header_fields_write() - Take cache parameter instead
Timo Sirainen [Fri, 20 Mar 2020 14:27:31 +0000 (16:27 +0200)] 
lib-index: mail_cache_header_fields_write() - Take cache parameter instead

5 years agolib-index: Split off mail_cache_trans_get_file_field()
Timo Sirainen [Fri, 20 Mar 2020 14:23:27 +0000 (16:23 +0200)] 
lib-index: Split off mail_cache_trans_get_file_field()

5 years agolib-index: mail_cache_lock() - Clarify why index->mapping might be TRUE here
Timo Sirainen [Wed, 25 Mar 2020 15:45:56 +0000 (17:45 +0200)] 
lib-index: mail_cache_lock() - Clarify why index->mapping might be TRUE here

5 years agolib-index: mail_transaction_log_sync_lock() - Fix function's comment
Timo Sirainen [Mon, 30 Mar 2020 13:03:07 +0000 (16:03 +0300)] 
lib-index: mail_transaction_log_sync_lock() - Fix function's comment

5 years agolib-auth: Rename auth_client_request_continue event to ...continued
Timo Sirainen [Tue, 7 Apr 2020 10:24:10 +0000 (13:24 +0300)] 
lib-auth: Rename auth_client_request_continue event to ...continued

5 years agoauth: auth_request_finished event - Rename translated_username to translated_user
Timo Sirainen [Tue, 7 Apr 2020 09:51:39 +0000 (12:51 +0300)] 
auth: auth_request_finished event - Rename translated_username to translated_user

All the other fields are also "user", not "username".

5 years agoauth: auth_request_finished event - Rename original_username to orig_user
Timo Sirainen [Tue, 7 Apr 2020 09:49:54 +0000 (12:49 +0300)] 
auth: auth_request_finished event - Rename original_username to orig_user

This way it matches %{orig_user} variable.

5 years agoauth: Remove unnecessary NULL checks for adding event fields
Timo Sirainen [Tue, 7 Apr 2020 09:41:50 +0000 (12:41 +0300)] 
auth: Remove unnecessary NULL checks for adding event fields

The NULL values are ignored internally. No need to complicate the code.

5 years agoauth: Remove duplicate "mechanism" field in auth request events
Timo Sirainen [Tue, 7 Apr 2020 09:39:56 +0000 (12:39 +0300)] 
auth: Remove duplicate "mechanism" field in auth request events

The "mech" field already existed, and it matches %{mech} variable.

5 years agolib-master: Replace auth-master-client-login category with auth-client
Timo Sirainen [Sat, 4 Apr 2020 22:16:08 +0000 (01:16 +0300)] 
lib-master: Replace auth-master-client-login category with auth-client

This is just a reimplementation of lib-auth/auth-master code. This commit
also changes lib-master to require lib-auth to get to the category. This
dependency shouldn't really be a problem, since eventually this
master-login-auth code should be replaced by lib-auth anyway.

5 years agolib-oauth2: Unit tests don't need to link libmaster
Timo Sirainen [Sat, 4 Apr 2020 22:13:39 +0000 (01:13 +0300)] 
lib-oauth2: Unit tests don't need to link libmaster

5 years agolib-auth: Replace auth-master-client category with auth-client
Timo Sirainen [Sat, 4 Apr 2020 22:06:44 +0000 (01:06 +0300)] 
lib-auth: Replace auth-master-client category with auth-client

The auth-client and auth-master connections are using mostly the same auth
API. Also the auth-master event names were already auth_client_*. So
there's not much point in having separate categories for them - it's just
confusing.

5 years agopush-notification: Rename event category from push_notification to push-notification
Timo Sirainen [Sat, 4 Apr 2020 22:03:21 +0000 (01:03 +0300)] 
push-notification: Rename event category from push_notification to push-notification

All other categories are using "-" instead of "_".

5 years agolib-dcrypt: Avoid using BN_bn2binpad
Aki Tuomi [Tue, 14 Apr 2020 17:55:48 +0000 (20:55 +0300)] 
lib-dcrypt: Avoid using BN_bn2binpad

It's not available in older versions.

5 years agolib-dcrypt: Add EC_GROUP_order_bits if missing
Aki Tuomi [Tue, 14 Apr 2020 15:30:34 +0000 (18:30 +0300)] 
lib-dcrypt: Add EC_GROUP_order_bits if missing

Not there in older OpenSSL

5 years agolib: ostream.h - Fix indent in enum ostream_create_file_flags
Timo Sirainen [Tue, 14 Apr 2020 11:24:43 +0000 (14:24 +0300)] 
lib: ostream.h - Fix indent in enum ostream_create_file_flags

5 years agolib-dcrypt: Require ECDSA signature size is even
Aki Tuomi [Tue, 14 Apr 2020 12:23:20 +0000 (15:23 +0300)] 
lib-dcrypt: Require ECDSA signature size is even

Valid ECDSA signature has two parts of equal sizes

5 years agolib-dcrypt: Pad signature parts to match ECDSA key size
Aki Tuomi [Tue, 14 Apr 2020 12:22:20 +0000 (15:22 +0300)] 
lib-dcrypt: Pad signature parts to match ECDSA key size

This is required for ECDSA signatures.

5 years agolib-compression: Add unit tests for gz header handling bugs
Timo Sirainen [Tue, 7 Apr 2020 07:49:10 +0000 (10:49 +0300)] 
lib-compression: Add unit tests for gz header handling bugs

5 years agolib-compression: Fix length checks for zlib header
Philippe Antoine [Tue, 31 Mar 2020 07:57:38 +0000 (09:57 +0200)] 
lib-compression: Fix length checks for zlib header

5 years agolib-mail: test-message-address - Add unit test for the one byte overread
Timo Sirainen [Tue, 7 Apr 2020 07:19:49 +0000 (10:19 +0300)] 
lib-mail: test-message-address - Add unit test for the one byte overread

Note that this is visible only with valgrind.

5 years agolib-mail: message_address_parse_path() - Fix one byte overread
Philippe Antoine [Thu, 2 Apr 2020 15:28:58 +0000 (17:28 +0200)] 
lib-mail: message_address_parse_path() - Fix one byte overread

5 years agolib-master: If stats_writer_socket_path is empty, don't try to send stats
Timo Sirainen [Fri, 3 Apr 2020 12:32:35 +0000 (15:32 +0300)] 
lib-master: If stats_writer_socket_path is empty, don't try to send stats

5 years agolib-test: test_exit() - Use regular exit() instead of _exit()
Timo Sirainen [Thu, 2 Apr 2020 14:45:46 +0000 (17:45 +0300)] 
lib-test: test_exit() - Use regular exit() instead of _exit()

Otherwise code coverage output isn't written for the forked process.