From 985ef12d2155d66ed8e0689d2ae6ea66ab176a04 Mon Sep 17 00:00:00 2001 From: Ian Kent Date: Mon, 16 Oct 2023 10:39:16 +0800 Subject: [PATCH] - add fix for bug RHEL-7997. --- autofs-5.1.8-fix-multi-mount-check.patch | 44 ++++++++++++++++++++++++ autofs.spec | 10 +++++- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 autofs-5.1.8-fix-multi-mount-check.patch diff --git a/autofs-5.1.8-fix-multi-mount-check.patch b/autofs-5.1.8-fix-multi-mount-check.patch new file mode 100644 index 0000000..af5508f --- /dev/null +++ b/autofs-5.1.8-fix-multi-mount-check.patch @@ -0,0 +1,44 @@ +autofs-5.1.8 - fix multi-mount check + +From: Ian Kent + +When checking if a mount location is a multi-mount after the first location +the next '-' or '/' indicates it's a multi-mount. + +But the '-' can be part of a mount location and can follow a space leading +to incorrectly deciding the location is a multi-mount. + +Signed-off-by: Ian Kent +--- + CHANGELOG | 1 + + modules/parse_sun.c | 9 ++++++++- + 2 files changed, 9 insertions(+), 1 deletion(-) + +--- autofs-5.1.4.orig/CHANGELOG ++++ autofs-5.1.4/CHANGELOG +@@ -151,6 +151,7 @@ + - fix incorrect matching of cached wildcard key. + - fix expire retry looping. + - allow -null map in indirect maps. ++- fix multi-mount check. + + xx/xx/2018 autofs-5.1.5 + - fix flag file permission. +--- autofs-5.1.4.orig/modules/parse_sun.c ++++ autofs-5.1.4/modules/parse_sun.c +@@ -786,7 +786,14 @@ static int check_is_multi(const char *ma + if (not_first_chunk) { + if (*p == '"') + p++; +- if (*p == '/' || *p == '-') { ++ /* ++ * Although an options string here would mean ++ * we have a multi-mount we can't rely on it ++ * since it's also valid in a mount location. ++ */ ++ if (*p == '-') ++ p++; ++ if (*p == '/') { + multi = 1; + break; + } diff --git a/autofs.spec b/autofs.spec index a643346..435b911 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: 111%{?dist} +Release: 112%{?dist} Epoch: 1 License: GPLv2+ Group: System Environment/Daemons @@ -327,6 +327,7 @@ Patch325: autofs-5.1.8-fix-incorrect-matching-of-cached-wildcard-key.patch Patch326: autofs-5.1.8-fix-expire-retry-looping.patch Patch327: autofs-5.1.8-allow-null-map-in-indirect-maps.patch +Patch328: autofs-5.1.8-fix-multi-mount-check.patch %if %{with_systemd} BuildRequires: systemd-units @@ -695,6 +696,7 @@ echo %{version}-%{release} > .version %patch326 -p1 %patch327 -p1 +%patch328 -p1 %build LDFLAGS=-Wl,-z,now @@ -790,6 +792,12 @@ fi %dir /etc/auto.master.d %changelog +* Mon Sep 18 2023 Ian Kent - 5.1.4-112 +- RHEL-7997 - multi mount detection fails for share with blank+dash + causing SEGV crash + -fix multi-mount check. +-Resolves: RHEL-7997 + * Mon Sep 18 2023 Ian Kent - 5.1.4-111 - RHEL-12369 - autofs attempts to mount nonexistant ".hidden" filesystems - update patch "allow -null map in indirect maps".