Mercurial > dovecot > core-2.2
changeset 19500:452f9b0ea9f4
acl: Empty lines and comments in dovecot-acl files weren't handled correctly.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 09 Dec 2015 17:36:49 +0200 |
parents | 097a0175a591 |
children | 42b5cde2d560 |
files | src/plugins/acl/acl-api.c src/plugins/acl/acl-backend-vfile.c |
diffstat | 2 files changed, 4 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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++;
--- 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) {