]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
5 years agoutil: Add a script to gather system information in an archive for report purpose.
Sina Tavakoli [Wed, 15 Jan 2020 09:40:24 +0000 (11:40 +0200)] 
util: Add a script to gather system information in an archive for report purpose.

5 years agolib-fs: Create fs.event earlier so it's available in fs_init() code
Timo Sirainen [Fri, 24 Jan 2020 10:33:14 +0000 (12:33 +0200)] 
lib-fs: Create fs.event earlier so it's available in fs_init() code

5 years agoacl: Fix accessing attributes when mailbox had no READ rights
Timo Sirainen [Wed, 15 Jan 2020 13:46:47 +0000 (15:46 +0200)] 
acl: Fix accessing attributes when mailbox had no READ rights

It's enough to have one of the other rights.

5 years agolib-storage, imap, doveadm: Add and use MAILBOX_FLAG_ATTRIBUTE_SESSION
Timo Sirainen [Wed, 15 Jan 2020 13:35:26 +0000 (15:35 +0200)] 
lib-storage, imap, doveadm: Add and use MAILBOX_FLAG_ATTRIBUTE_SESSION

5 years agoacl: Improve attribute rights check error handling
Timo Sirainen [Wed, 15 Jan 2020 13:45:21 +0000 (15:45 +0200)] 
acl: Improve attribute rights check error handling

5 years agoacl: Move attribute rights checking to its own function
Timo Sirainen [Wed, 15 Jan 2020 13:43:11 +0000 (15:43 +0200)] 
acl: Move attribute rights checking to its own function

5 years agolib-imap-storage, doveadm: Ignore INBOX ACLs when accessing server metadata
Timo Sirainen [Tue, 14 Jan 2020 12:58:05 +0000 (14:58 +0200)] 
lib-imap-storage, doveadm: Ignore INBOX ACLs when accessing server metadata

The server metadata is always accessible. INBOX's ACLs aren't relevant,
even though internally for now we're using INBOX for storing the server
metadata.

5 years agolib-storage, acl: Fix error trying to open autocreated mailbox without CREATE rights
Timo Sirainen [Wed, 15 Jan 2020 13:40:41 +0000 (15:40 +0200)] 
lib-storage, acl: Fix error trying to open autocreated mailbox without CREATE rights

The opening should fail with a regular error message rather than "internal
server error". Also no error message should be logged in this situation.

5 years agodns, login-common, stats: Finish service initialization later
Timo Sirainen [Sat, 9 Nov 2019 08:49:47 +0000 (10:49 +0200)] 
dns, login-common, stats: Finish service initialization later

This way if there's a crash in the init code, master will start throttling
the service.

5 years agosubmission-login: submission-proxy - Properly encode XCLIENT command arguments.
Stephan Bosch [Thu, 12 Dec 2019 08:31:48 +0000 (09:31 +0100)] 
submission-login: submission-proxy - Properly encode XCLIENT command arguments.

5 years agosubmission-login: submission-proxy - Compose XCLIENT forward argument in a separate...
Stephan Bosch [Thu, 12 Dec 2019 08:31:48 +0000 (09:31 +0100)] 
submission-login: submission-proxy - Compose XCLIENT forward argument in a separate function.

5 years agosubmission-login: Reformat submission-proxy.c.
Stephan Bosch [Thu, 12 Dec 2019 08:38:51 +0000 (09:38 +0100)] 
submission-login: Reformat submission-proxy.c.

5 years agolib-smtp: server: Fix copying xclient_extensions settings
Timo Sirainen [Wed, 11 Dec 2019 13:05:50 +0000 (15:05 +0200)] 
lib-smtp: server: Fix copying xclient_extensions settings

smtp_server_connection didn't properly copy the xclient_extensions settings
from the smtp_server. In fact it did the opposite of recreating the server
settings using the connection pool. Later on after the connection was freed
and another connection created this could result in crashes.

5 years agolib-imap: imap_write_arg() - minor optimization to IMAP_ARG_STRING
Timo Sirainen [Thu, 24 Oct 2019 08:43:58 +0000 (11:43 +0300)] 
lib-imap: imap_write_arg() - minor optimization to IMAP_ARG_STRING

Avoid unnecessarily using data stack.

Also add unit tests to imap_write_arg().

5 years agolib-fs: Add errno parameter to fs_set_error() change callers to use it.
Timo Sirainen [Tue, 21 Jan 2020 13:59:51 +0000 (15:59 +0200)] 
lib-fs: Add errno parameter to fs_set_error() change callers to use it.

This is now explicit so it can't be forgotten accidentally. Fixes several
bugs where errno wasn't set on error conditions, which could have caused
callers to handle the error wrong.

5 years agolib-fs: Use fs_set_error_errno() where appropriate
Timo Sirainen [Tue, 21 Jan 2020 13:54:42 +0000 (15:54 +0200)] 
lib-fs: Use fs_set_error_errno() where appropriate

5 years agolib-fs: Add fs_set_error_errno()
Timo Sirainen [Tue, 21 Jan 2020 13:50:07 +0000 (15:50 +0200)] 
lib-fs: Add fs_set_error_errno()

This is in preparation for adding errno parameter for fs_set_error().

5 years agodoc: example-config: Add documentation for "revision" field in imap_id_send
Siavash Tavakoli [Mon, 13 Jan 2020 09:50:51 +0000 (11:50 +0200)] 
doc: example-config: Add documentation for "revision" field in imap_id_send

5 years agolib-imap: Add revision field for ID command
Siavash Tavakoli [Mon, 9 Dec 2019 11:58:50 +0000 (13:58 +0200)] 
lib-imap: Add revision field for ID command

Returns short commit ID of the revision dovecot was built from.

5 years agolib-fs: Fix event leak when EAGAIN error is logged via fs_set_error()
Timo Sirainen [Mon, 20 Jan 2020 14:15:41 +0000 (16:15 +0200)] 
lib-fs: Fix event leak when EAGAIN error is logged via fs_set_error()

Broken by f7aafd832151dd34e28cb1bba214accf9b15d908

5 years agolib-fs: Don't log "Asynchronous operation in progress" debug messages
Timo Sirainen [Tue, 14 Jan 2020 21:28:53 +0000 (23:28 +0200)] 
lib-fs: Don't log "Asynchronous operation in progress" debug messages

5 years agolazy-expunge: Track duplicate messages using REFCOUNT_ID rather than GUID
Timo Sirainen [Thu, 28 Nov 2019 18:30:08 +0000 (20:30 +0200)] 
lazy-expunge: Track duplicate messages using REFCOUNT_ID rather than GUID

Although these are usually the same, that's not really guaranteed.
Also REFCOUNT_ID can be more efficient to lookup than GUID.

5 years agolib-storage: Add MAIL_FETCH_REFCOUNT_ID
Timo Sirainen [Thu, 28 Nov 2019 18:28:35 +0000 (20:28 +0200)] 
lib-storage: Add MAIL_FETCH_REFCOUNT_ID

This returns a unique ID for the mail that is counted by
MAIL_FETCH_REFCOUNT. For example if the refcount is counted using the
file's st_nlinks, then the refcount-id is the file's inode number. This is
likely only going to be used by lazy_expunge_only_last_instance=yes
tracking.

5 years agolib-ssl-iostream: Don't link unit test with -static
Timo Sirainen [Tue, 3 Dec 2019 22:45:34 +0000 (00:45 +0200)] 
lib-ssl-iostream: Don't link unit test with -static

It's not useful and it breaks in some systems.

5 years agoplugins: fts-solr: solr-response - Fix incremental parsing of XML element data in...
Stephan Bosch [Tue, 8 Oct 2019 16:57:02 +0000 (18:57 +0200)] 
plugins: fts-solr: solr-response - Fix incremental parsing of XML element data in small chunks.

5 years agoplugins: fts-solr: solr-response - Use strnum.h for numeric parsing.
Stephan Bosch [Tue, 8 Oct 2019 16:57:00 +0000 (18:57 +0200)] 
plugins: fts-solr: solr-response - Use strnum.h for numeric parsing.

5 years agoplugins: fts-solr: solr-response - Make lookup response parser a separate entity.
Stephan Bosch [Tue, 8 Oct 2019 16:57:00 +0000 (18:57 +0200)] 
plugins: fts-solr: solr-response - Make lookup response parser a separate entity.

This improves the structure of the code and allows writing a unit test for the
parser, which is included in this commit.

5 years agoplugins: fts-solr: solr-reponse - Move init/deinit of struct solr_response_parser...
Stephan Bosch [Tue, 8 Oct 2019 16:57:00 +0000 (18:57 +0200)] 
plugins: fts-solr: solr-reponse - Move init/deinit of struct solr_response_parser to separate functions.

5 years agoplugins: fts-solr: solr-connection - Use i_stream_get_error() for reporting stream...
Stephan Bosch [Tue, 8 Oct 2019 16:56:59 +0000 (18:56 +0200)] 
plugins: fts-solr: solr-connection - Use i_stream_get_error() for reporting stream errors.

5 years agoplugins: fts-solr: Move xml_parser field from struct solr_connection to struct solr_r...
Stephan Bosch [Tue, 8 Oct 2019 16:56:59 +0000 (18:56 +0200)] 
plugins: fts-solr: Move xml_parser field from struct solr_connection to struct solr_response_parser.

5 years agoplugins: fts-solr: solr-response - Rename struct solr_lookup_xml_context to struct...
Stephan Bosch [Tue, 8 Oct 2019 16:56:59 +0000 (18:56 +0200)] 
plugins: fts-solr: solr-response - Rename struct solr_lookup_xml_context to struct solr_response_parser.

Also rename the variable names accordingly.

5 years agoplugins: fts-solr: solr-connection - Remove useless XML_ParserReset() calls.
Stephan Bosch [Tue, 8 Oct 2019 16:56:58 +0000 (18:56 +0200)] 
plugins: fts-solr: solr-connection - Remove useless XML_ParserReset() calls.

5 years agoplugins: fts-solr: solr-connection - Put all update context data in struct solr_conne...
Stephan Bosch [Tue, 8 Oct 2019 16:56:58 +0000 (18:56 +0200)] 
plugins: fts-solr: solr-connection - Put all update context data in struct solr_connection_post.

5 years agoplugins: fts-solr: solr-connection - Move lookup context data to separate struct.
Stephan Bosch [Tue, 8 Oct 2019 16:56:58 +0000 (18:56 +0200)] 
plugins: fts-solr: solr-connection - Move lookup context data to separate struct.

5 years agoplugins: fts-solr: Move solr_lookup_xml_data() from solr-connection.c to solr-response.c.
Stephan Bosch [Tue, 8 Oct 2019 16:56:57 +0000 (18:56 +0200)] 
plugins: fts-solr: Move solr_lookup_xml_data() from solr-connection.c to solr-response.c.

5 years agoplugins: fts-solr: Move solr_lookup_xml_end() from solr-connection.c to solr-response.c.
Stephan Bosch [Tue, 8 Oct 2019 16:56:57 +0000 (18:56 +0200)] 
plugins: fts-solr: Move solr_lookup_xml_end() from solr-connection.c to solr-response.c.

5 years agoplugins: fts-solr: Move solr_lookup_add_doc() from solr-connection.c to solr-response.c.
Stephan Bosch [Tue, 8 Oct 2019 16:56:56 +0000 (18:56 +0200)] 
plugins: fts-solr: Move solr_lookup_add_doc() from solr-connection.c to solr-response.c.

5 years agoplugins: fts-solr: Move solr_result_get() from solr-connection.c to solr-response.c.
Stephan Bosch [Tue, 8 Oct 2019 16:56:55 +0000 (18:56 +0200)] 
plugins: fts-solr: Move solr_result_get() from solr-connection.c to solr-response.c.

5 years agoplugins: fts-solr: Move solr_lookup_xml_start() from solr-connection.c to solr-respon...
Stephan Bosch [Tue, 8 Oct 2019 16:56:55 +0000 (18:56 +0200)] 
plugins: fts-solr: Move solr_lookup_xml_start() from solr-connection.c to solr-response.c.

5 years agoplugins: fts-solr: Move solr_xml_parse() from solr-connection.c to solr-response.c.
Stephan Bosch [Tue, 8 Oct 2019 16:56:54 +0000 (18:56 +0200)] 
plugins: fts-solr: Move solr_xml_parse() from solr-connection.c to solr-response.c.

5 years agoplugins: fts-solr: Move definition of struct solr_lookup_xml_context from solr-connec...
Stephan Bosch [Tue, 8 Oct 2019 16:56:54 +0000 (18:56 +0200)] 
plugins: fts-solr: Move definition of struct solr_lookup_xml_context from solr-connection.c to solr-response.c.

5 years agoplugins: fts-solr: Move definition of struct solr_result from solr-connection.h to...
Stephan Bosch [Tue, 8 Oct 2019 16:56:53 +0000 (18:56 +0200)] 
plugins: fts-solr: Move definition of struct solr_result from solr-connection.h to solr-response.h.

5 years agoplugins: fts-solr: Reformat solr-connection.c.
Stephan Bosch [Tue, 8 Oct 2019 16:56:51 +0000 (18:56 +0200)] 
plugins: fts-solr: Reformat solr-connection.c.

5 years agolib-master: master-login-auth - Fix master_login_auth_request leakage
Sina Tavakoli [Wed, 8 Jan 2020 11:13:18 +0000 (13:13 +0200)] 
lib-master: master-login-auth - Fix master_login_auth_request leakage

5 years agolib-master: master-login-auth - Fix auth lookup privilege problem when imap process...
Sina Tavakoli [Wed, 8 Jan 2020 11:10:34 +0000 (13:10 +0200)] 
lib-master: master-login-auth - Fix auth lookup privilege problem when imap process is reused and user is un-hibernated.

5 years agolib-test: test-common - Add "test_expect_error_string_n_times" function to expect...
Sina Tavakoli [Wed, 8 Jan 2020 11:05:20 +0000 (13:05 +0200)] 
lib-test: test-common - Add "test_expect_error_string_n_times" function to expect an error output for an arbitrary times.

5 years agolib-master: master-login-auth - Reformat unnecessary semicolon
Sina Tavakoli [Wed, 8 Jan 2020 11:02:23 +0000 (13:02 +0200)] 
lib-master: master-login-auth - Reformat unnecessary semicolon

5 years agolib-master: Simplify auth-master connection code
Timo Sirainen [Wed, 11 Dec 2019 12:10:12 +0000 (14:10 +0200)] 
lib-master: Simplify auth-master connection code

For UNIX sockets the client_connected callback is always called immediately
after successful connection_client_connect(). So we might as well directly
add auth->connected=TRUE after it succeeds without having to go through the
callback.

If the callback had been called later, the current code would have been
broken because it already assumed that auth->connected=TRUE is set
immediately after returning from master_login_auth_connect(). So this
change just makes it clearer what happens and what is required.

5 years agostats: Make sure unit tests don't fail with fast CPUs
Timo Sirainen [Thu, 2 Jan 2020 18:20:24 +0000 (20:20 +0200)] 
stats: Make sure unit tests don't fail with fast CPUs

5 years agorun-test-valgrind.supp: Drop fun:*msync from libunwind suppression
Martti Rannanjärvi [Mon, 23 Dec 2019 11:59:48 +0000 (13:59 +0200)] 
run-test-valgrind.supp: Drop fun:*msync from libunwind suppression

This is either fun:__msync_nocancel or fun:msync, and hopefully the
suppression here works for both.

5 years agom4: Always generate suppressions with valgrind
Martti Rannanjärvi [Mon, 23 Dec 2019 10:36:13 +0000 (12:36 +0200)] 
m4: Always generate suppressions with valgrind

5 years agostats: Output multi level sub-metrics correctly
Aki Tuomi [Fri, 20 Dec 2019 10:31:17 +0000 (12:31 +0200)] 
stats: Output multi level sub-metrics correctly

5 years agostats: Add unit test for group by
Aki Tuomi [Mon, 9 Dec 2019 17:57:32 +0000 (19:57 +0200)] 
stats: Add unit test for group by

5 years agostats: Add initial unit tests
Aki Tuomi [Mon, 9 Dec 2019 13:17:48 +0000 (15:17 +0200)] 
stats: Add initial unit tests

5 years agostats: Implement group_by
Aki Tuomi [Sun, 1 Dec 2019 14:06:25 +0000 (16:06 +0200)] 
stats: Implement group_by

group_by allows dynamic creation of sub-metrics for metric.

Example:

metric imap_command {
   event_name = imap_command_finished
   group_by = cmd_name tagged_reply_state
}

will generate following metrics

imap_command_select_ok
imap_command_select_bad
imap_command_select_no

etc.

based on what sort of events come in. new metrics are generated
when event comes in and then they are tracked.

only strings can be used for group_by for now.

5 years agostats: Dump sub-metrics
Aki Tuomi [Sun, 1 Dec 2019 14:06:42 +0000 (16:06 +0200)] 
stats: Dump sub-metrics

5 years agostats: Add sub-metrics to metrics
Aki Tuomi [Sun, 1 Dec 2019 16:24:01 +0000 (18:24 +0200)] 
stats: Add sub-metrics to metrics

Needed by next commit

5 years agostats: Move metric initialization to stats_metric_alloc()
Aki Tuomi [Sun, 1 Dec 2019 14:51:15 +0000 (16:51 +0200)] 
stats: Move metric initialization to stats_metric_alloc()

5 years agostats: Add data stack frames when handling events
Aki Tuomi [Wed, 4 Dec 2019 12:00:37 +0000 (14:00 +0200)] 
stats: Add data stack frames when handling events

Reduces memory usage

5 years agolib-storage: Always fix inconsistency when syncing private flags index
Timo Sirainen [Thu, 12 Dec 2019 10:36:23 +0000 (12:36 +0200)] 
lib-storage: Always fix inconsistency when syncing private flags index

The flags index can't be fully synced with the main index at all times
anyway, so don't even try. Just fully sync it always and fix any found
inconsistencies.

Fixes:
Error: dovecot.index.pvt reset, view is now inconsistent

5 years agolib-index: Fix potential crash when view is synced after index is reset
Timo Sirainen [Thu, 12 Dec 2019 10:30:37 +0000 (12:30 +0200)] 
lib-index: Fix potential crash when view is synced after index is reset

view_sync_set_log_view_range() sees that index is reset, so it clears the
log_view, which sets log_view->cur=NULL. Later on view_sync_have_expunges()
calls mail_transaction_log_view_mark(), which crashes because
log_view->cur==NULL.

This crash mainly happened when searching for seen flags in a newly created
mailbox with INDEXPVT. This commit doesn't actually fix the bug, but it
fixes the resulting crash.

5 years agolib-storage: mailbox_get_metadata() - Return cache_fields allocated from data stack
Timo Sirainen [Tue, 3 Dec 2019 21:55:55 +0000 (23:55 +0200)] 
lib-storage: mailbox_get_metadata() - Return cache_fields allocated from data stack

Using mailbox.metacache_pool breaks if it's called multiple times for the
same mailbox and the old results are still used. This happened in
index_copy_cache_fields() when copying mails within the same mailbox. In
some situations this could have caused a crash.

5 years agolib-http: Update event fields once more in http_client_request_submit()
Timo Sirainen [Tue, 3 Dec 2019 19:07:46 +0000 (21:07 +0200)] 
lib-http: Update event fields once more in http_client_request_submit()

Especially the port number could have changed.

5 years agolib-http: Add support for permanent headers
Timo Sirainen [Tue, 3 Dec 2019 18:04:47 +0000 (20:04 +0200)] 
lib-http: Add support for permanent headers

5 years agolib-http: Add http_client_request_set_event_headers()
Timo Sirainen [Tue, 3 Dec 2019 14:26:42 +0000 (16:26 +0200)] 
lib-http: Add http_client_request_set_event_headers()

5 years agolib-http: Include HTTP response reason text in debug log messages
Timo Sirainen [Tue, 3 Dec 2019 12:20:24 +0000 (14:20 +0200)] 
lib-http: Include HTTP response reason text in debug log messages

5 years agofs-compress, fs-crypt: Remove duplicate fs-driver prefix in init errors
Timo Sirainen [Mon, 2 Dec 2019 19:19:04 +0000 (21:19 +0200)] 
fs-compress, fs-crypt: Remove duplicate fs-driver prefix in init errors

fs_init() already prefixes the error with "fs-driver: "

5 years agoglobal: Don't use CALLBACK_TYPECHECK() in arithmetic with context
Timo Sirainen [Sat, 30 Nov 2019 16:14:21 +0000 (18:14 +0200)] 
global: Don't use CALLBACK_TYPECHECK() in arithmetic with context

This fails if the context type is incomplete.

5 years agolib-http: Add http_client_request_get_attempts()
Timo Sirainen [Sat, 30 Nov 2019 16:14:09 +0000 (18:14 +0200)] 
lib-http: Add http_client_request_get_attempts()

5 years agoNEWS: Add news for 2.3.9.2
Aki Tuomi [Fri, 13 Dec 2019 11:40:14 +0000 (13:40 +0200)] 
NEWS: Add news for 2.3.9.2

5 years agopush-notification: Fix crash with empty from/to header
Timo Sirainen [Fri, 13 Dec 2019 11:35:06 +0000 (13:35 +0200)] 
push-notification: Fix crash with empty from/to header

5 years agomdbox: Support setting save_date
Hector Martin [Tue, 19 Nov 2019 04:59:53 +0000 (13:59 +0900)] 
mdbox: Support setting save_date

5 years agoNEWS: Add news for 2.3.9.1
Aki Tuomi [Wed, 11 Dec 2019 14:58:38 +0000 (16:58 +0200)] 
NEWS: Add news for 2.3.9.1

5 years agocassandra: Handle CASS_ERROR_SERVER_WRITE_FAILURE also as "uncertain write"
Timo Sirainen [Thu, 28 Nov 2019 19:23:15 +0000 (21:23 +0200)] 
cassandra: Handle CASS_ERROR_SERVER_WRITE_FAILURE also as "uncertain write"

This error apparently doesn't happen often, but it seems to be a per-node
failure so some Cassandra nodes could have written the change.

5 years agolib-smtp: Add smtp_address_case_equals().
Stephan Bosch [Sun, 8 Dec 2019 12:17:42 +0000 (13:17 +0100)] 
lib-smtp: Add smtp_address_case_equals().

5 years agolib-smtp: Add smtp_address_cmp_icase().
Stephan Bosch [Sun, 8 Dec 2019 12:16:26 +0000 (13:16 +0100)] 
lib-smtp: Add smtp_address_cmp_icase().

5 years agopush-notification-driver-lua: Provide missing to/from as empty string
Aki Tuomi [Wed, 11 Dec 2019 12:04:32 +0000 (14:04 +0200)] 
push-notification-driver-lua: Provide missing to/from as empty string

5 years agopush-notification: Handle group names correctly in from/to
Aki Tuomi [Wed, 11 Dec 2019 11:16:19 +0000 (13:16 +0200)] 
push-notification: Handle group names correctly in from/to

Fixes signal 11 crash

5 years agosubmission: Fix submission_max_mail_size setting type
Timo Sirainen [Mon, 22 Jul 2019 13:16:51 +0000 (16:16 +0300)] 
submission: Fix submission_max_mail_size setting type

5 years agolib-fs: Add fs event category to fs events
Timo Sirainen [Mon, 2 Dec 2019 17:06:40 +0000 (19:06 +0200)] 
lib-fs: Add fs event category to fs events

5 years agolib-fs: Log any pending errors in fs_file_deinit()
Timo Sirainen [Fri, 29 Nov 2019 15:49:23 +0000 (17:49 +0200)] 
lib-fs: Log any pending errors in fs_file_deinit()

If error was set to the file but it wasn't accessed with
fs_file_last_error(), it means the error message would become lost.
Usually this is probably not intended.

5 years agolib-fs: Log previous fs_file error if it's being overridden
Timo Sirainen [Fri, 29 Nov 2019 15:11:15 +0000 (17:11 +0200)] 
lib-fs: Log previous fs_file error if it's being overridden

This makes sure that errors aren't lost. If fs_file_last_error() has been
used it means that the error has been looked at and there's no need to log
it.

Some of the "expected" errors won't be logged though. This check is done
based on errno. This is also why this commit reorders
fs_file_set_error_async() to set errno=EAGAIN earlier.

5 years agotest-fs-posix: Check for failed fs_read() error string
Timo Sirainen [Sun, 1 Dec 2019 21:07:14 +0000 (23:07 +0200)] 
test-fs-posix: Check for failed fs_read() error string

5 years agolib-fs: Replace fs error with file/iter-specific error
Timo Sirainen [Fri, 29 Nov 2019 15:01:26 +0000 (17:01 +0200)] 
lib-fs: Replace fs error with file/iter-specific error

Removed fs_last_error(), since it can't be used anymore.

5 years agolib-fs: Move file deinit code from fs_file_deinit() to fs_file_free()
Timo Sirainen [Fri, 29 Nov 2019 14:55:42 +0000 (16:55 +0200)] 
lib-fs: Move file deinit code from fs_file_deinit() to fs_file_free()

5 years agolib-fs: Add fs_file_free() to run common deinit code
Timo Sirainen [Fri, 29 Nov 2019 14:53:47 +0000 (16:53 +0200)] 
lib-fs: Add fs_file_free() to run common deinit code

5 years agolib-fs: Change fs_set_error() to take event instead of fs
Timo Sirainen [Fri, 29 Nov 2019 14:25:49 +0000 (16:25 +0200)] 
lib-fs: Change fs_set_error() to take event instead of fs

Also log the error as debug message. This allows capturing the events for
statistics or event exporting.

5 years agolib-fs: Set internal fs/file/iter pointers to events
Timo Sirainen [Fri, 29 Nov 2019 13:30:46 +0000 (15:30 +0200)] 
lib-fs: Set internal fs/file/iter pointers to events

This will be used by the following commit

5 years agolib-fs: Rename fs_set_error_async() to fs_file_set_error_async()
Timo Sirainen [Fri, 29 Nov 2019 14:08:37 +0000 (16:08 +0200)] 
lib-fs: Rename fs_set_error_async() to fs_file_set_error_async()

Also changed to take fs_file instead of fs parameter.

5 years agofs-posix: Change fs_posix_rmdir_parents() to take fs_file instead of fs
Timo Sirainen [Fri, 29 Nov 2019 14:01:40 +0000 (16:01 +0200)] 
fs-posix: Change fs_posix_rmdir_parents() to take fs_file instead of fs

5 years agofs-sis: Don't overwrite error already set by fs_sis_path_parse()
Timo Sirainen [Fri, 29 Nov 2019 13:58:59 +0000 (15:58 +0200)] 
fs-sis: Don't overwrite error already set by fs_sis_path_parse()

5 years agofs-sis: Change some internal functions to take fs_file instead of fs
Timo Sirainen [Fri, 29 Nov 2019 13:56:22 +0000 (15:56 +0200)] 
fs-sis: Change some internal functions to take fs_file instead of fs

5 years agofs-posix: Change fs_posix_get_mode() to take file parameter, not fs
Timo Sirainen [Fri, 29 Nov 2019 13:54:13 +0000 (15:54 +0200)] 
fs-posix: Change fs_posix_get_mode() to take file parameter, not fs

5 years agolib-fs: Remove fs_set_critical()
Timo Sirainen [Mon, 25 Nov 2019 11:20:53 +0000 (13:20 +0200)] 
lib-fs: Remove fs_set_critical()

The original idea was similar to mail_storage_set_error/critical()
separation. But in storage they are used to clearly separate between
errors caused by untrusted users vs internal errors. In lib-fs case
all the errors are internal errors. Also all the lib-fs callers are
supposed to log the errors unless they decide to handle them specially,
so there's really no need a fs_set_critical() that just causes them to
be logged twice.

5 years agofs-posix: Replace fs_set_critical() with e_error()
Timo Sirainen [Mon, 25 Nov 2019 11:19:55 +0000 (13:19 +0200)] 
fs-posix: Replace fs_set_critical() with e_error()

fs_set_error() can't be used in fs_file_close() and fs_file_deinit(),
because they don't return an error.

5 years agofs-posix: Log lseek() error with fs_set_error()
Timo Sirainen [Mon, 25 Nov 2019 11:19:00 +0000 (13:19 +0200)] 
fs-posix: Log lseek() error with fs_set_error()

Makes it consistent with logging the read() error.

5 years agolib-fs: Add error_r parameter to the internal fs.init() method
Timo Sirainen [Mon, 25 Nov 2019 09:43:50 +0000 (11:43 +0200)] 
lib-fs: Add error_r parameter to the internal fs.init() method

This will help removing fs_set_error() calls.

5 years agoglobal: Replace fs_last_error() with fs_file_last_error() wherever possible
Timo Sirainen [Mon, 25 Nov 2019 09:25:37 +0000 (11:25 +0200)] 
global: Replace fs_last_error() with fs_file_last_error() wherever possible

5 years agolib-fs: Free fs_iter in fs_iter_deinit(), not in individual drivers
Timo Sirainen [Thu, 5 Dec 2019 11:41:26 +0000 (13:41 +0200)] 
lib-fs: Free fs_iter in fs_iter_deinit(), not in individual drivers

5 years agolib-fs: Change fs_iter_deinit() API to return error_r string
Timo Sirainen [Mon, 25 Nov 2019 09:13:08 +0000 (11:13 +0200)] 
lib-fs: Change fs_iter_deinit() API to return error_r string