mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-03 12:35:02 +00:00
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
This commit is contained in:
parent
b89281ab2a
commit
0b1b2722bf
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=297016
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user