From 8db1bd84f12e810a57c1b5ca1f27701bdac43737 Mon Sep 17 00:00:00 2001 From: Ian Kent Date: Tue, 25 Nov 2025 11:18:00 +0800 Subject: [PATCH] - add changes for RHEL-127179. --- ...-special-case-getautomntbyname-error.patch | 49 +++++++++++++++++++ autofs.spec | 14 +++++- 2 files changed, 62 insertions(+), 1 deletion(-) 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..6ae7e6d --- /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.4.orig/CHANGELOG ++++ autofs-5.1.4/CHANGELOG +@@ -166,6 +166,7 @@ + - always recreate credential cache. + - fix always recreate credential cache. + - fix missing unlock in sasl_do_kinit_ext_cc(). ++- handle sss special case getautomntbyname() error. + + xx/xx/2018 autofs-5.1.5 + - fix flag file permission. +--- autofs-5.1.4.orig/modules/lookup_sss.c ++++ autofs-5.1.4/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; diff --git a/autofs.spec b/autofs.spec index 39ad674..2e2d114 100644 --- a/autofs.spec +++ b/autofs.spec @@ -8,7 +8,7 @@ Summary: A tool for automatically mounting and unmounting filesystems Name: autofs Version: 5.1.4 -Release: 114%{?dist}.5 +Release: 114%{?dist}.6 Epoch: 1 License: GPLv2+ Group: System Environment/Daemons @@ -353,6 +353,9 @@ Patch342: autofs-5.1.9-fix-always-recreate-credential-cache.patch # JIRA: RHEL-111930 Patch343: autofs-5.1.8-fix-missing-unlock-in-sasl_do_kinit_ext_cc.patch +# JIRA: RHEL-127179 +Patch344: autofs-5.1.9-handle-sss-special-case-getautomntbyname-error.patch + %if %{with_systemd} BuildRequires: systemd-units BuildRequires: systemd-devel @@ -744,6 +747,8 @@ echo %{version}-%{release} > .version %patch -P 343 -p1 +%patch -P 344 -p1 + %build LDFLAGS=-Wl,-z,now %configure --disable-mount-locking --enable-ignore-busy --with-libtirpc --without-hesiod %{?systemd_configure_arg:} @@ -838,6 +843,13 @@ fi %dir /etc/auto.master.d %changelog +* Tue Nov 25 2025 Ian Kent - 5.1.4-114.el8_10.6 +- RHEL-127179 - sssd autofs fails to get correct EHOSTDOWN if requested + incorrect mount after upgrade to sssd-2.9.1-4.el8_9.5.x86_64 + [rhel-8.10.z] + - handle sss special case getautomntbyname() error. +- Resolves: RHEL-127179 + * Mon Sep 01 2025 Ian Kent - 5.1.4-114.el8_10.5 - RHEL-111930 - automount blocked when attempting to lookup ldap maps - fix missing unlock in sasl_do_kinit_ext_cc().