]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
2 years agolib: Add t_split_key_value_eq()
Marco Bettini [Mon, 23 Jan 2023 09:38:51 +0000 (09:38 +0000)] 
lib: Add t_split_key_value_eq()

2 years agorun-test-valgrind.supp: Suppress OpenSSL EVP_DecryptFinal_ex() use of uninitialized...
Martti Rannanjärvi [Wed, 1 Feb 2023 11:15:43 +0000 (13:15 +0200)] 
run-test-valgrind.supp: Suppress OpenSSL EVP_DecryptFinal_ex() use of uninitialized value

This issue seems to be https://github.com/openssl/openssl/issues/19719

2 years agoaggregator: Fix assert-crash when output to replicator starts queuing
Timo Sirainen [Tue, 10 Jan 2023 23:23:03 +0000 (01:23 +0200)] 
aggregator: Fix assert-crash when output to replicator starts queuing

If the output was less than IO_BLOCK_SIZE (as it usually would be), the code
just skipped over the whole buffered output and was confused that it didn't
find LF. Fixed by skipping over all but the last byte in the buffer, which
should be the LF.

Fixes:
Panic: file replicator-connection.c: line 99 (replicator_send_buf): assertion failed: (len < buf->used)

2 years agomaster: Fix fd leak check at startup with DEBUG
Timo Sirainen [Wed, 1 Feb 2023 11:26:25 +0000 (13:26 +0200)] 
master: Fix fd leak check at startup with DEBUG

Don't fail at startup because config fd is set.

Broken by 9280367fdb767d9248dd9a3713519ee3cdad6b3f

2 years agolib: Add memcpy() macro that assert-crashes if either parameter is NULL
Timo Sirainen [Fri, 27 Jan 2023 14:31:28 +0000 (16:31 +0200)] 
lib: Add memcpy() macro that assert-crashes if either parameter is NULL

2 years agoglobal: Make sure memcpy() isn't called with NULL parameters
Timo Sirainen [Sat, 14 Jan 2023 22:42:39 +0000 (00:42 +0200)] 
global: Make sure memcpy() isn't called with NULL parameters

Add an explicit if-check to make sure neither destination nor source pointer
parameter is NULL, since it's undefined behavior and can lead to crashes
with current compilers.

Currently this code isn't known to have caused issues.

2 years agoglobal: Add asserts to make sure memcpy() won't be called with NULL parameters
Timo Sirainen [Sat, 14 Jan 2023 22:40:32 +0000 (00:40 +0200)] 
global: Add asserts to make sure memcpy() won't be called with NULL parameters

These asserts aren't expected to trigger with current code.

2 years agolib: ostream-file - Fix assert to be more restrictive
Timo Sirainen [Sat, 14 Jan 2023 22:39:53 +0000 (00:39 +0200)] 
lib: ostream-file - Fix assert to be more restrictive

2 years agolib-dict: Parse proxy attributes as millisecond based interval
Karl Fleischmann [Mon, 30 Jan 2023 15:50:22 +0000 (16:50 +0100)] 
lib-dict: Parse proxy attributes as millisecond based interval

2 years agolib-dict: Rename proxy attributes
Karl Fleischmann [Mon, 30 Jan 2023 15:45:05 +0000 (16:45 +0100)] 
lib-dict: Rename proxy attributes

Make the naming of the attributes consistent with other storage
parameters, especially the http-storage.

2 years agolib-dict: Fix comment of default proxy timeout millisecond macro
Karl Fleischmann [Mon, 30 Jan 2023 15:33:45 +0000 (16:33 +0100)] 
lib-dict: Fix comment of default proxy timeout millisecond macro

2 years agoglobal: Complete unsigned int declarations
Karl Fleischmann [Mon, 30 Jan 2023 15:35:56 +0000 (16:35 +0100)] 
global: Complete unsigned int declarations

To be more consistent with the rest of the code base and because of code
quality reasons this commit adds the "int" keyword that is theoretically
optional for unsigned integer types.

2 years agolib-http: Remove unnecessary NULL check
Timo Sirainen [Tue, 31 Jan 2023 16:12:53 +0000 (18:12 +0200)] 
lib-http: Remove unnecessary NULL check

This is confusing static analyzers.

Broken by 987fab8f4e143ab851c3318c8614e81bb0f2b360

2 years agolib: Add unit test for random_fill()
Timo Sirainen [Sun, 29 Jan 2023 10:54:30 +0000 (12:54 +0200)] 
lib: Add unit test for random_fill()

2 years agolib-http: test-http-payload - Use ostream-final-trickle for client connections
Timo Sirainen [Wed, 11 Jan 2023 14:30:16 +0000 (16:30 +0200)] 
lib-http: test-http-payload - Use ostream-final-trickle for client connections

2 years agolib-http: test-http-payload - Add more server last byte trickle tests.
Stephan Bosch [Fri, 27 Jan 2023 03:01:23 +0000 (04:01 +0100)] 
lib-http: test-http-payload - Add more server last byte trickle tests.

2 years agolib-http: test-http-payload - Rename server last byte trickle test.
Stephan Bosch [Fri, 27 Jan 2023 03:05:59 +0000 (04:05 +0100)] 
lib-http: test-http-payload - Rename server last byte trickle test.

2 years agolib-http: test-http-payload - Add server_ prefix to tset.trickle_final_byte.
Stephan Bosch [Fri, 27 Jan 2023 02:54:48 +0000 (03:54 +0100)] 
lib-http: test-http-payload - Add server_ prefix to tset.trickle_final_byte.

2 years agolib-http: test-http-payload - Clean up global http client context between tests.
Stephan Bosch [Thu, 26 Jan 2023 01:41:05 +0000 (02:41 +0100)] 
lib-http: test-http-payload - Clean up global http client context between tests.

2 years agolib-http: test-http-payload - Restructure client init/deinit.
Stephan Bosch [Fri, 21 May 2021 11:07:57 +0000 (13:07 +0200)] 
lib-http: test-http-payload - Restructure client init/deinit.

2 years agolib-http: test-http-payload - Fix segfault occurring upon out-of-sequence request...
Stephan Bosch [Thu, 12 Jan 2023 01:53:38 +0000 (02:53 +0100)] 
lib-http: test-http-payload - Fix segfault occurring upon out-of-sequence request completion.

2 years agolib-http: http-client - Make http_client_global_context_free() public for testing.
Stephan Bosch [Thu, 26 Jan 2023 01:34:39 +0000 (02:34 +0100)] 
lib-http: http-client - Make http_client_global_context_free() public for testing.

2 years agolib-http: client - Don't unlock connection output before request is fully sent
Stephan Bosch [Wed, 25 Jan 2023 04:18:10 +0000 (05:18 +0100)] 
lib-http: client - Don't unlock connection output before request is fully sent

This could happen at least when the payload is empty and the final LF was
buffered.

2 years agolib-http: client - Don't unlock connection output before request payload is fully...
Stephan Bosch [Wed, 25 Jan 2023 20:47:26 +0000 (21:47 +0100)] 
lib-http: client - Don't unlock connection output before request payload is fully sent

2 years agolib-http: http-client-request - Make sure connection output is unlocked if blocking...
Stephan Bosch [Wed, 25 Jan 2023 14:19:30 +0000 (15:19 +0100)] 
lib-http: http-client-request - Make sure connection output is unlocked if blocking request receives response.

Otherwise, a race condition between outgoing payload transmission and receiving
the response may cause connection to hang.

2 years agolib-http: http-client-connection - Remove useless early state transition.
Stephan Bosch [Wed, 25 Jan 2023 14:17:38 +0000 (15:17 +0100)] 
lib-http: http-client-connection - Remove useless early state transition.

Happens in http_client_request_callback() already.

2 years agolib: ostream-wrapper - Don't halt/resume output upon error.
Stephan Bosch [Mon, 21 Mar 2022 11:24:53 +0000 (12:24 +0100)] 
lib: ostream-wrapper - Don't halt/resume output upon error.

2 years agolib: ostream-wrapper - Call output_finished() callback when wrapper stream is finishe...
Stephan Bosch [Wed, 25 Jan 2023 17:39:44 +0000 (18:39 +0100)] 
lib: ostream-wrapper - Call output_finished() callback when wrapper stream is finished and empty.

Before, it would only be called when the parent output is also fully flushed,
which is too late.

2 years agolib-test: ostream-final-trickle - Call o_stream_set_flush_pending(..., TRUE) in timeout.
Stephan Bosch [Wed, 25 Jan 2023 17:36:40 +0000 (18:36 +0100)] 
lib-test: ostream-final-trickle - Call o_stream_set_flush_pending(..., TRUE) in timeout.

2 years agolib-test: ostream-final-trickle - Fix bug occurring when writing single byte.
Stephan Bosch [Thu, 26 Jan 2023 00:59:39 +0000 (01:59 +0100)] 
lib-test: ostream-final-trickle - Fix bug occurring when writing single byte.

2 years agolib-http: Reformat http-client.h.
Stephan Bosch [Tue, 20 Mar 2018 19:59:51 +0000 (20:59 +0100)] 
lib-http: Reformat http-client.h.

2 years agolib-http: Reformat http-client.c.
Stephan Bosch [Tue, 20 Mar 2018 19:59:45 +0000 (20:59 +0100)] 
lib-http: Reformat http-client.c.

2 years agolib-sql: Don't allow passing NULL duration_r to sql_query_finished_event()
Aki Tuomi [Mon, 30 Jan 2023 14:13:27 +0000 (16:13 +0200)] 
lib-sql: Don't allow passing NULL duration_r to sql_query_finished_event()

Almost everyone provides it in any case.

2 years agolib-sql: driver-sqlite - Handle CANTOPEN like READONLY
Aki Tuomi [Fri, 27 Jan 2023 18:25:40 +0000 (20:25 +0200)] 
lib-sql: driver-sqlite - Handle CANTOPEN like READONLY

Older SQLite will not use READONLY.

2 years agolib-sql: driver-sqlite - Include rc in database connection error message
Aki Tuomi [Fri, 27 Jan 2023 18:26:42 +0000 (20:26 +0200)] 
lib-sql: driver-sqlite - Include rc in database connection error message

2 years agofs-randomfail: Make sure 100% probability always fails
Timo Sirainen [Fri, 27 Jan 2023 23:07:26 +0000 (01:07 +0200)] 
fs-randomfail: Make sure 100% probability always fails

The randomness was previously divided 50% pre-operation and 50%
post-operation, so it wasn't guaranteed to always fail.

2 years agolib-storage: shared - Fix handling errors initializing shared mailbox owner user
Timo Sirainen [Fri, 27 Jan 2023 19:59:00 +0000 (21:59 +0200)] 
lib-storage: shared - Fix handling errors initializing shared mailbox owner user

Broken by 46289fd0efce678c07f13bfa5f3cb077d2ea8cb8

2 years agoglobal: Fix libauth and libotp linking issues using --without-shared-libs
Timo Sirainen [Fri, 27 Jan 2023 19:52:04 +0000 (21:52 +0200)] 
global: Fix libauth and libotp linking issues using --without-shared-libs

2 years agologin-common: Rename login_auth_socket_path to login_socket_path
Aki Tuomi [Thu, 26 Jan 2023 10:59:47 +0000 (12:59 +0200)] 
login-common: Rename login_auth_socket_path to login_socket_path

2 years agolib-master, config: Ignore SSL server settings when executing doveconf via doveadm
Timo Sirainen [Mon, 9 Jan 2023 14:29:38 +0000 (16:29 +0200)] 
lib-master, config: Ignore SSL server settings when executing doveconf via doveadm

This is just a temporary kludge to allow running doveadm (as non-root) when
SSL cert/key files aren't readable. Changes later on fix this properly.

2 years agolib-master: Add DOVECONF_SERVICE environment to doveconf
Timo Sirainen [Mon, 9 Jan 2023 22:59:00 +0000 (00:59 +0200)] 
lib-master: Add DOVECONF_SERVICE environment to doveconf

This is needed to avoid calling managesieve dump-capability for doveadm and
other processes that don't need it.

2 years agolib-master, config: Support disabling settings checks
Timo Sirainen [Mon, 26 Dec 2022 20:21:43 +0000 (15:21 -0500)] 
lib-master, config: Support disabling settings checks

This is intended for managesieve's dump-capability.

2 years agoconfig: Remove last traces of modules based filtering
Timo Sirainen [Mon, 9 Jan 2023 14:16:36 +0000 (16:16 +0200)] 
config: Remove last traces of modules based filtering

2 years agoconfig: config_parse_file() - Remove unused modules parameter
Timo Sirainen [Mon, 9 Jan 2023 14:13:42 +0000 (16:13 +0200)] 
config: config_parse_file() - Remove unused modules parameter

2 years agoconfig: config_parse_file() - Change expand_values parameter to enum
Timo Sirainen [Mon, 9 Jan 2023 14:26:02 +0000 (16:26 +0200)] 
config: config_parse_file() - Change expand_values parameter to enum

2 years agolib-master: Keep the config always mmap()ed
Timo Sirainen [Sat, 17 Dec 2022 19:50:45 +0000 (21:50 +0200)] 
lib-master: Keep the config always mmap()ed

The config fd is no longer necessary to keep open.

2 years agolib-master, lib-login: Remove master_service_close_config_fd()
Timo Sirainen [Sat, 17 Dec 2022 19:49:17 +0000 (21:49 +0200)] 
lib-master, lib-login: Remove master_service_close_config_fd()

Config fd is now always kept open and it shouldn't be closed.

2 years agolib-master, global: Remove MASTER_SERVICE_FLAG_KEEP_CONFIG_OPEN
Timo Sirainen [Sat, 17 Dec 2022 19:26:26 +0000 (21:26 +0200)] 
lib-master, global: Remove MASTER_SERVICE_FLAG_KEEP_CONFIG_OPEN

The config is now always kept open.

2 years agolib-master, config: Change parsed config file syntax to binary
Timo Sirainen [Sun, 11 Dec 2022 23:16:21 +0000 (01:16 +0200)] 
lib-master, config: Change parsed config file syntax to binary

Also use mmap() to parse the config more efficiently. The late doveconf
exec fallback is also removed here, since mmap() isn't expected to fail and
afterwards the errors are about the config file syntax errors. (The
doveconf fallback is still there in the earlier code before config fd is
received.)

2 years agolib-settings: Remove unused settings_stream_unescape() and SETTING_STREAM_LF_CHAR
Timo Sirainen [Tue, 29 Nov 2022 19:23:15 +0000 (21:23 +0200)] 
lib-settings: Remove unused settings_stream_unescape() and SETTING_STREAM_LF_CHAR

2 years agolib-settings: Remove unused settings_parse_stream*()
Timo Sirainen [Tue, 29 Nov 2022 19:08:03 +0000 (21:08 +0200)] 
lib-settings: Remove unused settings_parse_stream*()

2 years agolib-settings: test-settings-parser - Parse settings one line at a time instead of...
Timo Sirainen [Tue, 29 Nov 2022 19:06:45 +0000 (21:06 +0200)] 
lib-settings: test-settings-parser - Parse settings one line at a time instead of as streams

2 years agostats: unit tests - Parse settings one line at a time instead of as streams
Timo Sirainen [Tue, 29 Nov 2022 19:03:40 +0000 (21:03 +0200)] 
stats: unit tests - Parse settings one line at a time instead of as streams

2 years agolib-settings: Remove unused settings_parse_environ()
Timo Sirainen [Tue, 29 Nov 2022 18:54:32 +0000 (20:54 +0200)] 
lib-settings: Remove unused settings_parse_environ()

2 years agolib-master: Remove support for reading settings from environment
Timo Sirainen [Sun, 18 Dec 2022 21:09:36 +0000 (23:09 +0200)] 
lib-master: Remove support for reading settings from environment

This is no longer necessary with doveconf -F parameter. The settings were
previously also being read from environment if -k parameter was used, but
there was never any real benefit in doing that. This change was introduced
by a88696bd63b2ce0f7b02ee3352e4bf739497352a simply to keep the behavior
identical when reading settings via doveconf vs config socket.

2 years agolib-master, master: Remove MASTER_SERVICE_FLAG_DISABLE_SSL_SET
Timo Sirainen [Mon, 9 Jan 2023 16:49:58 +0000 (18:49 +0200)] 
lib-master, master: Remove MASTER_SERVICE_FLAG_DISABLE_SSL_SET

This is no longer necessary now that settings are passed via fd.

2 years agomaster, log: Pass config fd from master to log process
Timo Sirainen [Fri, 9 Dec 2022 22:13:26 +0000 (00:13 +0200)] 
master, log: Pass config fd from master to log process

The log process must not depend on the config process, because they would
have a circular dependency. Previously the configuration was sent to the
log process via environment filled by the master process. Now that we have
the full config available in a file descriptor, pass that config fd instead.

2 years agodoveadm sync: Use the main process's configuration for dsync-server process
Timo Sirainen [Mon, 9 Jan 2023 22:13:43 +0000 (00:13 +0200)] 
doveadm sync: Use the main process's configuration for dsync-server process

This preserves the old behavior.

2 years agodoveadm exec: Avoid re-executing doveconf after executing binary
Timo Sirainen [Tue, 20 Dec 2022 21:37:49 +0000 (23:37 +0200)] 
doveadm exec: Avoid re-executing doveconf after executing binary

2 years agolib-master: Support returning master_service_settings_output.config_fd
Timo Sirainen [Sat, 17 Dec 2022 19:44:06 +0000 (21:44 +0200)] 
lib-master: Support returning master_service_settings_output.config_fd

2 years agoconfig, lib-master: Send configuration as a seekable file descriptor
Timo Sirainen [Tue, 29 Nov 2022 23:58:06 +0000 (01:58 +0200)] 
config, lib-master: Send configuration as a seekable file descriptor

This allows lib-master to re-read the configuration using the same open fd.

The binary configuration is written to an unlinked file. The file's fd is
sent to config clients, so the binary config stays allocated until all
config clients have closed the fd.

2 years agoconfig: Remove support for doveconf -e parameter
Timo Sirainen [Sun, 18 Dec 2022 22:25:36 +0000 (00:25 +0200)] 
config: Remove support for doveconf -e parameter

This was replaced by the -F parameter.

2 years agoconfig: config_filter_parsers_get() - Remove unused modules parameter
Timo Sirainen [Sun, 18 Dec 2022 22:05:52 +0000 (00:05 +0200)] 
config: config_filter_parsers_get() - Remove unused modules parameter

2 years agoconfig: config_export_init() - Remove unused modules parameter
Timo Sirainen [Sun, 18 Dec 2022 22:04:00 +0000 (00:04 +0200)] 
config: config_export_init() - Remove unused modules parameter

2 years agodoveconf: Ignore -m and -p parameters
Timo Sirainen [Sun, 18 Dec 2022 22:00:33 +0000 (00:00 +0200)] 
doveconf: Ignore -m and -p parameters

Support for "modules" is going away, so these aren't useful.

2 years agolib-storage, global: Remove unused mail_storage_service_input.module
Timo Sirainen [Tue, 29 Nov 2022 23:05:32 +0000 (01:05 +0200)] 
lib-storage, global: Remove unused mail_storage_service_input.module

2 years agolib-master, global: Remove master_service_settings_input.{module|extra_modules}
Timo Sirainen [Tue, 29 Nov 2022 23:00:31 +0000 (01:00 +0200)] 
lib-master, global: Remove master_service_settings_input.{module|extra_modules}

Configuration reading now reads all the modules always.

2 years agolib-master, master: Remove master_service_settings_input.parse_full_config
Timo Sirainen [Tue, 29 Nov 2022 22:59:33 +0000 (00:59 +0200)] 
lib-master, master: Remove master_service_settings_input.parse_full_config

This flag no longer does anything.

2 years agolib-storage: Remove MAIL_STORAGE_SERVICE_FLAG_NO_SSL_CA and master_service_settings_i...
Timo Sirainen [Tue, 29 Nov 2022 22:57:33 +0000 (00:57 +0200)] 
lib-storage: Remove MAIL_STORAGE_SERVICE_FLAG_NO_SSL_CA and master_service_settings_input.no_ssl_ca

These flags no longer do anything.

2 years agolib-master, config: Remove unused flags in master_service_settings_output
Timo Sirainen [Tue, 29 Nov 2022 22:54:18 +0000 (00:54 +0200)] 
lib-master, config: Remove unused flags in master_service_settings_output

2 years agoconfig: config_export_init() - Remove unused exclude_settings parameter
Timo Sirainen [Sun, 18 Dec 2022 22:08:47 +0000 (00:08 +0200)] 
config: config_export_init() - Remove unused exclude_settings parameter

2 years agoconfig: Require all config request commands to use the new "full" method
Timo Sirainen [Tue, 29 Nov 2022 19:12:26 +0000 (21:12 +0200)] 
config: Require all config request commands to use the new "full" method

Removed the "full" parameter, since it's now always needed. The config
protocol version was increased to make sure clients are compatible.

2 years agolib-master: Execute doveconf with -F parameter as the config fallback
Timo Sirainen [Tue, 29 Nov 2022 18:48:44 +0000 (20:48 +0200)] 
lib-master: Execute doveconf with -F parameter as the config fallback

This changes settings to be read via a fd instead of environment.

As a side effect, this fixes a bug where if the settings output was larger
than 128 kB in Linux, exec() would fail with "Argument list too long".

lib-master preserves support for reading settings from environment for a
few more commits, because the log process uses it to read its settings.

2 years agolib-master: Read config using the new "full" flag
Timo Sirainen [Tue, 29 Nov 2022 17:45:03 +0000 (19:45 +0200)] 
lib-master: Read config using the new "full" flag

2 years agoconfig: Remove unused FILTERS command
Timo Sirainen [Tue, 29 Nov 2022 17:02:47 +0000 (19:02 +0200)] 
config: Remove unused FILTERS command

2 years agolib-master: Remove unused master_service_settings_get_filters()
Timo Sirainen [Tue, 29 Nov 2022 17:02:05 +0000 (19:02 +0200)] 
lib-master: Remove unused master_service_settings_get_filters()

2 years agolib-master: Remove master-service-settings-cache API
Timo Sirainen [Tue, 29 Nov 2022 16:59:53 +0000 (18:59 +0200)] 
lib-master: Remove master-service-settings-cache API

2 years agologin-common: Remove master-service-settings-cache usage
Timo Sirainen [Tue, 29 Nov 2022 16:58:57 +0000 (18:58 +0200)] 
login-common: Remove master-service-settings-cache usage

2 years agolib-storage: Remove master-service-settings-cache usage
Timo Sirainen [Tue, 29 Nov 2022 16:56:28 +0000 (18:56 +0200)] 
lib-storage: Remove master-service-settings-cache usage

2 years agoconfig: Add support for dumping machine-readable "full config"
Timo Sirainen [Mon, 28 Nov 2022 17:39:01 +0000 (19:39 +0200)] 
config: Add support for dumping machine-readable "full config"

This includes the main config and all different filters. It can be
requested from config service with "full" parameter or with doveconf
-F [<command>] parameter. If <command> is not given, output is written
to stdout. Otherwise the <command> is executed and the config is
provided via file descriptor in DOVECOT_CONFIG_FD environment.

The format will change in the following commits.

2 years agoconfig: Generate unique index numbers for unnamed sections
Timo Sirainen [Tue, 20 Dec 2022 12:46:02 +0000 (14:46 +0200)] 
config: Generate unique index numbers for unnamed sections

This will be required by the following changes to allow incrementally
parsing filtered settings.

2 years agomaster: Make sure config reload never causes execing doveconf
Timo Sirainen [Mon, 12 Dec 2022 23:10:02 +0000 (01:10 +0200)] 
master: Make sure config reload never causes execing doveconf

This could have happened if there was an error reading configuration
via config socket. This would have caused master process to restart,
which would have messed up everything.

2 years agolib-master, master: Make sure master process never tries to read config socket at...
Timo Sirainen [Fri, 9 Dec 2022 21:21:25 +0000 (23:21 +0200)] 
lib-master, master: Make sure master process never tries to read config socket at startup

If the config socket exists, it's a leftover from an older dovecot and
shouldn't be trusted.

2 years agoconfig: Remove unnecessary CONFIG_DUMP_FLAG_IN_SECTION
Timo Sirainen [Mon, 28 Nov 2022 17:19:11 +0000 (19:19 +0200)] 
config: Remove unnecessary CONFIG_DUMP_FLAG_IN_SECTION

2 years agoglobal: Use ip type for event fields with IP addresses
Timo Sirainen [Tue, 10 Jan 2023 22:05:40 +0000 (00:05 +0200)] 
global: Use ip type for event fields with IP addresses

2 years agolib: Allow event filters to use '/' and '%' in values without quoting
Timo Sirainen [Fri, 20 Jan 2023 16:20:15 +0000 (18:20 +0200)] 
lib: Allow event filters to use '/' and '%' in values without quoting

This allows using "ip = 127.0.0.0/8%lo" without quotes.

2 years agolib: Add "ip" type for events and "ip/bits" matching for event filters
Timo Sirainen [Fri, 9 Dec 2022 21:02:21 +0000 (23:02 +0200)] 
lib: Add "ip" type for events and "ip/bits" matching for event filters

2 years agolib: net_is_in_network() - Fix checking scope ID in IPv6
Timo Sirainen [Fri, 20 Jan 2023 15:43:55 +0000 (17:43 +0200)] 
lib: net_is_in_network() - Fix checking scope ID in IPv6

Using "ip%iface1" shouldn't match "ip%iface2". However, do allow it to
match "ip" when %iface is missing.

2 years agolib: If key already exists, event_add_str(value=NULL) should clear the key
Timo Sirainen [Thu, 12 Jan 2023 10:46:07 +0000 (12:46 +0200)] 
lib: If key already exists, event_add_str(value=NULL) should clear the key

This seems like a more correct logic than not doing anything with NULL
values. It shouldn't affect any of the existing code though.

2 years agolib-settings: Remove unused settings_parse_file()
Timo Sirainen [Tue, 29 Nov 2022 17:21:59 +0000 (19:21 +0200)] 
lib-settings: Remove unused settings_parse_file()

2 years agolib-settings: Remove unused settings_parse_exec()
Timo Sirainen [Tue, 29 Nov 2022 17:20:44 +0000 (19:20 +0200)] 
lib-settings: Remove unused settings_parse_exec()

2 years agolib-master: Remove code for retrying interrupted config read()s
Timo Sirainen [Tue, 29 Nov 2022 17:32:41 +0000 (19:32 +0200)] 
lib-master: Remove code for retrying interrupted config read()s

This hasn't been working for a long time now. The fd is blocking, so
i_stream_read() returns -1 for it instead of 0 on EINTR. There's
really not supposed to be any signals happening during config reading
anyway (other than SIGALRM timeout, in which case we want to abort the
read instead of retry).

2 years agolib-master: -O parameter shouldn't read settings from environment
Timo Sirainen [Tue, 29 Nov 2022 18:46:28 +0000 (20:46 +0200)] 
lib-master: -O parameter shouldn't read settings from environment

The -O parameter should start with the default configuration only. This
seems to have been an accidental bug, which was just never noticed.

2 years agolib: o_stream_unix_write_fd() - Don't close fd on write failure
Timo Sirainen [Fri, 16 Dec 2022 16:19:09 +0000 (18:19 +0200)] 
lib: o_stream_unix_write_fd() - Don't close fd on write failure

On success the write_fd is set to -1 without closing it, so the caller is
responsible for closing it.

If o_stream_unix_close() is reached with write_fd != -1, it means the write
failed. The write_fd shouldn't be closed in that case either.

This function wasn't actually currently used anywhere.

2 years agolib-storage, global: mail_storage_service_lookup_next() - Remove service_user_r parameter
Timo Sirainen [Thu, 12 Jan 2023 20:07:04 +0000 (22:07 +0200)] 
lib-storage, global: mail_storage_service_lookup_next() - Remove service_user_r parameter

Also change the callers to not bother storing it separately. Instead, they
can just use mail_user_r->service_user.

2 years agolib-storage: Remove unused mail_storage_service_get_global()
Timo Sirainen [Thu, 12 Jan 2023 16:25:23 +0000 (18:25 +0200)] 
lib-storage: Remove unused mail_storage_service_get_global()

2 years agolib-storage, global: Rename mail_user._service_user to service_user
Timo Sirainen [Thu, 12 Jan 2023 16:23:35 +0000 (18:23 +0200)] 
lib-storage, global: Rename mail_user._service_user to service_user

It's now always set, so the underscore isn't useful.

2 years agolib-storage: mail_user_alloc*() - Require service_user parameter
Timo Sirainen [Thu, 12 Jan 2023 16:02:31 +0000 (18:02 +0200)] 
lib-storage: mail_user_alloc*() - Require service_user parameter

2 years agolib-storage: Create a service_user for shared mail_users
Timo Sirainen [Thu, 12 Jan 2023 16:19:42 +0000 (18:19 +0200)] 
lib-storage: Create a service_user for shared mail_users

2 years agolib-storage: shared - Split off shared_mail_user_init()
Timo Sirainen [Thu, 12 Jan 2023 20:50:40 +0000 (22:50 +0200)] 
lib-storage: shared - Split off shared_mail_user_init()