Blame SOURCES/autofs-5.1.7-check-for-offset-with-no-mount-location.patch

49b67f
autofs-5.1.7 - check for offset with no mount location
49b67f
49b67f
From: Ian Kent <raven@themaw.net>
49b67f
49b67f
Offsets need to have a mount location, check for it.
49b67f
49b67f
Signed-off-by: Ian Kent <raven@themaw.net>
49b67f
---
49b67f
 CHANGELOG           |    1 +
49b67f
 modules/parse_sun.c |   15 ++++++++++++++-
49b67f
 2 files changed, 15 insertions(+), 1 deletion(-)
49b67f
49b67f
--- autofs-5.1.4.orig/CHANGELOG
49b67f
+++ autofs-5.1.4/CHANGELOG
49b67f
@@ -47,6 +47,7 @@
49b67f
 - pass root length to mount_fullpath().
49b67f
 - remove unused function master_submount_list_empty().
49b67f
 - move amd mounts removal into lib/mounts.c.
49b67f
+- check for offset with no mount location.
49b67f
 
49b67f
 xx/xx/2018 autofs-5.1.5
49b67f
 - fix flag file permission.
49b67f
--- autofs-5.1.4.orig/modules/parse_sun.c
49b67f
+++ autofs-5.1.4/modules/parse_sun.c
49b67f
@@ -803,7 +803,20 @@ update_offset_entry(struct autofs_point
49b67f
 
49b67f
 	memset(m_mapent, 0, MAPENT_MAX_LEN + 1);
49b67f
 
49b67f
-	/* Internal hosts map may have loc == NULL */
49b67f
+	if (!loc || !*loc) {
49b67f
+		const char *type = ap->entry->maps->type;
49b67f
+
49b67f
+		/* If it's not the internal hosts map it must have a
49b67f
+		 * mount location.
49b67f
+		 */
49b67f
+		if (!type || strcmp(type, "hosts")) {
49b67f
+			error(ap->logopt,
49b67f
+			      MODPREFIX "syntax error in offset %s -> %s",
49b67f
+			      m_offset, loc);
49b67f
+			return CHE_FAIL;
49b67f
+		}
49b67f
+	}
49b67f
+
49b67f
 	if (!*m_offset) {
49b67f
 		error(ap->logopt,
49b67f
 		      MODPREFIX "syntax error in offset %s -> %s", m_offset, loc);