Blame SOURCES/autofs-5.1.4-fix-amd-parser-opts-option-handling.patch

d5dcad
autofs-5.1.4 - fix amd parser opts option handling
d5dcad
d5dcad
From: Ian Kent <raven@themaw.net>
d5dcad
d5dcad
The recent implementation of the amd map program mount feature
d5dcad
introduced a regression in the amd parser where only the first
d5dcad
option of a comma separated list of is applied to a mount entry.
d5dcad
d5dcad
Signed-off-by: Ian Kent <raven@themaw.net>
d5dcad
---
d5dcad
 CHANGELOG           |    1 +
d5dcad
 modules/amd_parse.y |    4 ++--
d5dcad
 modules/parse_amd.c |    4 +++-
d5dcad
 3 files changed, 6 insertions(+), 3 deletions(-)
d5dcad
d5dcad
--- autofs-5.1.4.orig/CHANGELOG
d5dcad
+++ autofs-5.1.4/CHANGELOG
d5dcad
@@ -35,6 +35,7 @@ xx/xx/2018 autofs-5.1.5
d5dcad
 - fix age setting at startup.
d5dcad
 - fix use after free in parse_ldap_config().
d5dcad
 - fix incorrect locking in sss lookup.
d5dcad
+- fix amd parser opts option handling.
d5dcad
 
d5dcad
 19/12/2017 autofs-5.1.4
d5dcad
 - fix spec file url.
d5dcad
--- autofs-5.1.4.orig/modules/amd_parse.y
d5dcad
+++ autofs-5.1.4/modules/amd_parse.y
d5dcad
@@ -401,7 +401,7 @@ option_assignment: MAP_OPTION OPTION_ASS
d5dcad
 	}
d5dcad
 	| MNT_OPTION OPTION_ASSIGN options
d5dcad
 	{
d5dcad
-		if (!match_mnt_option_options($1, $3)) {
d5dcad
+		if (!match_mnt_option_options($1, opts)) {
d5dcad
 			amd_notify($1);
d5dcad
 			YYABORT;
d5dcad
 		}
d5dcad
@@ -409,7 +409,7 @@ option_assignment: MAP_OPTION OPTION_ASS
d5dcad
 	}
d5dcad
 	| MNT_OPTION OPTION_ASSIGN QUOTE options QUOTE
d5dcad
 	{
d5dcad
-		if (!match_mnt_option_options($1, $4)) {
d5dcad
+		if (!match_mnt_option_options($1, opts)) {
d5dcad
 			amd_notify($1);
d5dcad
 			YYABORT;
d5dcad
 		}
d5dcad
--- autofs-5.1.4.orig/modules/parse_amd.c
d5dcad
+++ autofs-5.1.4/modules/parse_amd.c
d5dcad
@@ -2136,6 +2136,7 @@ int parse_mount(struct autofs_point *ap,
d5dcad
 			list_del_init(&this->list);
d5dcad
 			cur_defaults = this;
d5dcad
 			update_with_defaults(defaults_entry, cur_defaults, sv);
d5dcad
+			debug(ap->logopt, "merged /defaults entry with defaults");
d5dcad
 			continue;
d5dcad
 		} else if (this->flags & AMD_DEFAULTS_RESET) {
d5dcad
 			struct amd_entry *nd, *new;
d5dcad
@@ -2174,8 +2175,9 @@ int parse_mount(struct autofs_point *ap,
d5dcad
 
d5dcad
 		at_least_one = 1;
d5dcad
 
d5dcad
-		debug(ap->logopt, "expand mount entry");
d5dcad
+		debug(ap->logopt, "update mount entry with defaults");
d5dcad
 		update_with_defaults(cur_defaults, this, sv);
d5dcad
+		debug(ap->logopt, "expand mount entry");
d5dcad
 		sv = expand_entry(ap, this, flags, sv);
d5dcad
 		sv = merge_entry_options(ap, this, sv);
d5dcad
 		normalize_sublink(ap->logopt, this, sv);