autofs-5.1.4 - fix amd parser opts option handling From: Ian Kent The recent implementation of the amd map program mount feature introduced a regression in the amd parser where only the first option of a comma separated list of is applied to a mount entry. Signed-off-by: Ian Kent --- CHANGELOG | 1 + modules/amd_parse.y | 4 ++-- modules/parse_amd.c | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index aa485e8f..0365a161 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -38,6 +38,7 @@ xx/xx/2018 autofs-5.1.5 - add master map pseudo options for mount propagation. - fix use after free in parse_ldap_config(). - fix incorrect locking in sss lookup. +- fix amd parser opts option handling. 19/12/2017 autofs-5.1.4 - fix spec file url. diff --git a/modules/amd_parse.y b/modules/amd_parse.y index 5bd688d9..be923c2f 100644 --- a/modules/amd_parse.y +++ b/modules/amd_parse.y @@ -401,7 +401,7 @@ option_assignment: MAP_OPTION OPTION_ASSIGN FS_TYPE } | MNT_OPTION OPTION_ASSIGN options { - if (!match_mnt_option_options($1, $3)) { + if (!match_mnt_option_options($1, opts)) { amd_notify($1); YYABORT; } @@ -409,7 +409,7 @@ option_assignment: MAP_OPTION OPTION_ASSIGN FS_TYPE } | MNT_OPTION OPTION_ASSIGN QUOTE options QUOTE { - if (!match_mnt_option_options($1, $4)) { + if (!match_mnt_option_options($1, opts)) { amd_notify($1); YYABORT; } diff --git a/modules/parse_amd.c b/modules/parse_amd.c index ea57270a..627c3c00 100644 --- a/modules/parse_amd.c +++ b/modules/parse_amd.c @@ -2136,6 +2136,7 @@ int parse_mount(struct autofs_point *ap, const char *name, list_del_init(&this->list); cur_defaults = this; update_with_defaults(defaults_entry, cur_defaults, sv); + debug(ap->logopt, "merged /defaults entry with defaults"); continue; } else if (this->flags & AMD_DEFAULTS_RESET) { struct amd_entry *nd, *new; @@ -2174,8 +2175,9 @@ int parse_mount(struct autofs_point *ap, const char *name, at_least_one = 1; - debug(ap->logopt, "expand mount entry"); + debug(ap->logopt, "update mount entry with defaults"); update_with_defaults(cur_defaults, this, sv); + debug(ap->logopt, "expand mount entry"); sv = expand_entry(ap, this, flags, sv); sv = merge_entry_options(ap, this, sv); normalize_sublink(ap->logopt, this, sv);