From 0ff3152c4cdd706b3ce98328e5a6fe7b26f7d9b0 Mon Sep 17 00:00:00 2001 From: Ian Kent Date: Fri, 16 Jun 2023 16:03:11 +0800 Subject: [PATCH] - add fix for bug 2214444. --- ....1.8-fix-some-sss-error-return-cases.patch | 78 +++++++++++++++++++ autofs.spec | 10 ++- 2 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 autofs-5.1.8-fix-some-sss-error-return-cases.patch diff --git a/autofs-5.1.8-fix-some-sss-error-return-cases.patch b/autofs-5.1.8-fix-some-sss-error-return-cases.patch new file mode 100644 index 0000000..5a57f8f --- /dev/null +++ b/autofs-5.1.8-fix-some-sss-error-return-cases.patch @@ -0,0 +1,78 @@ +autofs-5.1.8 - fix some sss error return cases + +From: Ian Kent + +There are some cases where the error return handling isn't quite right, +fix them. + +Also fix a typo. in configuration file comment. + +Signed-off-by: Ian Kent +--- + CHANGELOG | 1 + + modules/lookup_sss.c | 6 +++--- + redhat/autofs.conf.default.in | 2 +- + samples/autofs.conf.default.in | 2 +- + 4 files changed, 6 insertions(+), 5 deletions(-) + +--- autofs-5.1.4.orig/CHANGELOG ++++ autofs-5.1.4/CHANGELOG +@@ -147,6 +147,7 @@ + - add soucre parameter to module functions. + - add ioctlfd open helper. + - make open files limit configurable. ++- fix some sss error return cases. + + 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 +@@ -368,7 +368,7 @@ static int setautomntent_wait(unsigned i + *sss_ctxt = NULL; + } + +- if (proto_version(ctxt) == 0 && retry > retries) ++ if (proto_version(ctxt) == 0 && retry >= retries) + ret = ETIMEDOUT; + } + return ret; +@@ -496,7 +496,7 @@ static int getautomntent_wait(unsigned i + info(logopt, + "successfully contacted sssd to get map entry"); + else { +- if (retry == retries) ++ if (proto_version(ctxt) == 0 && retry >= retries) + ret = ETIMEDOUT; + } + return ret; +@@ -621,7 +621,7 @@ static int getautomntbyname_wait(unsigne + info(logopt, + "successfully contacted sssd to lookup key value"); + else { +- if (proto_version(ctxt) == 0 && retry > retries) ++ if (proto_version(ctxt) == 0 && retry >= retries) + ret = ETIMEDOUT; + } + return ret; +--- autofs-5.1.4.orig/redhat/autofs.conf.default.in ++++ autofs-5.1.4/redhat/autofs.conf.default.in +@@ -209,7 +209,7 @@ mount_nfs_default_protocol = 4 + # sss_master_map_wait - When sssd is starting up it can sometimes return + # "no such entry" for a short time until it has read + # in the LDAP map information. Internal default is 0 +-# (don't wait) or 10 if sss supports returning EHSTDOWN. ++# (don't wait) or 10 if sss supports returning EHOSTDOWN. + # If there is a problem with autofs not finding the + # master map at startup (when it should) then try setting + # this to 10 or more. If the sss library supports returning +--- autofs-5.1.4.orig/samples/autofs.conf.default.in ++++ autofs-5.1.4/samples/autofs.conf.default.in +@@ -208,7 +208,7 @@ browse_mode = no + # sss_master_map_wait - When sssd is starting up it can sometimes return + # "no such entry" for a short time until it has read + # in the LDAP map information. Internal default is 0 +-# (don't wait) or 10 if sss supports returning EHSTDOWN. ++# (don't wait) or 10 if sss supports returning EHOSTDOWN. + # If there is a problem with autofs not finding the + # master map at startup (when it should) then try setting + # this to 10 or more. If the sss library supports returning diff --git a/autofs.spec b/autofs.spec index b1ee117..be77f72 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: 105%{?dist} +Release: 106%{?dist} Epoch: 1 License: GPLv2+ Group: System Environment/Daemons @@ -322,6 +322,7 @@ Patch320: autofs-5.1.7-eliminate-some-more-alloca-usage.patch Patch321: autofs-5.1.8-add-soucre-parameter-to-module-functions.patch Patch322: autofs-5.1.8-add-ioctlfd-open-helper.patch Patch323: autofs-5.1.8-make-open-files-limit-configurable.patch +Patch324: autofs-5.1.8-fix-some-sss-error-return-cases.patch %if %{with_systemd} BuildRequires: systemd-units @@ -685,6 +686,7 @@ echo %{version}-%{release} > .version %patch321 -p1 %patch322 -p1 %patch323 -p1 +%patch324 -p1 %build LDFLAGS=-Wl,-z,now @@ -780,6 +782,12 @@ fi %dir /etc/auto.master.d %changelog +* Fri Jun 16 2023 Ian Kent - 5.1.4-106 +- bz2214444 - The sss lookup modules handles error return incorrectly + in some cases + - fix some sss error return cases. +- Resolves: rhbz#2214444 + * Mon Jun 12 2023 Ian Kent - 5.1.4-105 - bz2207801 - amd map format netgoup selector function not working - fix date for revision 104 changelog entry.