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

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