From: Timo Sirainen Date: Wed, 9 Dec 2015 15:36:49 +0000 (+0200) Subject: acl: Empty lines and comments in dovecot-acl files weren't handled correctly. X-Git-Tag: 2.2.21~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=827b07103c69885bce057a2ad55afaa82900573f;p=thirdparty%2Fdovecot%2Fcore.git acl: Empty lines and comments in dovecot-acl files weren't handled correctly. --- diff --git a/src/plugins/acl/acl-api.c b/src/plugins/acl/acl-api.c index 280ca28805..0122421944 100644 --- a/src/plugins/acl/acl-api.c +++ b/src/plugins/acl/acl-api.c @@ -388,9 +388,6 @@ int acl_rights_parse_line(const char *line, pool_t pool, { const char *id_str, *const *right_names, *error = NULL; - if (*line == '\0' || *line == '#') - return 0; - /* [] [:] */ if (*line == '"') { line++; diff --git a/src/plugins/acl/acl-backend-vfile.c b/src/plugins/acl/acl-backend-vfile.c index b8c4e128e1..5aae34f3db 100644 --- a/src/plugins/acl/acl-backend-vfile.c +++ b/src/plugins/acl/acl-backend-vfile.c @@ -366,8 +366,11 @@ acl_backend_vfile_read(struct acl_object *aclobj, bool global, const char *path, 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 @@ acl_backend_vfile_read(struct acl_object *aclobj, bool global, const char *path, } T_END; if (ret < 0) break; - linenum++; } if (ret < 0) {