]> dgit.raspbian.org Git - dovecot.git/commitdiff
[PATCH] lib-sieve: sieve-storage - Add is_personal bit
authorStephan Bosch <stephan.bosch@open-xchange.com>
Tue, 25 Nov 2025 04:07:16 +0000 (05:07 +0100)
committerNoah Meyerhans <noahm@debian.org>
Wed, 16 Sep 2026 19:06:35 +0000 (15:06 -0400)
Simpler than evaluating the type and personal storage is created only through
sieve_storage_create_personal(). This mimics the bit for default storage.

Gbp-Pq: Name 0001-lib-sieve-sieve-storage-Add-is_personal-bit.patch

pigeonhole/src/lib-sieve/sieve-storage-private.h
pigeonhole/src/lib-sieve/sieve-storage.c
pigeonhole/src/lib-sieve/storage/file/sieve-file-storage.c

index 32ad37d9f2dee67a78c48f3655424344e3cbf49b..1bccdcab8171a59ca00999b0b7e24647922cfb18 100644 (file)
@@ -121,6 +121,7 @@ struct sieve_storage {
        enum sieve_storage_flags flags;
 
        bool allows_synchronization:1;
+       bool is_personal:1;
        bool is_default:1;
 };
 
index e68fe39f516fb98e7a593b885f8a4ef088cc93e7..455dcffba42de59104547444e615ce03eea0b8ee 100644 (file)
@@ -773,6 +773,7 @@ int sieve_storage_create_personal(struct sieve_instance *svinst,
                                        &storage, error_code_r, NULL);
        if (ret == 0) {
                (void)sieve_storage_sync_init(storage, user);
+               storage->is_personal = TRUE;
        } else if (*error_code_r != SIEVE_ERROR_TEMP_FAILURE &&
                   (flags & SIEVE_STORAGE_FLAG_SYNCHRONIZING) == 0 &&
                   (flags & SIEVE_STORAGE_FLAG_READWRITE) == 0) {
@@ -1017,7 +1018,7 @@ sieve_storage_get_default_script(struct sieve_storage *storage,
 
        if (*error_code_r != SIEVE_ERROR_NOT_FOUND ||
            (storage->flags & SIEVE_STORAGE_FLAG_SYNCHRONIZING) != 0 ||
-           !sieve_storage_is_personal(storage))
+           !storage->is_personal)
                return -1;
 
        /* Not found; if this name maps to the default script,
index 8f891458521b1c966a6067cf46fe60c7c45c0cac..75d62cb4dd3bd3d476ffc5e864e4ad4d28a6a9a0 100644 (file)
@@ -459,11 +459,9 @@ sieve_file_storage_init_from_settings(
 
        /* Stat storage directory */
 
-       bool is_personal = sieve_storage_is_personal(storage);
-
        if (storage_path != NULL && *storage_path != '\0') {
                if (sieve_file_storage_stat(fstorage, storage_path) < 0) {
-                       if (!is_personal ||
+                       if (!storage->is_personal ||
                            storage->error_code != SIEVE_ERROR_NOT_FOUND)
                                return -1;
                        if ((storage->flags & SIEVE_STORAGE_FLAG_READWRITE) == 0) {
@@ -511,7 +509,7 @@ sieve_file_storage_init_from_settings(
        }
 
        if ((active_path == NULL || *active_path == '\0') &&
-           (is_personal ||
+           (storage->is_personal ||
             (storage->flags & SIEVE_STORAGE_FLAG_READWRITE) != 0)) {
                e_debug(storage->event,
                        "Active script path is unconfigured; "