autofs-5.1.6 - fix retries check in setautomntent_wait()

From: Ian Kent <raven@themaw.net>

In setautomntent_wait() on exit from the retry loop retry will always
be greater than retries if the retry limit is reached.

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

diff --git a/CHANGELOG b/CHANGELOG
index 7190297e..8397ea0a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -25,6 +25,7 @@ xx/xx/2020 autofs-5.1.7
 - add sss ECONREFUSED return handling.
 - use mapname in sss context for setautomntent().
 - add support for new sss autofs proto version call.
+- fix retries check in setautomntent_wait().
 
 07/10/2019 autofs-5.1.6
 - support strictexpire mount option.
diff --git a/modules/lookup_sss.c b/modules/lookup_sss.c
index 193d99b3..f000459d 100644
--- a/modules/lookup_sss.c
+++ b/modules/lookup_sss.c
@@ -299,7 +299,7 @@ static int setautomntent_wait(unsigned int logopt,
 			*sss_ctxt = NULL;
 		}
 
-		if (retry == retries)
+		if (retry > retries)
 			ret = ETIMEDOUT;
 
 		estr = strerror_r(ret, buf, MAX_ERR_BUF);
