]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
7 years agodriver-sqlite: Whitespace fix
Aki Tuomi [Fri, 31 Aug 2018 10:07:03 +0000 (13:07 +0300)] 
driver-sqlite: Whitespace fix

7 years agoauth: Add db_ prefix to sql in db-sql
Aki Tuomi [Fri, 31 Aug 2018 06:20:16 +0000 (09:20 +0300)] 
auth: Add db_ prefix to sql in db-sql

Prevents clash with lib-sql

7 years agolib-master: Fix crash when stats events are merged all the way to the root
Timo Sirainen [Mon, 3 Sep 2018 11:15:07 +0000 (14:15 +0300)] 
lib-master: Fix crash when stats events are merged all the way to the root

7 years agolib-master: stats_event_get_merged() - Remove unnecessary variable assignment
Timo Sirainen [Mon, 3 Sep 2018 10:14:39 +0000 (13:14 +0300)] 
lib-master: stats_event_get_merged() - Remove unnecessary variable assignment

Fixes scan-build complaint.

7 years agolib: Move log type to be written before appended log prefix
Timo Sirainen [Fri, 31 Aug 2018 12:06:09 +0000 (15:06 +0300)] 
lib: Move log type to be written before appended log prefix

This changes the logging format back to how it used to be before the event
logging changes.

7 years agolib: Add failure_context.log_prefix_type_pos
Timo Sirainen [Fri, 31 Aug 2018 12:03:37 +0000 (15:03 +0300)] 
lib: Add failure_context.log_prefix_type_pos

If non-zero, this specifies where the log type (e.g. "Info: ") is written
within the log prefix. By default it's appended.

7 years agolib, log: Add log prefix length to internal logging protocol
Timo Sirainen [Fri, 31 Aug 2018 12:01:38 +0000 (15:01 +0300)] 
lib, log: Add log prefix length to internal logging protocol

This way log process knows which part of the text is the log prefix, and
which part is the logged text.

7 years agolog: Move data stack frame allocation to parent function
Timo Sirainen [Fri, 31 Aug 2018 11:57:13 +0000 (14:57 +0300)] 
log: Move data stack frame allocation to parent function

This simplifies the next commit, which requires data stack nearly always
when logging. The data stack frames are cheap enough that we don't really
need to optimize for avoiding the cases when they're not needed.

7 years agolog: Avoid unnecessary global log prefix changes
Timo Sirainen [Fri, 31 Aug 2018 11:54:18 +0000 (14:54 +0300)] 
log: Avoid unnecessary global log prefix changes

If the context specifies a log prefix, the global prefix isn't going to be
used.

7 years agolib: failures - Use common log_prefix_add() for default and syslog formatters
Timo Sirainen [Fri, 31 Aug 2018 11:50:52 +0000 (14:50 +0300)] 
lib: failures - Use common log_prefix_add() for default and syslog formatters

7 years agolib: Add unit test for event log prefix handling
Timo Sirainen [Tue, 28 Aug 2018 09:45:23 +0000 (12:45 +0300)] 
lib: Add unit test for event log prefix handling

Some of the tests are commented out until they're fixed in a following
commit.

7 years agolib: failures - Move adding LF from default_format() to default_write()
Timo Sirainen [Fri, 31 Aug 2018 11:30:21 +0000 (14:30 +0300)] 
lib: failures - Move adding LF from default_format() to default_write()

This makes it similar to internal_format/write()

7 years agolib: Move failure handler structs and typedefs to failures-private.h
Timo Sirainen [Fri, 31 Aug 2018 11:21:06 +0000 (14:21 +0300)] 
lib: Move failure handler structs and typedefs to failures-private.h

Also change the function typedefs to be non-pointers, like they usually are
in Dovecot code.

7 years agolib: Make failure handler variables static
Timo Sirainen [Fri, 31 Aug 2018 11:19:32 +0000 (14:19 +0300)] 
lib: Make failure handler variables static

7 years agolib: Rename handler_config variable to failure_handler
Timo Sirainen [Fri, 31 Aug 2018 11:18:34 +0000 (14:18 +0300)] 
lib: Rename handler_config variable to failure_handler

It's a global variable, so it needs to have a proper prefix.

7 years agolib-master: stats_event_write use BEGIN only when event and parent_event create times...
Sergey Kitov [Tue, 16 Jan 2018 10:51:53 +0000 (12:51 +0200)] 
lib-master: stats_event_write use BEGIN only when event and parent_event create timestamps differ

7 years agolib: Add some event handling functions.
Sergey Kitov [Mon, 26 Feb 2018 14:33:19 +0000 (16:33 +0200)] 
lib: Add some event handling functions.

event_has_all_categories() - checks if given event contains all the
categories of an another event.
event_has_all_fields() - checks if given event contains all the fields
of an another event.
event_dup() - duplicates an event.
event_copy_categories_fields() - copies all categories and fields from
source to dest.

7 years agolib: Fix matching parent categories in event filter
Timo Sirainen [Fri, 31 Aug 2018 10:04:53 +0000 (13:04 +0300)] 
lib: Fix matching parent categories in event filter

So far this hasn't caused problems, because parent events had been using
parent categories. However, if the parent category wasn't used by an event
or its parents, an event filter wouldn't have matched it.

7 years agolib-http: Add assert to make sure http_client_init_shared(NULL, NULL) isn't called
Timo Sirainen [Thu, 30 Aug 2018 13:40:16 +0000 (16:40 +0300)] 
lib-http: Add assert to make sure http_client_init_shared(NULL, NULL) isn't called

This should make scan-build happy.

7 years agolib: Remove a dead assignment from test-array.c
Martti Rannanjärvi [Thu, 30 Aug 2018 13:14:34 +0000 (16:14 +0300)] 
lib: Remove a dead assignment from test-array.c

Found by scan-build.

7 years agolib: Implement vfuncs for logging to stderr
Sergey Kitov [Thu, 14 Jun 2018 12:54:03 +0000 (15:54 +0300)] 
lib: Implement vfuncs for logging to stderr

7 years agolib: Implement vfuncs for logging to syslog
Sergey Kitov [Thu, 14 Jun 2018 12:49:41 +0000 (15:49 +0300)] 
lib: Implement vfuncs for logging to syslog

7 years agolib: Implement vfuncs for logging to default location and common failure logging...
Sergey Kitov [Sun, 5 Aug 2018 01:00:17 +0000 (04:00 +0300)] 
lib: Implement vfuncs for logging to default location and common failure logging handling

7 years agolib: Introduce abstraction for failure logging implementations.
Sergey Kitov [Tue, 12 Jun 2018 12:56:46 +0000 (15:56 +0300)] 
lib: Introduce abstraction for failure logging implementations.

7 years agopop3: use array interface rather than internal buffer to access data
Phil Carmody [Thu, 30 Aug 2018 08:38:41 +0000 (11:38 +0300)] 
pop3: use array interface rather than internal buffer to access data

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agolib: test-array - tests that freeing without data doesn't free the data
Phil Carmody [Thu, 30 Aug 2018 08:36:08 +0000 (11:36 +0300)] 
lib: test-array - tests that freeing without data doesn't free the data

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agolib/array - give arrays the non-freeing deinit that strings and buffers have
Phil Carmody [Wed, 29 Aug 2018 12:28:31 +0000 (15:28 +0300)] 
lib/array - give arrays the non-freeing deinit that strings and buffers have

Buffers provide the ability to free the control block but preserve and
return the previously controlled data to the caller: buffer_free_without_data().

As wrapped buffers, strings also have this functionality: str_free_without_data().
(They have to do that, as their buffer implementation is encapsulated away
out of sight to the str.h user.)

Arrays, also wrapped buffers, are missing this capability under the 'array'
name, you have to use the buffer function call, which involves diving into
the guts of the array implementation (because arrays do not hide their
implementation like strings do), and also sacrifices array's type safety.

With this inline helper, it should be simple, obvious, clean and safe.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agom4/dovecot.m4: rename valgrind output file to hide it from certain tests
Phil Carmody [Tue, 19 Jun 2018 12:30:36 +0000 (15:30 +0300)] 
m4/dovecot.m4: rename valgrind output file to hide it from certain tests

Some lib-http tests use readdir() to create test cases, and sometimes
object to the contents of test.out.$$. However, as lib-http is also
sensitive to certain characters in the filenames of the files it uses,
we can hide the valgrind output by chosing its filename to exclude it
from the lib_http tests. Non-initial '~' is not known to cause any issues
for either the shell or any known operating system, so is the safest of
lib-http's 'dodgy' characters to use as the separator.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agom4/dovecot.m4 - Apply DRY principle to test output filename
Phil Carmody [Wed, 29 Aug 2018 11:57:45 +0000 (14:57 +0300)] 
m4/dovecot.m4 - Apply DRY principle to test output filename

Define the name we will use for the file once, then just use that variable
instead of using explicit repeatition.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agolib-http: increase pool sizes in tests
Phil Carmody [Tue, 19 Jun 2018 10:29:46 +0000 (13:29 +0300)] 
lib-http: increase pool sizes in tests

Pool growth messages spam the test output, just dive in with a slightly
larger default to shut them up. Only affects these individual tests,
not any other users of the library.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agolib-http: library default pool allocation increases
Phil Carmody [Wed, 29 Aug 2018 11:49:54 +0000 (14:49 +0300)] 
lib-http: library default pool allocation increases

Many pools will need to grow even when the smallest amount of work is
done within them, which can spam the logs.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agolib-http: change default client/server pool sizes when using SSL
Phil Carmody [Tue, 19 Jun 2018 10:28:12 +0000 (13:28 +0300)] 
lib-http: change default client/server pool sizes when using SSL

SSL carries a lot of state with it, so just start with a bigger
pool if we know we're using it.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agolib-http: harden payload tests against dodgy filenames
Phil Carmody [Thu, 14 Jun 2018 05:51:37 +0000 (08:51 +0300)] 
lib-http: harden payload tests against dodgy filenames

Tests use files from readdir() as input, but do no sanitation of the
names, and therefore things like editor temp files can cause havoc
with the HTTP request parser.

The solution is to trap dodgy characters in the filenames, and ignore
those files. Initially, trap HTTP's "unsafe" and "reserved" characters.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agolib: Fix documentation on POINTER_CAST
Aki Tuomi [Thu, 30 Aug 2018 08:54:29 +0000 (11:54 +0300)] 
lib: Fix documentation on POINTER_CAST

7 years agolib-master, master: Initialize stats-client via environment variables
Timo Sirainen [Wed, 29 Aug 2018 19:09:57 +0000 (22:09 +0300)] 
lib-master, master: Initialize stats-client via environment variables

That way it's initialized before settings are read, and it can catch events
earlier. It also doesn't require all services to read settings if they
otherwise don't need them.

7 years agodns: Fix duration field in dns_worker_request_finished event
Timo Sirainen [Wed, 29 Aug 2018 17:43:22 +0000 (20:43 +0300)] 
dns: Fix duration field in dns_worker_request_finished event

7 years agolib: connection - Clarify logging of incoming connections
Timo Sirainen [Mon, 27 Aug 2018 07:35:47 +0000 (10:35 +0300)] 
lib: connection - Clarify logging of incoming connections

Don't log "Client connected" for both incoming and outgoing connections.

7 years agolib: connection - Remove dead code
Timo Sirainen [Mon, 27 Aug 2018 07:33:54 +0000 (10:33 +0300)] 
lib: connection - Remove dead code

connection_client_connected() can only be called for clients. There was
already an assert for it.

7 years agodns: Remove duplicate event_unref() in dns_client_input_args()
Martti Rannanjärvi [Wed, 29 Aug 2018 14:27:58 +0000 (17:27 +0300)] 
dns: Remove duplicate event_unref() in dns_client_input_args()

The event is unreffed at the end of the function also.

7 years agodns: Return the lookup error string to the querier
Martti Rannanjärvi [Wed, 29 Aug 2018 14:22:22 +0000 (17:22 +0300)] 
dns: Return the lookup error string to the querier

7 years agolib-dns: Set error_r in dns_client_connect() on failure
Martti Rannanjärvi [Wed, 29 Aug 2018 10:40:33 +0000 (13:40 +0300)] 
lib-dns: Set error_r in dns_client_connect() on failure

7 years agolib-dns: Remove DNS from the log messages now that it's in the prefix
Martti Rannanjärvi [Wed, 29 Aug 2018 10:23:55 +0000 (13:23 +0300)] 
lib-dns: Remove DNS from the log messages now that it's in the prefix

7 years agolib-dns: Use dns(host): prefix instead of just host: in event
Martti Rannanjärvi [Wed, 29 Aug 2018 10:21:23 +0000 (13:21 +0300)] 
lib-dns: Use dns(host): prefix instead of just host: in event

7 years agolib: Use basename of unix socket path as event log prefix
Martti Rannanjärvi [Wed, 29 Aug 2018 08:04:10 +0000 (11:04 +0300)] 
lib: Use basename of unix socket path as event log prefix

This is to make the prefix consistent with other unix socket loggings in
Dovecot.

7 years agolib-smtp: client: Fix potential segfault occurring after receiving RCPT reply.
Stephan Bosch [Sun, 26 Aug 2018 13:16:17 +0000 (15:16 +0200)] 
lib-smtp: client: Fix potential segfault occurring after receiving RCPT reply.

Could occur when RCPT reply is received befor DATA command is sent in LMTP session.

Problem found by Coverity.

7 years agolib-dns - struct member cleanup in dns_lookup
Phil Carmody [Wed, 29 Aug 2018 12:15:30 +0000 (15:15 +0300)] 
lib-dns - struct member cleanup in dns_lookup

The index was never used anyway. Now we're using an alloconly pool,
there's no need for the dns_lookup to keep a freeable pointer to the
fields also int result.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agoquota: Mark noenforcing quotas with unlimited quota
Aki Tuomi [Tue, 24 Jul 2018 11:47:47 +0000 (14:47 +0300)] 
quota: Mark noenforcing quotas with unlimited quota

This allows quota to be properly updated for unenforced quotas
so they can be used for tracking only.

This fixes issue where using noenforcing would not update quota
during mail save, but requires a manual quota update.

7 years agoquota: Cleanup - Move enforce checking out of quota_root_visible()
Aki Tuomi [Tue, 24 Jul 2018 11:38:18 +0000 (14:38 +0300)] 
quota: Cleanup - Move enforce checking out of quota_root_visible()

Non-enforcing quota roots need to be visible even when enforcing quotas,
otherwise we cannot update them.

7 years agolib: Use i_asserts() for NULL-checks in test_event_filter_inc_int()
Martti Rannanjärvi [Tue, 28 Aug 2018 09:00:54 +0000 (12:00 +0300)] 
lib: Use i_asserts() for NULL-checks in test_event_filter_inc_int()

This is so scan-build doesn't explore the assertations not holding and
create noise with that.

7 years agofts: Optimize replacing NULs in header
Timo Sirainen [Mon, 27 Aug 2018 12:06:44 +0000 (15:06 +0300)] 
fts: Optimize replacing NULs in header

7 years agofts: Fix indexing mails with NULs in headers
Timo Sirainen [Thu, 23 Aug 2018 11:33:59 +0000 (14:33 +0300)] 
fts: Fix indexing mails with NULs in headers

After the first NUL all the rest of the string was converted to spaces.
This was broken already in the initial commit that attempted to fix this:
4d27f95c76bd008bb38f9c442567046da2b6ce14

7 years agolib-http: test-http-client-errors - Skip VERSION line in DNS reply
Aki Tuomi [Tue, 28 Aug 2018 06:45:58 +0000 (09:45 +0300)] 
lib-http: test-http-client-errors - Skip VERSION line in DNS reply

Otherwise we send extraneous results causing SIGPIPE crash.

Broken in ddb9ead03f4cc7a2c61094e50803e07dfd590cb5

7 years agolib-dns: Always use dns_lookup_free
Aki Tuomi [Mon, 27 Aug 2018 11:16:46 +0000 (14:16 +0300)] 
lib-dns: Always use dns_lookup_free

Ensures that all resources get free'd in single place,
Fixes memory leak and event double-unref.

Broken in 9ee82e3f660e6e072532283cad8668a578ac137d

7 years agolib-dns: Always allocate lookup
Aki Tuomi [Mon, 27 Aug 2018 11:15:54 +0000 (14:15 +0300)] 
lib-dns: Always allocate lookup

Simplifies next change

7 years agolib-dns: Use pooled memory with dns lookups
Aki Tuomi [Mon, 27 Aug 2018 11:14:50 +0000 (14:14 +0300)] 
lib-dns: Use pooled memory with dns lookups

Simplifies memory management

7 years agolib: Add test for event_inc_int()
Martti Rannanjärvi [Mon, 27 Aug 2018 11:36:33 +0000 (14:36 +0300)] 
lib: Add test for event_inc_int()

7 years agosubmission: Reorder initialization code
Aki Tuomi [Thu, 23 Aug 2018 17:29:58 +0000 (20:29 +0300)] 
submission: Reorder initialization code

login_set socket paths get invalidated when
master_service_init_finish is called, so we need
to run the code that uses them before this.

7 years agolib-smtp: Increase memory pool initial sizes
Aki Tuomi [Thu, 23 Aug 2018 16:15:50 +0000 (19:15 +0300)] 
lib-smtp: Increase memory pool initial sizes

This reduces malloc traffic

7 years agolib-dns: Remove useless code
Aki Tuomi [Fri, 24 Aug 2018 08:42:56 +0000 (11:42 +0300)] 
lib-dns: Remove useless code

Found by scan-build

7 years agolib-http: Hook lib-http event to connection event
Aki Tuomi [Fri, 17 Aug 2018 11:27:52 +0000 (14:27 +0300)] 
lib-http: Hook lib-http event to connection event

7 years agodns, lib-dns: Move to protocol v1.0
Aki Tuomi [Fri, 17 Aug 2018 08:33:18 +0000 (11:33 +0300)] 
dns, lib-dns: Move to protocol v1.0

7 years agodns: Add event support
Aki Tuomi [Tue, 31 Jul 2018 09:51:54 +0000 (12:51 +0300)] 
dns: Add event support

7 years agodns: Use connection.c
Aki Tuomi [Thu, 16 Aug 2018 07:32:38 +0000 (10:32 +0300)] 
dns: Use connection.c

This enables processing multiple requests at a time.

7 years agolib: connection - Add and fix logging
Aki Tuomi [Thu, 2 Aug 2018 14:22:51 +0000 (17:22 +0300)] 
lib: connection - Add and fix logging

7 years agolib: connection - Add event support
Aki Tuomi [Thu, 2 Aug 2018 14:22:37 +0000 (17:22 +0300)] 
lib: connection - Add event support

7 years agolib-dns: Add event support
Aki Tuomi [Tue, 31 Jul 2018 09:52:19 +0000 (12:52 +0300)] 
lib-dns: Add event support

7 years agolib-dns: Move calling callback to separate function
Aki Tuomi [Tue, 31 Jul 2018 09:45:17 +0000 (12:45 +0300)] 
lib-dns: Move calling callback to separate function

Simplifies next commit

7 years agolib-dns: Initialize lookup earlier
Aki Tuomi [Fri, 17 Aug 2018 11:36:13 +0000 (14:36 +0300)] 
lib-dns: Initialize lookup earlier

7 years agolib-dns: Compose final command in dns_client_lookup_common
Aki Tuomi [Fri, 17 Aug 2018 07:55:39 +0000 (10:55 +0300)] 
lib-dns: Compose final command in dns_client_lookup_common

Makes logging easier

7 years agolib-dns: Use connection with dns-client
Aki Tuomi [Thu, 16 Aug 2018 12:24:30 +0000 (15:24 +0300)] 
lib-dns: Use connection with dns-client

7 years agolib: lib-event - Add inc_int to passthrough events
Aki Tuomi [Fri, 17 Aug 2018 07:39:05 +0000 (10:39 +0300)] 
lib: lib-event - Add inc_int to passthrough events

Was forgotten in 12927b843387b2a93fcf1d2e05df7c79af06e567

7 years agolib: Make io_loop_move_*(NULL) no-op
Aki Tuomi [Thu, 23 Aug 2018 11:58:44 +0000 (14:58 +0300)] 
lib: Make io_loop_move_*(NULL) no-op

7 years agolib: Mark signal waiting IO as "never wait alone"
Timo Sirainen [Fri, 17 Aug 2018 08:34:02 +0000 (11:34 +0300)] 
lib: Mark signal waiting IO as "never wait alone"

This signal is being automatically moved to nested ioloops. It can't be the
only IO being waited, since there's no code that simply wants to wait for a
signal.

7 years agolib: ioloop-epoll/kqueue: Remove now unnecessary infinite wait check.
Timo Sirainen [Fri, 17 Aug 2018 08:33:17 +0000 (11:33 +0300)] 
lib: ioloop-epoll/kqueue: Remove now unnecessary infinite wait check.

The previous change adds this globally to io_loop_run_get_wait_time().

7 years agolib: Add io_set_never_wait_alone()
Timo Sirainen [Fri, 17 Aug 2018 08:32:10 +0000 (11:32 +0300)] 
lib: Add io_set_never_wait_alone()

If ioloop is run without any timeouts and without IOs that don't have this
flag, assert-crash rather than going to infinite wait.

7 years agolib: Add and use io_loop_run_get_wait_time()
Timo Sirainen [Fri, 17 Aug 2018 08:29:30 +0000 (11:29 +0300)] 
lib: Add and use io_loop_run_get_wait_time()

This is going to be called just before running an ioloop iteration.
The next commit improves its behavior.

7 years agolib-smtp: test-smtp-client-errors: Add tests for transaction timeouts.
Stephan Bosch [Wed, 15 Aug 2018 20:34:19 +0000 (22:34 +0200)] 
lib-smtp: test-smtp-client-errors: Add tests for transaction timeouts.

7 years agolib-smtp: client: Add debug message for the moment when all RCPT replies are received.
Stephan Bosch [Wed, 15 Aug 2018 22:50:12 +0000 (00:50 +0200)] 
lib-smtp: client: Add debug message for the moment when all RCPT replies are received.

This helps in debugging transaction state transition problems.

7 years agolib-smtp: client: Fix transaction state transition for the DATA command.
Stephan Bosch [Wed, 15 Aug 2018 22:42:50 +0000 (00:42 +0200)] 
lib-smtp: client: Fix transaction state transition for the DATA command.

It progressed to the DATA state too early. By the looks of things, this only
affected the correctness of error and debug messages. It does not affect the
transaction itself.

7 years agolib-smtp: client: Fix segmentation fault occurring at transaction timeout.
Stephan Bosch [Wed, 15 Aug 2018 22:28:51 +0000 (00:28 +0200)] 
lib-smtp: client: Fix segmentation fault occurring at transaction timeout.

In the DATA command callback trans->cmd_data can be NULL when the command is
aborted from smtp_client_transaction_fail_reply().

7 years agolib-smtp: client: transaction: Prevent early transaction abort in smtp_client_transac...
Stephan Bosch [Wed, 15 Aug 2018 20:39:58 +0000 (22:39 +0200)] 
lib-smtp: client: transaction: Prevent early transaction abort in smtp_client_transaction_fail_reply().

Can happen in one of the command callbacks of aborted commands.

7 years agolib-smtp: Remove trailing whitespace in smtp-cient-transaction.c.
Stephan Bosch [Thu, 16 Aug 2018 06:48:43 +0000 (08:48 +0200)] 
lib-smtp: Remove trailing whitespace in smtp-cient-transaction.c.

7 years agolib-smtp: Remove trailing whitespace in test-smtp-client-errors.c.
Stephan Bosch [Thu, 16 Aug 2018 06:47:37 +0000 (08:47 +0200)] 
lib-smtp: Remove trailing whitespace in test-smtp-client-errors.c.

7 years agolib: Add test for stats_dist_get_variance()
Martti Rannanjärvi [Tue, 31 Jul 2018 05:23:49 +0000 (08:23 +0300)] 
lib: Add test for stats_dist_get_variance()

7 years agolib,stats,dict: Make stats_dist_get_avg() return double
Martti Rannanjärvi [Mon, 20 Aug 2018 10:56:40 +0000 (13:56 +0300)] 
lib,stats,dict: Make stats_dist_get_avg() return double

7 years agomaster: Wait 1 second for SIGQUITs to get handled
Josef 'Jeff' Sipek [Mon, 20 Aug 2018 22:07:30 +0000 (18:07 -0400)] 
master: Wait 1 second for SIGQUITs to get handled

The delay (previously 100ms, now 1s) is intended to delay our exit enough so
that the child processes have a chance to receive & handle the SIGQUITs we
just sent.  If we don't wait long enough, it is possible that we'll get
restarted before our children had the chance to stop listening on their
sockets and we'll hit "address already in use" type errors.

Increasing the delay does not fix the issue, but it masks it better.

7 years agolib-index: mail_cache_lookup_headers() - Allow using datastack pool
Timo Sirainen [Mon, 20 Aug 2018 09:51:28 +0000 (12:51 +0300)] 
lib-index: mail_cache_lookup_headers() - Allow using datastack pool

This fixes assert caused by 53712af0e7f357e7279d9ff03831428aae85aa45:
Panic: pool_data_stack_realloc(): stack frame changed

7 years agolib-storage: Fix NUL handling in mail_get_first_header*(), mail_get_headers*()
Timo Sirainen [Fri, 17 Aug 2018 11:39:41 +0000 (14:39 +0300)] 
lib-storage: Fix NUL handling in mail_get_first_header*(), mail_get_headers*()

These functions return NUL-terminated values, so they got truncated whenever
a header value contained a NUL. Fix this by converting NULs to unicode
replacement characters in the output.

7 years agolib-mail: Make message_header_strdup() public
Timo Sirainen [Fri, 17 Aug 2018 11:33:50 +0000 (14:33 +0300)] 
lib-mail: Make message_header_strdup() public

Also move it to a better file.

7 years agolib-mail: Cleanup - Rename internal hdr_strdup() to message_header_strdup()
Timo Sirainen [Fri, 17 Aug 2018 17:16:29 +0000 (20:16 +0300)] 
lib-mail: Cleanup - Rename internal hdr_strdup() to message_header_strdup()

7 years agolib-mail: rfc822-parser - Handle \<NUL> in quoted-string and domain-literal
Timo Sirainen [Fri, 17 Aug 2018 11:12:25 +0000 (14:12 +0300)] 
lib-mail: rfc822-parser - Handle \<NUL> in quoted-string and domain-literal

It was already handled in comments. Previously this caused the strings and
domain-literals to be truncated at that position.

7 years agolib-mail: test-message-address - Test NULs in display-name
Timo Sirainen [Fri, 17 Aug 2018 10:42:35 +0000 (13:42 +0300)] 
lib-mail: test-message-address - Test NULs in display-name

7 years agolib: test-event-filter - Test overriding parent fields
Timo Sirainen [Thu, 16 Aug 2018 09:27:06 +0000 (12:27 +0300)] 
lib: test-event-filter - Test overriding parent fields

7 years agolib: Add event_field_clear() to allow clearing parent event's fields
Timo Sirainen [Thu, 16 Aug 2018 09:17:38 +0000 (12:17 +0300)] 
lib: Add event_field_clear() to allow clearing parent event's fields

7 years agolib: Add event_inc_int()
Timo Sirainen [Wed, 15 Aug 2018 13:33:49 +0000 (16:33 +0300)] 
lib: Add event_inc_int()

This can be useful when updating counter fields.

7 years agolib-http: test-http-client-errors: Make "peer reuse failure" test reliable.
Stephan Bosch [Mon, 13 Aug 2018 17:23:31 +0000 (19:23 +0200)] 
lib-http: test-http-client-errors: Make "peer reuse failure" test reliable.

It was highly timing-sensitive, since it required a particular error status to
be returned. Sometimes, it would yield a different error based on a
slightly different order of events, making the test fail. Such failures aren't
relevant though, since this regression test is about triggering a segfault that
used to occur.

7 years agoimap: Fix command ambiguity checking with special plugins
Timo Sirainen [Mon, 6 Aug 2018 09:39:25 +0000 (12:39 +0300)] 
imap: Fix command ambiguity checking with special plugins

If the tagged line is already sent, that command can't result in ambiguity
anymore.

A cleaner fix would be to add a new _WAIT_SYNC_OUTPUT state, but that
requires all the existing code to understand that new state correctly, so it
has a higher chance of breaking something. So at least for now don't add it.

7 years agolib: test-strfuncs - Rename test i_strbegins to str_begins
Aki Tuomi [Mon, 6 Aug 2018 08:34:35 +0000 (11:34 +0300)] 
lib: test-strfuncs - Rename test i_strbegins to str_begins

Matches the real name

7 years agodoveconf: Fix compiler nit
Aki Tuomi [Mon, 6 Aug 2018 08:36:41 +0000 (11:36 +0300)] 
doveconf: Fix compiler nit

Ensure secret_r cannot be NULL unless none was found.

7 years agodoveconf: Improve secret hiding
Aki Tuomi [Tue, 14 Aug 2018 12:25:40 +0000 (15:25 +0300)] 
doveconf: Improve secret hiding

Hide with more wide filtering.