# HG changeset patch # User Franz Glasner # Date 1725467382 -7200 # Node ID b7d60802b25f000cb2b6ee4a41585cc52d8d7a54 # Parent e50ea2fd4b6678dd495c529779f23e26422eb863 Use absolute paths for "mount" (all occurrences) and grep (some) diff -r e50ea2fd4b66 -r b7d60802b25f sbin/fzfs --- a/sbin/fzfs Wed Sep 04 11:15:29 2024 +0200 +++ b/sbin/fzfs Wed Sep 04 18:29:42 2024 +0200 @@ -209,7 +209,7 @@ mkdir -p "${_real_mp}" 1> /dev/null 2> /dev/null || \ { echo "ERROR: cannot create mountpoint ${_real_mp}" >&2; _umount_datasets _mounted_datasets || true; return 1; } echo "Mounting ${_name} on ${_real_mp}" - if mount -t zfs "${_name}" "${_real_mp}"; then + if /sbin/mount -t zfs "${_name}" "${_real_mp}"; then array_append _mounted_datasets "${_name}" else if ! checkyes _opt_keep; then @@ -291,13 +291,13 @@ # Just determine whether the given dataset name exists _rootds_mountpoint="$(zfs list -H -o mountpoint -t filesystem "${_dsname}")" || { echo "ERROR: dataset not found" 1>&2; return 1; } - mount -t zfs -p \ - | grep -E "^${_dsname}(/|\s)" \ - | sort -n -r \ + /sbin/mount -t zfs -p \ + | LC_ALL=C GREP_OPTIONS="" /usr/bin/egrep "^${_dsname}(/|\s)" \ + | /usr/bin/sort -n -r \ | { while IFS=' '$'\t' read -r _name _mp _rest ; do echo "Umounting ${_name} on ${_mp}" - umount "${_mp}" || return 1 + /sbin/umount "${_mp}" || return 1 done } return 0 diff -r e50ea2fd4b66 -r b7d60802b25f share/local-bsdtools/common.subr --- a/share/local-bsdtools/common.subr Wed Sep 04 11:15:29 2024 +0200 +++ b/share/local-bsdtools/common.subr Wed Sep 04 18:29:42 2024 +0200 @@ -216,7 +216,7 @@ _mountpoint="$1" - mount -t zfs -p \ + /sbin/mount -t zfs -p \ | { while IFS=' '$'\t' read -r _ds _mount _rest ; do if [ "$_mount" = "$_mountpoint" ]; then @@ -347,7 +347,7 @@ exit 1; ;; esac - _fstab="$(mount -p | awk -v pa1="^${_directory}\$" -v pa2="^${_directory}/" '($2 ~ pa1) || ($2 ~ pa2 ) { print; }' | sort -k3)" + _fstab="$(/sbin/mount -p | awk -v pa1="^${_directory}\$" -v pa2="^${_directory}/" '($2 ~ pa1) || ($2 ~ pa2 ) { print; }' | sort -k3)" echo "${_fstab}" }