aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Kent <raven@themaw.net>2023-08-29 12:48:31 +0800
committerIan Kent <raven@themaw.net>2023-11-02 08:29:41 +0800
commit5dfce3bb360a638f6045f950781a69ff98c5f119 (patch)
tree3b69c99813a0c6e33d15762336484db9c72e871e
parent11dc9abdbd91f83c5c098c20e416147c44a2c95e (diff)
downloadautofs-5dfce3bb360a638f6045f950781a69ff98c5f119.tar.gz
autofs-5.1.8 - fix multi-mount check
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 <raven@themaw.net>
-rw-r--r--CHANGELOG1
-rw-r--r--modules/parse_sun.c9
2 files changed, 9 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG
index a0f4b526..52943569 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -96,6 +96,7 @@
- fix incorrect matching of cached wildcard key.
- fix expire retry looping.
- allow -null map in indirect maps.
+- fix multi-mount check.
19/10/2021 autofs-5.1.8
- add xdr_exports().
diff --git a/modules/parse_sun.c b/modules/parse_sun.c
index cb3e22a0..a5351fd0 100644
--- a/modules/parse_sun.c
+++ b/modules/parse_sun.c
@@ -787,7 +787,14 @@ static int check_is_multi(const char *mapent)
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;
}