Blame SOURCES/autofs-5.1.4-fix-prefix-option-handling-in-expand_entry.patch

135b98
autofs-5.1.4 - fix prefix option handling in expand_entry()
135b98
135b98
From: Ian Kent <raven@themaw.net>
135b98
135b98
The changes to fix the defaults handling in the amd map parser caused
135b98
the prefix option to not be expanded and also to not be propagated to
135b98
submounts in some cases.
135b98
135b98
But the prefix should be expanded in modules/parse_amd.c:expand_entry()
135b98
along with the reset of the amd map entry fields.
135b98
135b98
Just adding this to modules/parse_amd.c:expand_entry() (where it should
135b98
be) fixes the amd map entry expansion and also fixes the propagation
135b98
of the prefix to submounts.
135b98
135b98
Signed-off-by: Ian Kent <raven@themaw.net>
135b98
---
135b98
 CHANGELOG           |    1 +
135b98
 modules/parse_amd.c |   11 +++++++++++
135b98
 2 files changed, 12 insertions(+)
135b98
135b98
diff --git a/CHANGELOG b/CHANGELOG
135b98
index 13f01397..19aec2ae 100644
135b98
--- a/CHANGELOG
135b98
+++ b/CHANGELOG
135b98
@@ -4,6 +4,7 @@ xx/xx/2018 autofs-5.1.5
135b98
 - fix use after free in do_master_list_reset().
135b98
 - fix deadlock in dumpmaps.
135b98
 - dont use array for path when not necessary.
135b98
+- fix prefix option handling in expand_entry().
135b98
 
135b98
 19/12/2017 autofs-5.1.4
135b98
 - fix spec file url.
135b98
diff --git a/modules/parse_amd.c b/modules/parse_amd.c
135b98
index 2cce5417..1a5a2960 100644
135b98
--- a/modules/parse_amd.c
135b98
+++ b/modules/parse_amd.c
135b98
@@ -725,6 +725,17 @@ static struct substvar *expand_entry(struct autofs_point *ap,
135b98
 		entry->rhost = host;
135b98
 	}
135b98
 next:
135b98
+	if (entry->pref) {
135b98
+		if (expand_selectors(ap, entry->pref, &expand, sv)) {
135b98
+			debug(logopt, MODPREFIX
135b98
+			      "pref expand(\"%s\") -> %s",
135b98
+			      entry->pref, expand);
135b98
+			free(entry->pref);
135b98
+			entry->pref = expand;
135b98
+		}
135b98
+		sv = macro_addvar(sv, "pref", 4, entry->pref);
135b98
+	}
135b98
+
135b98
 	if (entry->sublink) {
135b98
 		if (expand_selectors(ap, entry->sublink, &expand, sv)) {
135b98
 			debug(logopt, MODPREFIX