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

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