From 6fee958d289745f0f52dcc0df16858cf7e093d5c Mon Sep 17 00:00:00 2001 From: trasz Date: Wed, 23 Mar 2016 12:13:53 +0000 Subject: Make the autofs(5) -hosts map more robust, primarily to make it correctly handle NFS shares containing whitespace. This also adds the -E parameter to showmount(8). Reviewed by: emaste@, jhibbits@, wblock@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5649 --- etc/autofs/special_hosts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'etc/autofs') diff --git a/etc/autofs/special_hosts b/etc/autofs/special_hosts index f81449d..c498546 100644 --- a/etc/autofs/special_hosts +++ b/etc/autofs/special_hosts @@ -10,8 +10,8 @@ if [ $# -eq 0 ]; then exit 0 fi -out=`showmount -e "$1"` +out=`showmount -E "$1"` [ $? -eq 0 ] || exit 1 echo "$out" | awk -v host="$1" \ - 'NR > 1 { printf "%s\t%s:%s ", $1, host, $1 } END { printf "\n" }' + '{ printf "\"%s\"\t\"%s:%s\" ", $0, host, $0 } END { printf "\n" }' -- cgit v1.1