Blame SOURCES/autofs-5.0.8-fix-fix-map-source-with-type-lookup.patch

304803
autofs-5.0.8 - fix fix map source with type lookup
304803
304803
From: Ian Kent <raven@themaw.net>
304803
304803
The recent change to make autofs look in the defined map directory
304803
for map source file (or nss source files) when the map doesn't start
304803
with a "/" broke the internal hosts map (thanks for alerting me to
304803
this Leonardo).
304803
---
304803
 CHANGELOG       |    1 +
304803
 daemon/lookup.c |   10 ++++++++--
304803
 2 files changed, 9 insertions(+), 2 deletions(-)
304803
304803
--- autofs-5.0.7.orig/CHANGELOG
304803
+++ autofs-5.0.7/CHANGELOG
304803
@@ -95,6 +95,7 @@
304803
 - fix external env configure.
304803
 - make autofs(5) consistent with auto.master(5).
304803
 - fix map source with type lookup.
304803
+- fix fix map source with type lookup.
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
@@ -418,8 +418,11 @@ static int lookup_map_read_map(struct au
304803
 {
304803
 	char *path;
304803
 
304803
-	if (!map->argv[0])
304803
+	if (!map->argv[0]) {
304803
+		if (!strcmp(map->type, "hosts"))
304803
+			return do_read_map(ap, map, age);
304803
 		return NSS_STATUS_UNKNOWN;
304803
+	}
304803
 
304803
 	/*
304803
 	 * This is only called when map->type != NULL.
304803
@@ -817,8 +820,11 @@ static int do_name_lookup_mount(struct a
304803
 {
304803
 	char *path;
304803
 
304803
-	if (!map->argv[0])
304803
+	if (!map->argv[0]) {
304803
+		if (!strcmp(map->type, "hosts"))
304803
+			return do_lookup_mount(ap, map, name, name_len);
304803
 		return NSS_STATUS_UNKNOWN;
304803
+	}
304803
 
304803
 	/*
304803
 	 * This is only called when map->type != NULL.