From 804b6307ac839eb56cd53f6deab32322a52a21b7 Mon Sep 17 00:00:00 2001 From: Stephan Bosch <stephan.bosch@open-xchange.com> Date: Sat, 26 Oct 2024 23:15:59 +0200 Subject: [PATCH] lib-sieve: storage: file: sieve-file-script - Only compare scripts using stat info when scripts are open --- src/lib-sieve/storage/file/sieve-file-script.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lib-sieve/storage/file/sieve-file-script.c b/src/lib-sieve/storage/file/sieve-file-script.c index 49d55ccbb..fdb16746f 100644 --- a/src/lib-sieve/storage/file/sieve-file-script.c +++ b/src/lib-sieve/storage/file/sieve-file-script.c @@ -816,6 +816,17 @@ sieve_file_script_equals(const struct sieve_script *script, struct sieve_file_script *fscript = (struct sieve_file_script *)script; struct sieve_file_script *fother = (struct sieve_file_script *)other; + if (!script->open || !other->open) { + struct sieve_storage *storage = script->storage; + struct sieve_storage *sother = other->storage; + + if (strcmp(storage->location, sother->location) != 0) + return FALSE; + + i_assert(script->name != NULL && other->name != NULL); + return (strcmp(script->name, other->name) == 0); + } + return (CMP_DEV_T(fscript->st.st_dev, fother->st.st_dev) && fscript->st.st_ino == fother->st.st_ino); } -- GitLab