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

304803
autofs-5.1.4 - fix prefix option handling in expand_entry()
304803
304803
From: Ian Kent <raven@themaw.net>
304803
304803
The changes to fix the defaults handling in the amd map parser caused
304803
the prefix option to not be expanded and also to not be propagated to
304803
submounts in some cases.
304803
304803
But the prefix should be expanded in modules/parse_amd.c:expand_entry()
304803
along with the reset of the amd map entry fields.
304803
304803
Just adding this to modules/parse_amd.c:expand_entry() (where it should
304803
be) fixes the amd map entry expansion and also fixes the propagation
304803
of the prefix to submounts.
304803
304803
Signed-off-by: Ian Kent <raven@themaw.net>
304803
---
304803
 CHANGELOG           |    1 +
304803
 modules/parse_amd.c |   11 +++++++++++
304803
 2 files changed, 12 insertions(+)
304803
304803
--- autofs-5.0.7.orig/CHANGELOG
304803
+++ autofs-5.0.7/CHANGELOG
304803
@@ -292,6 +292,7 @@
304803
 - fix use after free in do_master_list_reset().
304803
 - fix deadlock in dumpmaps.
304803
 - dont use array for path when not necessary.
304803
+- fix prefix option handling in expand_entry().
304803
 
304803
 25/07/2012 autofs-5.0.7
304803
 =======================
304803
--- autofs-5.0.7.orig/modules/parse_amd.c
304803
+++ autofs-5.0.7/modules/parse_amd.c
304803
@@ -727,6 +727,17 @@ static struct substvar *expand_entry(str
304803
 		entry->rhost = host;
304803
 	}
304803
 next:
304803
+	if (entry->pref) {
304803
+		if (expand_selectors(ap, entry->pref, &expand, sv)) {
304803
+			debug(logopt, MODPREFIX
304803
+			      "pref expand(\"%s\") -> %s",
304803
+			      entry->pref, expand);
304803
+			free(entry->pref);
304803
+			entry->pref = expand;
304803
+		}
304803
+		sv = macro_addvar(sv, "pref", 4, entry->pref);
304803
+	}
304803
+
304803
 	if (entry->sublink) {
304803
 		if (expand_selectors(ap, entry->sublink, &expand, sv)) {
304803
 			debug(logopt, MODPREFIX