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

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