[PATCH 06/20] autofs-5.1.4 - fix prefix option handling in expand_entry()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The changes to fix the defaults handling in the amd map parser caused
the prefix option to not be expanded and also to not be propagated to
submounts in some cases.

But the prefix should be expanded in modules/parse_amd.c:expand_entry()
along with the reset of the amd map entry fields.

Just adding this to modules/parse_amd.c:expand_entry() (where it should
be) fixes the amd map entry expansion and also fixes the propagation
of the prefix to submounts.

Signed-off-by: Ian Kent <raven@xxxxxxxxxx>
---
 CHANGELOG           |    1 +
 modules/parse_amd.c |   11 +++++++++++
 2 files changed, 12 insertions(+)

diff --git a/CHANGELOG b/CHANGELOG
index 13f01397..19aec2ae 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -4,6 +4,7 @@ xx/xx/2018 autofs-5.1.5
 - fix use after free in do_master_list_reset().
 - fix deadlock in dumpmaps.
 - dont use array for path when not necessary.
+- fix prefix option handling in expand_entry().
 
 19/12/2017 autofs-5.1.4
 - fix spec file url.
diff --git a/modules/parse_amd.c b/modules/parse_amd.c
index 2cce5417..1a5a2960 100644
--- a/modules/parse_amd.c
+++ b/modules/parse_amd.c
@@ -725,6 +725,17 @@ static struct substvar *expand_entry(struct autofs_point *ap,
 		entry->rhost = host;
 	}
 next:
+	if (entry->pref) {
+		if (expand_selectors(ap, entry->pref, &expand, sv)) {
+			debug(logopt, MODPREFIX
+			      "pref expand(\"%s\") -> %s",
+			      entry->pref, expand);
+			free(entry->pref);
+			entry->pref = expand;
+		}
+		sv = macro_addvar(sv, "pref", 4, entry->pref);
+	}
+
 	if (entry->sublink) {
 		if (expand_selectors(ap, entry->sublink, &expand, sv)) {
 			debug(logopt, MODPREFIX

--
To unsubscribe from this list: send the line "unsubscribe autofs" in



[Index of Archives]     [Linux Filesystem Development]     [Linux Ext4]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux