autofs-5.1.1 - fix yp map age not updated during map lookup From: Jeff Mahoney 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. Signed-off-by: Jeff Mahoney Signed-off-by: Ian Kent --- CHANGELOG | 1 + modules/lookup_yp.c | 17 ++++++++--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index f8ec2f8..2fdb0f2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -51,6 +51,7 @@ - add autofs(5) note of IPv6 libtirpc requirement. - add remote-fs.target systemd dependency. - fix typo in autofs.conf. +- fix yp map age not updated during map lookup. 21/04/2015 autofs-5.1.1 ======================= 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;