Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 130701790bf2d95e902edf16031ff596 > files > 286

autofs-5.0.1-0.rc2.164.el5_8.src.rpm

autofs-5.0.6 - fix improve mount location error reporting

From: Ian Kent <raven@themaw.net>

The validate_location() function is meant to check for a small subset
of map location errors only but the "improve mount location error
reporting" patch inverted a logic test which has made the scope of
the test greater causing false positive fails. So add a check for
those special cases and return success instead.
---

 modules/parse_sun.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)


--- autofs-5.0.1.orig/modules/parse_sun.c
+++ autofs-5.0.1/modules/parse_sun.c
@@ -862,6 +862,20 @@ static int validate_location(unsigned in
 	 * "@" and ":" in the host name part.
 	 */
 	if (!check_colon(ptr)) {
+		char *esc;
+		/*
+		 * Don't forget cases where a colon is present but
+		 * not followed by a "/" or, if there is no colon at
+		 * all, we don't know if it is actually invalid since
+		 * it may be a map name by itself, for example.
+		 */
+		if (!strchr(ptr, ':') ||
+		    ((esc = strchr(ptr, '\\')) && *(esc + 1) == ':') ||
+		    !strncmp(ptr, "file:", 5) || !strncmp(ptr, "yp:", 3) ||
+		    !strncmp(ptr, "nis:", 4) || !strncmp(ptr, "nisplus:", 8) ||
+		    !strncmp(ptr, "ldap:", 5) || !strncmp(ptr, "ldaps:", 6) ||
+		    !strncmp(ptr, "dir:", 4))
+			return 1;
 		error(logopt,
 		      "expected colon delimeter not found in location %s",
 		      loc);