Skip to content
Snippets Groups Projects
Commit ee4c9deb authored by Stephan Bosch's avatar Stephan Bosch Committed by Timo Sirainen
Browse files

lib-sieve: storage: file: sieve-file-storage - Perform write check earlier in...

lib-sieve: storage: file: sieve-file-storage - Perform write check earlier in sieve_file_storage_do_autodetect()
parent ca61ed30
No related branches found
No related tags found
No related merge requests found
...@@ -625,6 +625,16 @@ sieve_file_storage_do_autodetect( ...@@ -625,6 +625,16 @@ sieve_file_storage_do_autodetect(
} }
} }
if ((storage_path == NULL || *storage_path == '\0') &&
(storage->flags & SIEVE_STORAGE_FLAG_READWRITE) != 0) {
sieve_storage_set_critical(storage,
"Could not find storage root directory for write access; "
"path was left unconfigured and autodetection failed");
*error_code_r = storage->error_code;
*error_r = storage->error;
return -1;
}
if (storage_path != NULL && *storage_path != '\0') { if (storage_path != NULL && *storage_path != '\0') {
/* Got something: stat it */ /* Got something: stat it */
if (sieve_file_storage_stat(fstorage, storage_path) < 0) { if (sieve_file_storage_stat(fstorage, storage_path) < 0) {
...@@ -640,16 +650,6 @@ sieve_file_storage_do_autodetect( ...@@ -640,16 +650,6 @@ sieve_file_storage_do_autodetect(
} }
} }
if ((storage_path == NULL || *storage_path == '\0') &&
(storage->flags & SIEVE_STORAGE_FLAG_READWRITE) != 0) {
sieve_storage_set_critical(storage,
"Could not find storage root directory for write access; "
"path was left unconfigured and autodetection failed");
*error_code_r = storage->error_code;
*error_r = storage->error;
return -1;
}
if (active_path == NULL || *active_path == '\0') { if (active_path == NULL || *active_path == '\0') {
if (storage->main_storage || if (storage->main_storage ||
(storage->flags & SIEVE_STORAGE_FLAG_READWRITE) != 0) { (storage->flags & SIEVE_STORAGE_FLAG_READWRITE) != 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.