Blob Blame History Raw
autofs-5.1.4 - fix sublink option not set from defaults

From: Ian Kent <raven@themaw.net>

If the amd entry sublink option is given in a defaults entry
it isn't merged into the current entry during parsing.

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

--- autofs-5.1.4.orig/CHANGELOG
+++ autofs-5.1.4/CHANGELOG
@@ -65,6 +65,7 @@
 - fix deadlock in dumpmaps.
 - dont use array for path when not necessary.
 - fix prefix option handling in expand_entry().
+- fix sublink option not set from defaults.
 
 24/05/2017 autofs-5.1.3
 =======================
--- autofs-5.1.4.orig/modules/parse_amd.c
+++ autofs-5.1.4/modules/parse_amd.c
@@ -645,6 +645,18 @@ static void update_with_defaults(struct
 		}
 	}
 
+	if (!entry->sublink) {
+		if (defaults->sublink) {
+			tmp = strdup(defaults->sublink);
+			if (tmp)
+				entry->sublink = tmp;
+		} else {
+			v = macro_findvar(sv, "sublink", 2);
+			if (v)
+				entry->sublink = strdup(v->val);
+		}
+	}
+
 	return;
 }