Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 130701790bf2d95e902edf16031ff596 > files > 48

autofs-5.0.1-0.rc2.164.el5_8.src.rpm

diff --git a/daemon/lookup.c b/daemon/lookup.c
index aded82b..4429edb 100644
--- a/daemon/lookup.c
+++ b/daemon/lookup.c
@@ -423,6 +423,7 @@ int lookup_nss_read_map(struct autofs_point *ap, time_t age)
 	struct nss_source *this;
 	struct map_source *map;
 	enum nsswitch_status status;
+	unsigned int at_least_one = 0;
 	int result = 0;
 
 	/*
@@ -493,9 +494,13 @@ int lookup_nss_read_map(struct autofs_point *ap, time_t age)
 			if (result == NSS_STATUS_UNKNOWN)
 				continue;
 
+			if (result == NSS_STATUS_SUCCESS) {
+				at_least_one = 1;
+				result = NSS_STATUS_TRYAGAIN;
+			}
+
 			status = check_nss_result(this, result);
 			if (status >= 0) {
-				result = !status;
 				map = NULL;
 				break;
 			}
@@ -509,7 +514,10 @@ int lookup_nss_read_map(struct autofs_point *ap, time_t age)
 	}
 	pthread_cleanup_pop(1);
 
-	return !result;
+	if (!result ||  at_least_one)
+		return 1;
+
+	return 0;
 }
 
 int lookup_ghost(struct autofs_point *ap)
diff --git a/modules/lookup_yp.c b/modules/lookup_yp.c
index bc75be0..5f03b2f 100644
--- a/modules/lookup_yp.c
+++ b/modules/lookup_yp.c
@@ -305,7 +305,7 @@ int lookup_read_map(struct autofs_point *ap, time_t age, void *context)
 
 	mapname = alloca(strlen(ctxt->mapname) + 1);
 	if (!mapname)
-		return 0;
+		return NSS_STATUS_UNKNOWN;
 
 	strcpy(mapname, ctxt->mapname);