]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
2 years agoimap: Include net_in_bytes, net_out_bytes in event
Aki Tuomi [Tue, 24 Jan 2023 10:42:39 +0000 (12:42 +0200)] 
imap: Include net_in_bytes, net_out_bytes in event

These fields are mainly intended for the mail_user_session_finished event.

2 years agopop3: Use i_stream_get_absolute_offset() in stats
Aki Tuomi [Wed, 25 Jan 2023 09:14:12 +0000 (11:14 +0200)] 
pop3: Use i_stream_get_absolute_offset() in stats

Consistent with other protocols

2 years agoimap: Rename bytes_in,_out to net_in_,out_bytes in cmd stats
Aki Tuomi [Tue, 24 Jan 2023 11:23:21 +0000 (13:23 +0200)] 
imap: Rename bytes_in,_out to net_in_,out_bytes in cmd stats

2 years agologin-common: Rename bytes_in,_out to net_in_,out_bytes
Aki Tuomi [Wed, 25 Jan 2023 19:20:52 +0000 (21:20 +0200)] 
login-common: Rename bytes_in,_out to net_in_,out_bytes

2 years agolib-http: Rename bytes_in,_out to net_in_,out_bytes
Aki Tuomi [Wed, 25 Jan 2023 19:20:24 +0000 (21:20 +0200)] 
lib-http: Rename bytes_in,_out to net_in_,out_bytes

2 years agolib: connection - Rename bytes_in,_out to net_in_,out_bytes
Aki Tuomi [Wed, 25 Jan 2023 19:18:14 +0000 (21:18 +0200)] 
lib: connection - Rename bytes_in,_out to net_in_,out_bytes

2 years agolib: connection - Expose connection_update_counters()
Aki Tuomi [Thu, 9 Feb 2023 07:47:52 +0000 (09:47 +0200)] 
lib: connection - Expose connection_update_counters()

2 years agodbox: dbox_cleanup_temp_files() - Fuzz scan interval adding 0..+30% based on username...
Marco Bettini [Tue, 28 Feb 2023 12:05:44 +0000 (12:05 +0000)] 
dbox: dbox_cleanup_temp_files() - Fuzz scan interval adding 0..+30% based on username hash

2 years agodbox: dbox_cleanup_temp_files() - Reformat code
Marco Bettini [Tue, 28 Feb 2023 11:45:43 +0000 (11:45 +0000)] 
dbox: dbox_cleanup_temp_files() - Reformat code

2 years agodbox: dbox_cleanup_temp_files() - Remove unnecessary else/else if after returns
Marco Bettini [Tue, 28 Feb 2023 11:44:48 +0000 (11:44 +0000)] 
dbox: dbox_cleanup_temp_files() - Remove unnecessary else/else if after returns

2 years agodbox: dbox_mailbox_open() - Drop unused ctime
Marco Bettini [Tue, 28 Feb 2023 11:30:22 +0000 (11:30 +0000)] 
dbox: dbox_mailbox_open() - Drop unused ctime

2 years agodbox: dbox_mailbox_open() - Move dbox_cleanup_temp_files() to dbox_mailbox_close()
Marco Bettini [Tue, 28 Feb 2023 11:21:10 +0000 (11:21 +0000)] 
dbox: dbox_mailbox_open() - Move dbox_cleanup_temp_files() to dbox_mailbox_close()

2 years agodbox: dbox_mailbox_open() - Infer last_temp_file_scan from dir's atime if 0
Marco Bettini [Tue, 28 Feb 2023 10:15:50 +0000 (10:15 +0000)] 
dbox: dbox_mailbox_open() - Infer last_temp_file_scan from dir's atime if 0

2 years agodbox: dbox_mailbox_create() - Update last_temp_file_scan
Marco Bettini [Tue, 28 Feb 2023 10:14:26 +0000 (10:14 +0000)] 
dbox: dbox_mailbox_create() - Update last_temp_file_scan

2 years agolib-storage: dbox_cleanup_temp_files() - Fix inverted check for ENOENT
Marco Bettini [Fri, 3 Mar 2023 16:15:17 +0000 (16:15 +0000)] 
lib-storage: dbox_cleanup_temp_files() - Fix inverted check for ENOENT

2 years agodoveadm: Panic if doveadm_print_header() is called too late
Timo Sirainen [Fri, 24 Feb 2023 14:39:14 +0000 (16:39 +0200)] 
doveadm: Panic if doveadm_print_header() is called too late

Otherwise it's not noticed unless the doveadm command is called for multiple
users (-A, -F).

2 years agodoveadm: Panic if doveadm_print_init() is called too late
Timo Sirainen [Fri, 24 Feb 2023 14:22:28 +0000 (16:22 +0200)] 
doveadm: Panic if doveadm_print_init() is called too late

Otherwise it's not noticed unless the doveadm command is called for multiple
users (-A, -F).

2 years agofts-flatcurve: Move doveadm_print_header() eariler
Marco Bettini [Wed, 1 Mar 2023 16:17:05 +0000 (16:17 +0000)] 
fts-flatcurve: Move doveadm_print_header() eariler

Otherwise the newly introduced checks trigger faults

2 years agofts: fts tokenize - Move doveadm_print_init() eariler
Marco Bettini [Wed, 1 Mar 2023 16:16:11 +0000 (16:16 +0000)] 
fts: fts tokenize - Move doveadm_print_init() eariler

Otherwise the newly introduced checks trigger faults

2 years agomail-crypt: Move doveadm_print_init/header() eariler
Marco Bettini [Tue, 28 Feb 2023 16:49:53 +0000 (16:49 +0000)] 
mail-crypt: Move doveadm_print_init/header() eariler

Otherwise the newly introduced checks trigger faults

2 years agodoveadm: pw - Allow weak schemes in verification
Aki Tuomi [Mon, 27 Feb 2023 14:00:02 +0000 (16:00 +0200)] 
doveadm: pw - Allow weak schemes in verification

2 years agoauth: mech-gssapi - Remove KRB5_USEROK check
Aki Tuomi [Fri, 3 Mar 2023 09:48:38 +0000 (11:48 +0200)] 
auth: mech-gssapi - Remove KRB5_USEROK check

It should be there always these days. Enables cross-realm
and cross-identity authentication always.

2 years agosdbox: Fix panic due to leaked mail_index_view if sync fails
Timo Sirainen [Sun, 5 Feb 2023 18:51:12 +0000 (20:51 +0200)] 
sdbox: Fix panic due to leaked mail_index_view if sync fails

Fixes:
Panic: Leaked view for index .../dbox-Mails/dovecot.index: Opened in mail-index-sync.c:445

2 years agolib-index: Don't update log_file_tail_offset on sync if reading dovecot.index.log...
Timo Sirainen [Sun, 5 Feb 2023 18:50:06 +0000 (20:50 +0200)] 
lib-index: Don't update log_file_tail_offset on sync if reading dovecot.index.log failed

This is more of a theoretical issue, since dovecot.index.log read failure is
very unlikely.

2 years agolib-index: Don't update max_tail_offset if write to dovecot.index.log fails
Timo Sirainen [Sun, 5 Feb 2023 18:47:08 +0000 (20:47 +0200)] 
lib-index: Don't update max_tail_offset if write to dovecot.index.log fails

The max_tail_offset didn't actually increase in that situation.
This fixes wrongly updating mail_index_header.log_file_tail_offset after
write to dovecot.index.log failed (due to out of disk space), which in
turn can cause some unexpected errors.

2 years agolib-index: Fix event leak if purging dovecot.index.cache fails
Timo Sirainen [Sun, 5 Feb 2023 18:46:34 +0000 (20:46 +0200)] 
lib-index: Fix event leak if purging dovecot.index.cache fails

2 years agolib: event-filter-parser.y - Add workaround for nerrs being unused warning
Timo Sirainen [Fri, 24 Feb 2023 12:06:14 +0000 (14:06 +0200)] 
lib: event-filter-parser.y - Add workaround for nerrs being unused warning

Fixes with clang-17:
warning: variable 'event_filter_parser_nerrs' set but not used

2 years agoglobal: Remove dead code
Timo Sirainen [Fri, 24 Feb 2023 12:02:01 +0000 (14:02 +0200)] 
global: Remove dead code

2 years agolib: istream - Don't call memcpy() with NULL parameter --with-devel-checks
Timo Sirainen [Thu, 23 Feb 2023 14:10:43 +0000 (16:10 +0200)] 
lib: istream - Don't call memcpy() with NULL parameter --with-devel-checks

2 years agolib: lib - Add value for defines that don't have it
Aki Tuomi [Wed, 22 Feb 2023 12:08:20 +0000 (14:08 +0200)] 
lib: lib - Add value for defines that don't have it

Fixes compilation with FreeBSD that requires a value for
defines.

Broken in e6f2682b32ff5b366ee7242841c3194425202880

2 years agolib: lib - Remove memcpy macro in C++
Aki Tuomi [Wed, 22 Feb 2023 12:06:57 +0000 (14:06 +0200)] 
lib: lib - Remove memcpy macro in C++

This breaks C++ compilation due to too wide impact.

Broken in 38dbeec767ad10021020e3833b1dbc3d04442f85

2 years agolib-auth: Remove external libraries from dependencies
Aki Tuomi [Wed, 22 Feb 2023 12:06:05 +0000 (14:06 +0200)] 
lib-auth: Remove external libraries from dependencies

This just breaks compilation when they contain -L.

Broken in 5d632abbf571f8e9157b1526533d677a1b8eb829

2 years agolib-mail: Remove obsolete mail-user-hash
Karl Fleischmann [Thu, 23 Feb 2023 07:16:13 +0000 (08:16 +0100)] 
lib-mail: Remove obsolete mail-user-hash

2 years agologin-common: Remove obsolete include of mail-user-hash.h
Karl Fleischmann [Thu, 23 Feb 2023 07:15:48 +0000 (08:15 +0100)] 
login-common: Remove obsolete include of mail-user-hash.h

2 years agofts: cmd_fts_expand_run() - Fix for crash invoking doveadm fts expand -A
Marco Bettini [Wed, 22 Feb 2023 09:18:48 +0000 (09:18 +0000)] 
fts: cmd_fts_expand_run() - Fix for crash invoking doveadm fts expand -A

2 years agoimap: imap_parser_read_next_atom() - Reject special character DEL 0x7F
Marco Bettini [Tue, 21 Feb 2023 10:04:36 +0000 (10:04 +0000)] 
imap: imap_parser_read_next_atom() - Reject special character DEL 0x7F

atom-specials includes CTL, which in turn contains \x00-\x1F and \x7F DEL

2 years agoimap: imap_parser_read_next_atom() - Accept "]" in cmd-tag(s)
Marco Bettini [Tue, 21 Feb 2023 10:03:11 +0000 (10:03 +0000)] 
imap: imap_parser_read_next_atom() - Accept "]" in cmd-tag(s)

despite "]" being in atom-specials, a specific exception is made
for that in ASTRING-CHAR, which is used by tag

2 years agolib-imap-client: Fix crash if SSL initialization fails when connecting
Timo Sirainen [Sun, 5 Feb 2023 19:52:11 +0000 (21:52 +0200)] 
lib-imap-client: Fix crash if SSL initialization fails when connecting

This could be for example due to invalid SSL certificate settings.

2 years agolib-imap-urlauth: imap-urlauth - Don't return errors from imap_msgpart_url*() as...
Stephan Bosch [Fri, 10 Feb 2023 15:46:37 +0000 (16:46 +0100)] 
lib-imap-urlauth: imap-urlauth - Don't return errors from imap_msgpart_url*() as internal errors.

These are explicitly suitable as client errors; e.g. about nonexistent folders.

2 years agolib-imap-urlauth: imap-urlauth - Don't replace error returned by imap_msgpart_url_ope...
Timo Sirainen [Tue, 30 Mar 2021 11:26:08 +0000 (14:26 +0300)] 
lib-imap-urlauth: imap-urlauth - Don't replace error returned by imap_msgpart_url_open_mailbox()

The original error is intended to be sent to the client.

2 years agolib-imap-urlauth: imap-urlauth - Rename error_r parameters to client_error_r
Timo Sirainen [Tue, 30 Mar 2021 11:25:27 +0000 (14:25 +0300)] 
lib-imap-urlauth: imap-urlauth - Rename error_r parameters to client_error_r

This indicates that the error messages are safe to be sent to the client.

2 years agoimap-urlauth: imap-urlauth-worker - Fix event leak.
Stephan Bosch [Fri, 10 Feb 2023 03:57:56 +0000 (04:57 +0100)] 
imap-urlauth: imap-urlauth-worker - Fix event leak.

2 years agolib-imap-urlauth: imap-urlauth-connection - Retain callback when callback returns 0.
Stephan Bosch [Sat, 4 Feb 2023 17:30:37 +0000 (18:30 +0100)] 
lib-imap-urlauth: imap-urlauth-connection - Retain callback when callback returns 0.

Makes sure callback can be called for the next pass; e.g., for abort.

2 years agosubmission: submission-commands - Make sure BURL request abort does not try to send...
Stephan Bosch [Sat, 4 Feb 2023 17:33:26 +0000 (18:33 +0100)] 
submission: submission-commands - Make sure BURL request abort does not try to send second reply.

2 years agosubmission: submission-commands - Remember whether chunk was added for BURL command.
Stephan Bosch [Sat, 4 Feb 2023 17:31:59 +0000 (18:31 +0100)] 
submission: submission-commands - Remember whether chunk was added for BURL command.

2 years agoimap: cmd-urlfetch - Prevent assertion failure upon error in urlfetch callback.
Stephan Bosch [Thu, 1 Dec 2022 19:54:02 +0000 (20:54 +0100)] 
imap: cmd-urlfetch - Prevent assertion failure upon error in urlfetch callback.

Panic was:

Panic: file imap-client.c: line 988 (client_command_free): assertion failed: (!cmd->executing)

2 years agoauth: auth-request - Snapshot the userdb fields upon authentication success.
Stephan Bosch [Wed, 27 Jul 2022 21:09:24 +0000 (23:09 +0200)] 
auth: auth-request - Snapshot the userdb fields upon authentication success.

Otherwise, fields added by mechanisms that don't use a passdb lookup (such as
DOVECOT-TOKEN) can be lost upon the subsequent userdb lookup.

2 years agoauth: auth-client-connection - Fix assertion occurring when DOVECOT-TOKEN mechanism...
Stephan Bosch [Wed, 27 Jul 2022 21:07:29 +0000 (23:07 +0200)] 
auth: auth-client-connection - Fix assertion occurring when DOVECOT-TOKEN mechanism is used.

It was not returned as a "private" mechanism, which now triggers a panic due to
a recently added assertion.

Panic was:

Panic: file sasl-server.c: line 520 (sasl_server_auth_begin): assertion failed: (!private || (mech->flags & MECH_SEC_PRIVATE) != 0)

2 years agoconfig: old-set-parser - Remove mention about external auth server
Aki Tuomi [Fri, 17 Feb 2023 10:07:01 +0000 (12:07 +0200)] 
config: old-set-parser - Remove mention about external auth server

2 years agomaster: Update comment in mkdir_login_dir()
Aki Tuomi [Fri, 17 Feb 2023 10:06:32 +0000 (12:06 +0200)] 
master: Update comment in mkdir_login_dir()

2 years agomaster: Remove settings_have_auth_unix_listeners_in()
Aki Tuomi [Fri, 17 Feb 2023 10:04:48 +0000 (12:04 +0200)] 
master: Remove settings_have_auth_unix_listeners_in()

External authentication has not worked since v2.0.

2 years agoconfigure: Fix linking order of lib-auth and lib-otp
Timo Sirainen [Tue, 14 Feb 2023 23:46:44 +0000 (01:46 +0200)] 
configure: Fix linking order of lib-auth and lib-otp

lib-auth depends on lib-otp, so it should be first.

2 years agolib-imap-client: Fix/clarify selection state handling
Timo Sirainen [Thu, 9 Feb 2023 15:04:22 +0000 (17:04 +0200)] 
lib-imap-client: Fix/clarify selection state handling

The old code assumed that selected_box would be non-NULL while a new mailbox
is being selected. That's not true though, the imapc-storage code closes the
old mailbox before selecting the next one. So the QRESYNC-specific code for
tracking selected-state was never being used. Fixed this, and clarified in
general how the selected-state is supposed to work.

2 years agolib-imap-client: Rename imapc_connection.selecting_box to qresync_selecting_box
Timo Sirainen [Thu, 9 Feb 2023 15:03:00 +0000 (17:03 +0200)] 
lib-imap-client: Rename imapc_connection.selecting_box to qresync_selecting_box

It's only used when QRESYNC extension is enabled.

2 years agoimapc: Fix handling EXISTS reply to previous mailbox while selecting new mailbox
Timo Sirainen [Thu, 9 Feb 2023 14:21:24 +0000 (16:21 +0200)] 
imapc: Fix handling EXISTS reply to previous mailbox while selecting new mailbox

For example if the communication was:

C: a SELECT box1
...
C: b SELECT box2
S: * 10 EXISTS
S: * 1 EXISTS
S: * OK [UIDVALIDITY 1675948459] UIDs valid
S: ...
S: b OK

The first EXISTS is meant for box1, not box2. Fixed by not starting a FETCH
(FLAGS) for the mailbox being selected until the tagged reply is received.

2 years agoimapc: Don't process untagged replies in mailbox that isn't fully selected yet
Timo Sirainen [Thu, 9 Feb 2023 14:12:35 +0000 (16:12 +0200)] 
imapc: Don't process untagged replies in mailbox that isn't fully selected yet

For example if the communication was:

C: a SELECT box1
...
C: b SELECT box2
S: * 1 EXPUNGE
S: * 1 EXISTS
S: * OK [UIDVALIDITY 1675948459] UIDs valid
S: ...
S: b OK

The expunge was intended for box1, not box2. This caused:
Warning: imapc(...): Mailbox '...' state corrupted: EXPUNGE received for empty mailbox - reconnecting

Fixed this by ignoring untagged EXPUNGE, FETCH, SEARCH and ESEARCH replies
when the UIDVALIDITY reply hasn't been yet received for a mailbox.

2 years agolib-storage: Omit irrelevant mail uid=0 for saved mails in mail event log prefix
Karl Fleischmann [Tue, 7 Feb 2023 15:01:38 +0000 (16:01 +0100)] 
lib-storage: Omit irrelevant mail uid=0 for saved mails in mail event log prefix

2 years agolib-storage: Make mail error UID reporting consistent for corrupted cache
Karl Fleischmann [Tue, 7 Feb 2023 10:07:05 +0000 (11:07 +0100)] 
lib-storage: Make mail error UID reporting consistent for corrupted cache

2 years agoglobal: Access mail errors directly instead of mailbox errors
Karl Fleischmann [Wed, 1 Feb 2023 17:00:18 +0000 (18:00 +0100)] 
global: Access mail errors directly instead of mailbox errors

2 years agolib-storage: Unit test mail*_get_last_internal_error() functions
Karl Fleischmann [Wed, 1 Feb 2023 17:04:24 +0000 (18:04 +0100)] 
lib-storage: Unit test mail*_get_last_internal_error() functions

2 years agolib-storage: Unit test mail_set_critical()
Karl Fleischmann [Thu, 26 Jan 2023 10:36:03 +0000 (11:36 +0100)] 
lib-storage: Unit test mail_set_critical()

2 years agolib-storage: Report critical mail errors without redundant mail prefix
Karl Fleischmann [Thu, 19 Jan 2023 15:40:34 +0000 (16:40 +0100)] 
lib-storage: Report critical mail errors without redundant mail prefix

Don't report mail prefix unless it's different from last tracked mail
uid, similar to mailbox_get_last_internal_error().

2 years agolib-storage: Fix typo in note-comment of mailbox_get_last_internal_error()
Karl Fleischmann [Thu, 19 Jan 2023 15:05:12 +0000 (16:05 +0100)] 
lib-storage: Fix typo in note-comment of mailbox_get_last_internal_error()

2 years agofts: Remove unused fts-expunge-log
Timo Sirainen [Mon, 30 Jan 2023 23:39:23 +0000 (01:39 +0200)] 
fts: Remove unused fts-expunge-log

2 years agolib-master: Fail if SOCKET_COUNT environment is empty in non-standalone mode
Timo Sirainen [Tue, 7 Feb 2023 20:36:32 +0000 (22:36 +0200)] 
lib-master: Fail if SOCKET_COUNT environment is empty in non-standalone mode

The master process is expected to always set SOCKET_COUNT.

2 years agolib-master: Ignore SOCKET_COUNT with MASTER_SERVICE_FLAG_STANDALONE
Timo Sirainen [Tue, 7 Feb 2023 20:35:24 +0000 (22:35 +0200)] 
lib-master: Ignore SOCKET_COUNT with MASTER_SERVICE_FLAG_STANDALONE

This could have caused problems when e.g. doveadm command was executed
inside a process started via master process.

2 years agoauth: test-lua - Check that password is returned in lookup
Aki Tuomi [Wed, 8 Feb 2023 18:40:41 +0000 (20:40 +0200)] 
auth: test-lua - Check that password is returned in lookup

2 years agoauth: test-lua - Test bad keynames end up ignored
Aki Tuomi [Wed, 8 Feb 2023 18:32:57 +0000 (20:32 +0200)] 
auth: test-lua - Test bad keynames end up ignored

2 years agolib-storage: mail-user - Add event_ prefixed values from userdb as event fields
Aki Tuomi [Wed, 1 Feb 2023 11:58:42 +0000 (13:58 +0200)] 
lib-storage: mail-user - Add event_ prefixed values from userdb as event fields

2 years agolib-auth-client: auth-client-request - Use split value in args_parse_user()
Aki Tuomi [Mon, 6 Feb 2023 09:11:06 +0000 (11:11 +0200)] 
lib-auth-client: auth-client-request - Use split value in args_parse_user()

Since we already split this in previous commit, we can take advantage
of the provided key-value.

2 years agologin-common: Add event_ prefixed values from auth as event fields
Aki Tuomi [Wed, 1 Feb 2023 11:53:42 +0000 (13:53 +0200)] 
login-common: Add event_ prefixed values from auth as event fields

2 years agoauth: db-lua - Skip invalid keys and values on field export
Aki Tuomi [Mon, 6 Feb 2023 19:23:48 +0000 (21:23 +0200)] 
auth: db-lua - Skip invalid keys and values on field export

2 years agolib: t_split_key_value*() - Use ATTR_NOWARN_UNUSED_RESULT
Timo Sirainen [Tue, 7 Feb 2023 18:43:08 +0000 (20:43 +0200)] 
lib: t_split_key_value*() - Use ATTR_NOWARN_UNUSED_RESULT

2 years agodoveadm auth login: Separate userdb's user from userdb actual extra fields in command...
Marco Bettini [Thu, 2 Feb 2023 11:00:04 +0000 (11:00 +0000)] 
doveadm auth login: Separate userdb's user from userdb actual extra fields in command output

2 years agolib-storage: set_line() - Add check against empty lines and keys, drop suffixing...
Marco Bettini [Fri, 3 Feb 2023 16:25:19 +0000 (16:25 +0000)] 
lib-storage: set_line() - Add check against empty lines and keys, drop suffixing lines without '='

The previous check is no longer necessary as keys are now always followed
by '=', but in case of empty lines now the function would crash instead
of setting "plugin/=yes" (which didn't make sense either)

2 years agoauth: Remove extra tabs inserted using auth_fields_append()
Marco Bettini [Thu, 2 Feb 2023 09:26:12 +0000 (09:26 +0000)] 
auth: Remove extra tabs inserted using auth_fields_append()

2 years agoauth: Drop auth_fields_booleanize()
Marco Bettini [Mon, 23 Jan 2023 16:24:33 +0000 (16:24 +0000)] 
auth: Drop auth_fields_booleanize()

Booleanization is no longer necessary as now the fields expecting it
expect just the field presence, not a specific value.

2 years agoauth: Allow auth extra-fields with empty strings, NULL values enforced to empty string ""
Marco Bettini [Fri, 27 Jan 2023 13:37:15 +0000 (13:37 +0000)] 
auth: Allow auth extra-fields with empty strings, NULL values enforced to empty string ""

2 years agoauth: Use t_split_key_value_eq()
Marco Bettini [Wed, 1 Feb 2023 11:44:06 +0000 (11:44 +0000)] 
auth: Use t_split_key_value_eq()

auth_user_fields_parse() use t_split_key_value_eq

2 years agolib-storage: mail_user_get_alt_usernames() - Skip empty string values
Marco Bettini [Fri, 27 Jan 2023 14:03:22 +0000 (14:03 +0000)] 
lib-storage: mail_user_get_alt_usernames() - Skip empty string values

2 years agolib-storage: Use t_split_key_value_eq()
Marco Bettini [Fri, 27 Jan 2023 13:43:34 +0000 (13:43 +0000)] 
lib-storage: Use t_split_key_value_eq()

2 years agologin-common: authenticate_callback() - Accept valued items for nologin,proxy,anonymous
Marco Bettini [Fri, 27 Jan 2023 13:55:27 +0000 (13:55 +0000)] 
login-common: authenticate_callback() - Accept valued items for nologin,proxy,anonymous

Previously these fields were expected to be sent only value-less (i.e. with no trailing '=<value>')

2 years agologin-common: sasl-server - Use t_split_key_value_eq()
Marco Bettini [Fri, 27 Jan 2023 13:30:17 +0000 (13:30 +0000)] 
login-common: sasl-server - Use t_split_key_value_eq()

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.