changeset 22580:b88a68d75655

acl: Fix checking whether global acl-file has changed We always assumed that it was changed and re-read it.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Fri, 06 Oct 2017 16:44:01 +0300
parents 38950f24f3d5
children 55a7f5a381cd
files src/plugins/acl/acl-global-file.c
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/acl/acl-global-file.c	Fri Oct 06 16:30:11 2017 +0300
+++ b/src/plugins/acl/acl-global-file.c	Fri Oct 06 16:44:01 2017 +0300
@@ -149,6 +149,15 @@
 			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 */