summaryrefslogtreecommitdiffstats
path: root/etc/autofs
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2016-03-14 17:45:39 +0000
committertrasz <trasz@FreeBSD.org>2016-03-14 17:45:39 +0000
commit40281bf8c8df2d1c9f1eae426caf6b0359cafd51 (patch)
treebe91a052c4870440b20bc806bdf174ba4a3b132a /etc/autofs
parent0d936d56361bdcc2139fc4e2e0e9f57ecca8151b (diff)
downloadFreeBSD-src-40281bf8c8df2d1c9f1eae426caf6b0359cafd51.zip
FreeBSD-src-40281bf8c8df2d1c9f1eae426caf6b0359cafd51.tar.gz
Fix autofs handling of filesystem labels containing plus signs and slashes.
MFC after: 1 month Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'etc/autofs')
-rwxr-xr-xetc/autofs/special_media7
1 files changed, 7 insertions, 0 deletions
diff --git a/etc/autofs/special_media b/etc/autofs/special_media
index 2a654b1..32f9478 100755
--- a/etc/autofs/special_media
+++ b/etc/autofs/special_media
@@ -19,6 +19,9 @@ print_available() {
_fstype="${_fstype_and_label%% *}"
if [ "${_fstype}" != "${_fstype_and_label}" ]; then
_label="${_fstype_and_label#* }"
+ # Replace plus signs and slashes with minuses;
+ # leading plus signs have special meaning in maps,
+ _label="$(echo ${_label} | sed 's,[+/],-,g')"
echo "${_label}"
continue
fi
@@ -54,6 +57,10 @@ print_one() {
fi
_label="${_fstype_and_label#* }"
+ # Replace plus signs and slashes with minuses;
+ # leading plus signs have special meaning in maps,
+ # and multi-component keys are just not supported.
+ _label="$(echo ${_label} | sed 's,[+/],-,g')"
if [ "${_label}" != "${_key}" ]; then
# Labels don't match, try another device.
continue
OpenPOWER on IntegriCloud