Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Mar 2016 17:45:39 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r296866 - head/etc/autofs
Message-ID:  <201603141745.u2EHjd2B069619@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Mon Mar 14 17:45:39 2016
New Revision: 296866
URL: https://svnweb.freebsd.org/changeset/base/296866

Log:
  Fix autofs handling of filesystem labels containing plus signs and slashes.
  
  MFC after:	1 month
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/etc/autofs/special_media

Modified: head/etc/autofs/special_media
==============================================================================
--- head/etc/autofs/special_media	Mon Mar 14 17:41:17 2016	(r296865)
+++ head/etc/autofs/special_media	Mon Mar 14 17:45:39 2016	(r296866)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201603141745.u2EHjd2B069619>