[PATCH 1/2] autofs: fix yp map age not updated in s/_/./g case

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jeff Mahoney <jeffm@xxxxxxxx>

The map source age field should be updated when we retry
the yp map lookup using dots instead of underscores.

Rather than just open code the exit path, just reverse the logic for
returning success so we only have one success path for both cases.
---
 modules/lookup_yp.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/modules/lookup_yp.c b/modules/lookup_yp.c
index eda2aba..502d850 100644
--- a/modules/lookup_yp.c
+++ b/modules/lookup_yp.c
@@ -431,17 +431,16 @@ int lookup_read_map(struct autofs_point *ap, time_t age, void *context)
 			err = yp_all((char *) ctxt->domainname, mapname, &ypcb);
 		}
 
-		if (err == YPERR_SUCCESS)
-			return NSS_STATUS_SUCCESS;
+		if (err != YPERR_SUCCESS) {
+			warn(ap->logopt,
+			     MODPREFIX "read of map %s failed: %s",
+			     ap->path, yperr_string(err));
 
-		warn(ap->logopt,
-		     MODPREFIX "read of map %s failed: %s",
-		     ap->path, yperr_string(err));
+			if (err == YPERR_PMAP || err == YPERR_YPSERV)
+				return NSS_STATUS_UNAVAIL;
 
-		if (err == YPERR_PMAP || err == YPERR_YPSERV)
-			return NSS_STATUS_UNAVAIL;
-
-		return NSS_STATUS_NOTFOUND;
+			return NSS_STATUS_NOTFOUND;
+		}
 	}
 
 	source->age = age;
-- 
2.7.1

--
To unsubscribe from this list: send the line "unsubscribe autofs" in



[Index of Archives]     [Linux Filesystem Development]     [Linux Ext4]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux