From owner-svn-src-head@freebsd.org Fri Mar 18 09:54:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F29CDAD4B59; Fri, 18 Mar 2016 09:54:10 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C42A81808; Fri, 18 Mar 2016 09:54:10 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2I9s9ex081332; Fri, 18 Mar 2016 09:54:09 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2I9s99d081331; Fri, 18 Mar 2016 09:54:09 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201603180954.u2I9s99d081331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 18 Mar 2016 09:54:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297016 - head/etc/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 09:54:11 -0000 Author: trasz Date: Fri Mar 18 09:54:09 2016 New Revision: 297016 URL: https://svnweb.freebsd.org/changeset/base/297016 Log: Add a special case for NTFS to the -media autofs(5) map. Submitted by: lme@ (earlier version) 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 Fri Mar 18 09:17:54 2016 (r297015) +++ head/etc/autofs/special_media Fri Mar 18 09:54:09 2016 (r297016) @@ -32,6 +32,26 @@ print_available() { } # Print a single map entry. +print_map_entry() { + local _fstype _p + + _fstype="$1" + _p="$2" + + if [ "${_fstype}" = "ntfs" ]; then + if [ -f "/usr/local/bin/ntfs-3g" ]; then + echo "-mountprog=/usr/local/bin/ntfs-3g,fstype=${_fstype},nosuid :/dev/${_p}" + else + /usr/bin/logger -p info -t "special_media[$$]" \ + "Cannot mount ${_fstype} formatted device /dev/${_p}: Install sysutils/fusefs-ntfs first" + exit 1 + fi + else + echo "-fstype=${_fstype},nosuid :/dev/${_p}" + fi +} + +# Determine map entry contents for the given key and print out the entry. print_one() { local _fstype _fstype_and_label _label _key _p @@ -39,7 +59,7 @@ print_one() { _fstype="$(fstyp "/dev/${_key}" 2> /dev/null)" if [ $? -eq 0 ]; then - echo "-fstype=${_fstype},nosuid :/dev/${_key}" + print_map_entry "${_fstype}" "${_key}" return fi @@ -67,7 +87,7 @@ print_one() { continue fi - echo "-fstype=${_fstype},nosuid :/dev/${_p}" + print_map_entry "${_fstype}" "${_p}" done # No matching device - don't print anything, autofs will handle it.