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

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