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

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