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

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