From 0cae9d3d4a4d8f3325761bc69dddfb2e8b6cd8e3 Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Mon, 14 Mar 2016 17:45:39 +0000 Subject: [PATCH] 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(+) diff --git a/etc/autofs/special_media b/etc/autofs/special_media index 2a654b1d5a9..32f947825aa 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