From 40281bf8c8df2d1c9f1eae426caf6b0359cafd51 Mon Sep 17 00:00:00 2001 From: trasz Date: Mon, 14 Mar 2016 17:45:39 +0000 Subject: Fix autofs handling of filesystem labels containing plus signs and slashes. MFC after: 1 month Sponsored by: The FreeBSD Foundation --- etc/autofs/special_media | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'etc/autofs') 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 -- cgit v1.1