Blame SOURCES/autofs-5.1.8-fail-on-empty-replicated-host-name.patch

cd8711
autofs-5.1.8 - fail on empty replicated host name
cd8711
cd8711
From: Ian Kent <raven@themaw.net>
cd8711
cd8711
If a mount location host (or hosts) has an empty host name it has to be
cd8711
a mistake so fail the automount request.
cd8711
cd8711
Signed-off-by: Ian Kent <raven@themaw.net>
cd8711
---
cd8711
 CHANGELOG           |    1 +
cd8711
 modules/parse_sun.c |   18 ++++++++++++++++++
cd8711
 2 files changed, 19 insertions(+)
cd8711
cd8711
--- autofs-5.1.4.orig/CHANGELOG
cd8711
+++ autofs-5.1.4/CHANGELOG
cd8711
@@ -105,6 +105,7 @@
cd8711
 - fix concat_options() error handling.
cd8711
 - fix minus only option handling in concat_options().
cd8711
 - fix incorrect path for is_mounted() in try_remount().
cd8711
+- fail on empty replicated host name.
cd8711
 
cd8711
 xx/xx/2018 autofs-5.1.5
cd8711
 - fix flag file permission.
cd8711
--- autofs-5.1.4.orig/modules/parse_sun.c
cd8711
+++ autofs-5.1.4/modules/parse_sun.c
cd8711
@@ -924,6 +924,12 @@ static int validate_location(unsigned in
cd8711
 	if (*ptr == ':')
cd8711
 		return 1;
cd8711
 
cd8711
+	/* Fail on replicated entry with empty first host name */
cd8711
+	if (*ptr == ',') {
cd8711
+		error(logopt, "missing first host name in location %s", loc);
cd8711
+		return 0;
cd8711
+	}
cd8711
+
cd8711
 	/*
cd8711
 	 * If a ':/' is present now it must be a host name, except
cd8711
 	 * for those special file systems like sshfs which use "#"
cd8711
@@ -960,6 +966,18 @@ static int validate_location(unsigned in
cd8711
 				      "found in location %s", *ptr, loc);
cd8711
 				return 0;
cd8711
 			}
cd8711
+
cd8711
+			/* Fail on replicated entry with empty host name */
cd8711
+			if (*ptr == ',') {
cd8711
+				char next = *(ptr + 1);
cd8711
+
cd8711
+				if (next == ',' || next == ':') {
cd8711
+					error(logopt,
cd8711
+					      "missing host name in location %s", loc);
cd8711
+					return 0;
cd8711
+				}
cd8711
+			}
cd8711
+
cd8711
 			ptr++;
cd8711
 		}
cd8711