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

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