Blob Blame History Raw
autofs-5.1.4 - fix amd parser opts option handling

From: Ian Kent <raven@themaw.net>

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 <raven@themaw.net>
---
 CHANGELOG           |    1 +
 modules/amd_parse.y |    4 ++--
 modules/parse_amd.c |    4 +++-
 3 files changed, 6 insertions(+), 3 deletions(-)

--- autofs-5.0.7.orig/CHANGELOG
+++ autofs-5.0.7/CHANGELOG
@@ -309,6 +309,7 @@
 - add version parameter to rpc_ping().
 - set bind mount as propagation slave.
 - add master map pseudo options for mount propagation.
+- fix amd parser opts option handling.
 
 25/07/2012 autofs-5.0.7
 =======================
--- autofs-5.0.7.orig/modules/amd_parse.y
+++ autofs-5.0.7/modules/amd_parse.y
@@ -401,7 +401,7 @@ option_assignment: MAP_OPTION OPTION_ASS
 	}
 	| 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_ASS
 	}
 	| 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;
 		}
--- autofs-5.0.7.orig/modules/parse_amd.c
+++ autofs-5.0.7/modules/parse_amd.c
@@ -2117,6 +2117,7 @@ int parse_mount(struct autofs_point *ap,
 			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;
@@ -2155,8 +2156,9 @@ int parse_mount(struct autofs_point *ap,
 
 		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);