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

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