dovecot-2.2: acl: Empty lines and comments in dovecot-acl files ...
dovecot at dovecot.org
dovecot at dovecot.org
Wed Dec 9 15:37:13 UTC 2015
details: http://hg.dovecot.org/dovecot-2.2/rev/452f9b0ea9f4
changeset: 19500:452f9b0ea9f4
user: Timo Sirainen <tss at iki.fi>
date: Wed Dec 09 17:36:49 2015 +0200
description:
acl: Empty lines and comments in dovecot-acl files weren't handled correctly.
diffstat:
src/plugins/acl/acl-api.c | 3 ---
src/plugins/acl/acl-backend-vfile.c | 6 ++++--
2 files changed, 4 insertions(+), 5 deletions(-)
diffs (37 lines):
diff -r 097a0175a591 -r 452f9b0ea9f4 src/plugins/acl/acl-api.c
--- a/src/plugins/acl/acl-api.c Wed Dec 09 15:31:37 2015 +0200
+++ b/src/plugins/acl/acl-api.c Wed Dec 09 17:36:49 2015 +0200
@@ -388,9 +388,6 @@
{
const char *id_str, *const *right_names, *error = NULL;
- if (*line == '\0' || *line == '#')
- return 0;
-
/* <id> [<imap acls>] [:<named acls>] */
if (*line == '"') {
line++;
diff -r 097a0175a591 -r 452f9b0ea9f4 src/plugins/acl/acl-backend-vfile.c
--- a/src/plugins/acl/acl-backend-vfile.c Wed Dec 09 15:31:37 2015 +0200
+++ b/src/plugins/acl/acl-backend-vfile.c Wed Dec 09 17:36:49 2015 +0200
@@ -366,8 +366,11 @@
input = i_stream_create_fd(fd, (size_t)-1, FALSE);
i_stream_set_return_partial_line(input, TRUE);
- linenum = 1;
+ linenum = 0;
while ((line = i_stream_read_next_line(input)) != NULL) {
+ linenum++;
+ if (line[0] == '\0' || line[0] == '#')
+ continue;
T_BEGIN {
ret = acl_rights_parse_line(line, aclobj->rights_pool,
&rights, &error);
@@ -381,7 +384,6 @@
} T_END;
if (ret < 0)
break;
- linenum++;
}
if (ret < 0) {
More information about the dovecot-cvs
mailing list