autofs-5.1.2 - fix work around sss startup delay

From: Ian Kent <raven@themaw.net>

If a sss startup delay has been configured to non-zero autofs will
wait up to the configured time and return NSS_STATUS_UNAVAIL or
NSS_STATUS_NOTFOUND even if setautomntent_wait() returns success.

Signed-off-by: Ian Kent <raven@themaw.net>
---
 CHANGELOG            |    1 +
 modules/lookup_sss.c |    8 +++++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 2dceb69..7700a20 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -56,6 +56,7 @@ xx/xx/2016 autofs-5.1.3
 - add config option to use mount request log id.
 - use autofs_point to store expire timeout where possibe.
 - fix possible NULL derefernce.
+- fix work around sss startup delay.
 
 15/06/2016 autofs-5.1.2
 =======================
diff --git a/modules/lookup_sss.c b/modules/lookup_sss.c
index 6d924cf..15a5ca4 100644
--- a/modules/lookup_sss.c
+++ b/modules/lookup_sss.c
@@ -309,9 +309,11 @@ int lookup_read_master(struct master *master, time_t age, void *context)
 		ret = setautomntent_wait(logopt,
 					 ctxt, ctxt->mapname, &sss_ctxt,
 					 retries);
-		if (ret == ENOENT)
-			return NSS_STATUS_NOTFOUND;
-		return NSS_STATUS_UNAVAIL;
+		if (ret) {
+			if (ret == ENOENT)
+				return NSS_STATUS_NOTFOUND;
+			return NSS_STATUS_UNAVAIL;
+		}
 	}
 
 	count = 0;