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

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