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

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