# HG changeset patch # User Timo Sirainen # Date 1449675409 -7200 # Node ID 452f9b0ea9f48b3985d2d182a5e90bfa0a4c07e7 # Parent 097a0175a5916c9883e2a8c273e12adbe203df08 acl: Empty lines and comments in dovecot-acl files weren't handled correctly. 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; - /* [] [:] */ 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) {