autofs-5.1.6 - add sss ECONREFUSED return handling From: Ian Kent The sss library has returned ECONNREFUSED for the case of sssd not running for a long time now but autofs doesn't catch it, fix that. Signed-off-by: Ian Kent --- CHANGELOG | 1 + modules/lookup_sss.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 984c515b..dadc31b7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -22,6 +22,7 @@ xx/xx/2020 autofs-5.1.7 - fix lookup_nss_read_master() nsswicth check return. - fix typo in open_sss_lib(). - fix sss_master_map_wait timing. +- add sss ECONREFUSED return handling. 07/10/2019 autofs-5.1.6 - support strictexpire mount option. diff --git a/modules/lookup_sss.c b/modules/lookup_sss.c index da17df9a..d467e505 100644 --- a/modules/lookup_sss.c +++ b/modules/lookup_sss.c @@ -297,6 +297,9 @@ int lookup_read_master(struct master *master, time_t age, void *context) if (ret) { unsigned int retries; + if (ret == ECONNREFUSED) + return NSS_STATUS_UNKNOWN; + if (ret != ENOENT) return NSS_STATUS_UNAVAIL; @@ -308,6 +311,8 @@ int lookup_read_master(struct master *master, time_t age, void *context) ctxt, ctxt->mapname, &sss_ctxt, retries); if (ret) { + if (ret == ECONNREFUSED) + return NSS_STATUS_UNKNOWN; if (ret == ENOENT) return NSS_STATUS_NOTFOUND; return NSS_STATUS_UNAVAIL; @@ -415,6 +420,8 @@ int lookup_read_map(struct autofs_point *ap, time_t age, void *context) ret = setautomntent(ap->logopt, ctxt, ctxt->mapname, &sss_ctxt); if (ret) { + if (ret == ECONNREFUSED) + return NSS_STATUS_UNKNOWN; if (ret == ENOENT) return NSS_STATUS_NOTFOUND; return NSS_STATUS_UNAVAIL; @@ -525,6 +532,8 @@ static int lookup_one(struct autofs_point *ap, ret = setautomntent(ap->logopt, ctxt, ctxt->mapname, &sss_ctxt); if (ret) { + if (ret == ECONNREFUSED) + return NSS_STATUS_UNKNOWN; if (ret == ENOENT) return NSS_STATUS_NOTFOUND; return NSS_STATUS_UNAVAIL;