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

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