From: Stephan Bosch Date: Wed, 4 Mar 2026 20:53:36 +0000 (+0100) Subject: [PATCH] lib-sieve: sieve-storage - Fix panic caused by flawed detection of personal... X-Git-Tag: archive/raspbian/1%2.4.1+dfsg1-6+rpi1+deb13u7^2~115 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d56d1c4fe3357e09f6bac727472aa2f91ea8797b;p=dovecot.git [PATCH] lib-sieve: sieve-storage - Fix panic caused by flawed detection of personal storage type Recent commit d82c2e624e4a9c364a6fa58fad0938ae5578660c added the is_personal flag, but it is assigned too late. Fix this issue by assigning this flag in the earliest allocation function. This issue commonly surfaces when people forget to set an appropriate type for a script storage definition, in which case the "personal" type is the default. Panic was: Panic: file sieve-file-storage-active.c: line 33 (sieve_file_storage_active_read_link): assertion failed: (fstorage->active_path != NULL) Gbp-Pq: Name 0001-lib-sieve-sieve-storage-Fix-panic-caused-by-flawed-d.patch --- diff --git a/pigeonhole/src/lib-sieve/sieve-storage.c b/pigeonhole/src/lib-sieve/sieve-storage.c index 455dcff..ef781a1 100644 --- a/pigeonhole/src/lib-sieve/sieve-storage.c +++ b/pigeonhole/src/lib-sieve/sieve-storage.c @@ -232,6 +232,9 @@ sieve_storage_alloc_from_class(struct sieve_instance *svinst, storage->pool, "auto:", storage->type, NULL); } + if (strcasecmp(script_type, SIEVE_STORAGE_TYPE_PERSONAL) == 0) + storage->is_personal = TRUE; + storage->event = event; event_ref(event); @@ -772,8 +775,8 @@ int sieve_storage_create_personal(struct sieve_instance *svinst, SIEVE_STORAGE_TYPE_PERSONAL, flags, &storage, error_code_r, NULL); if (ret == 0) { + i_assert(storage->is_personal); (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) { @@ -1894,7 +1897,7 @@ bool sieve_storage_is_default(const struct sieve_storage *storage) bool sieve_storage_is_personal(struct sieve_storage *storage) { - return (strcasecmp(storage->type, SIEVE_STORAGE_TYPE_PERSONAL) == 0); + return storage->is_personal; } /*