From d5cd0078433db42bfbd6da1538fb6eca345c19f5 Mon Sep 17 00:00:00 2001 From: Ian Kent Date: Fri, 14 Mar 2025 11:39:07 +0800 Subject: [PATCH] - Add fix for JIRA RHEL-32684. --- ...-special-case-getautomntbyname-error.patch | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 autofs-5.1.9-handle-sss-special-case-getautomntbyname-error.patch diff --git a/autofs-5.1.9-handle-sss-special-case-getautomntbyname-error.patch b/autofs-5.1.9-handle-sss-special-case-getautomntbyname-error.patch new file mode 100644 index 0000000..e2098c7 --- /dev/null +++ b/autofs-5.1.9-handle-sss-special-case-getautomntbyname-error.patch @@ -0,0 +1,49 @@ +autofs-5.1.9 - handle sss special case getautomntbyname() error + +From: Ian Kent + +The sss key lookup (via getautomntbyname()) returns EHOSTDOWN when the +entry is invalid, such as when the location is empty. But setatomntent() +has already been called successfully so we know the host is up and the +map exists hence this probably should be EINVAL. + +In both these cases the better return is NSS_STATUS_UNAVAIL. + +Signed-off-by: Ian Kent +--- + CHANGELOG | 1 + + modules/lookup_sss.c | 6 +++--- + 2 files changed, 4 insertions(+), 3 deletions(-) + +--- autofs-5.1.7.orig/CHANGELOG ++++ autofs-5.1.7/CHANGELOG +@@ -179,6 +179,7 @@ + - update per-mount expire timeout on readmap. + - clear per-mount timeout if not set. + - fix deadlock in master_notify_submount(). ++- handle sss special case getautomntbyname() error. + + 25/01/2021 autofs-5.1.7 + - make bind mounts propagation slave by default. +--- autofs-5.1.7.orig/modules/lookup_sss.c ++++ autofs-5.1.7/modules/lookup_sss.c +@@ -658,8 +658,8 @@ static int getautomntbyname(unsigned int + err = NSS_STATUS_NOTFOUND; + goto free; + } +- if (ret != EHOSTDOWN) +- goto error; ++ if (ret == EINVAL || ret == EHOSTDOWN) ++ goto free; + } + + ret = getautomntbyname_wait(logopt, ctxt, +@@ -670,7 +670,7 @@ static int getautomntbyname(unsigned int + if (ret == ETIMEDOUT) + goto error; + /* sss proto version 0 and sss timeout not set */ +- if (ret == EINVAL) ++ if (ret == EINVAL || ret == EHOSTDOWN) + goto free; + if (ret == ENOENT) { + err = NSS_STATUS_NOTFOUND;