]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
acl: Fix checking whether global acl-file has changed
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 6 Oct 2017 13:44:01 +0000 (16:44 +0300)
committerTimo Sirainen <tss@dovecot.fi>
Fri, 6 Oct 2017 20:46:32 +0000 (23:46 +0300)
We always assumed that it was changed and re-read it.

src/plugins/acl/acl-global-file.c

index 5ba47fc186bf563ee5187860e55af0e68ff5edcf..e956a8cdd830050500e0ad0f2ede6809c95d219f 100644 (file)
@@ -149,6 +149,15 @@ static int acl_global_file_read(struct acl_global_file *file)
                        file->path, i_stream_get_error(input));
                ret = -1;
        }
+       if (ret == 0) {
+               const struct stat *st;
+
+               if (i_stream_stat(input, TRUE, &st) < 0) {
+                       i_error("Couldn't stat global ACL file %s: %s",
+                               file->path, i_stream_get_error(input));
+               }
+               file->prev_st = *st;
+       }
        i_stream_destroy(&input);
 
        /* sort all parsed rights */