Blame SOURCES/autofs-5.0.8-fix-master-map-type-check.patch

304803
autofs-5.0.8 - fix master map type check
304803
304803
From: Ian Kent <ikent@redhat.com>
304803
304803
Map type has format <type>[,<format>] but the master map type check
304803
for old style map syntax doesn't allow for <format>.
304803
---
304803
 CHANGELOG       |    1 +
304803
 daemon/lookup.c |   24 ++++++++++++++++--------
304803
 2 files changed, 17 insertions(+), 8 deletions(-)
304803
304803
--- autofs-5.0.7.orig/CHANGELOG
304803
+++ autofs-5.0.7/CHANGELOG
304803
@@ -87,6 +87,7 @@
304803
 - pass map_source as function paramter where possible.
304803
 - check for bind onto self in mount_bind.c.
304803
 - fix symlink expire.
304803
+- fix master map type check.
304803
 
304803
 25/07/2012 autofs-5.0.7
304803
 =======================
304803
--- autofs-5.0.7.orig/daemon/lookup.c
304803
+++ autofs-5.0.7/daemon/lookup.c
304803
@@ -171,14 +171,22 @@ int lookup_nss_read_master(struct master
304803
 			char source[10];
304803
 
304803
 			memset(source, 0, 10);
304803
-			if (!strncmp(name, "file:", 5) ||
304803
-			    !strncmp(name, "yp:", 3) ||
304803
-			    !strncmp(name, "nis:", 4) ||
304803
-			    !strncmp(name, "nisplus:", 8) ||
304803
-			    !strncmp(name, "ldap:", 5) ||
304803
-			    !strncmp(name, "ldaps:", 6) ||
304803
-			    !strncmp(name, "sss:", 4) ||
304803
-			    !strncmp(name, "dir:", 4)) {
304803
+			if ((!strncmp(name, "file", 4) &&
304803
+				 (name[4] == ',' || name[4] == ':')) ||
304803
+			    (!strncmp(name, "yp", 3) &&
304803
+				 (name[3] == ',' || name[3] == ':')) ||
304803
+			    (!strncmp(name, "nis", 3) &&
304803
+				 (name[3] == ',' || name[3] == ':')) ||
304803
+			    (!strncmp(name, "nisplus", 7) &&
304803
+				 (name[7] == ',' || name[7] == ':')) ||
304803
+			    (!strncmp(name, "ldap", 4) &&
304803
+				 (name[4] == ',' || name[4] == ':')) ||
304803
+			    (!strncmp(name, "ldaps", 5) &&
304803
+				 (name[5] == ',' || name[5] == ':')) ||
304803
+			    (!strncmp(name, "sss", 3) ||
304803
+				 (name[3] == ',' || name[3] == ':')) ||
304803
+			    (!strncmp(name, "dir", 3) &&
304803
+				 (name[3] == ',' || name[3] == ':'))) {
304803
 				strncpy(source, name, tmp - name);
304803
 
304803
 				/*