Mercurial > hgrepos > FreeBSD > ports > sysutils > local-bsdtools
changeset 532:c615279bb797
Call mount and umount with absolute paths
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Thu, 05 Sep 2024 04:05:33 +0200 |
| parents | 07a916bd830c |
| children | 07071afd9ae5 |
| files | sbin/fjail sbin/ftjail |
| diffstat | 2 files changed, 9 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/sbin/fjail Wed Sep 04 22:08:23 2024 +0200 +++ b/sbin/fjail Thu Sep 05 04:05:33 2024 +0200 @@ -404,7 +404,7 @@ else if [ "${_opt_devfs}" = "yes" ]; then echo "Mounting devfs" - mount -t devfs devfs "${_mp}/dev" + /sbin/mount -t devfs devfs "${_mp}/dev" _umount_devfs="yes" else echo "ERROR: a working devfs is needed at \`{_mp}/dev' (use \`-d')" >&2 @@ -500,7 +500,7 @@ if [ "${_umount_devfs}" = "yes" ]; then echo "Unmounting devfs" - umount "${_mp}/dev" + /sbin/umount "${_mp}/dev" fi }
--- a/sbin/ftjail Wed Sep 04 22:08:23 2024 +0200 +++ b/sbin/ftjail Thu Sep 05 04:05:33 2024 +0200 @@ -451,7 +451,7 @@ mkdir -p "${_real_mp}" 1> /dev/null 2> /dev/null || \ { echo "ERROR: cannot create mountpoint ${_real_mp}" 1>&2; return 1; } echo "Mounting ${_name} on ${_real_mp}" - mount -t zfs "${_name}" "${_real_mp}" || return 1 + /sbin/mount -t zfs "${_name}" "${_real_mp}" || return 1 fi fi ;; @@ -537,13 +537,13 @@ _rootds_mountpoint="$(zfs list -H -o mountpoint -t filesystem "${_dsname}")" || \ { echo "ERROR: dataset not found" >&2; return 1; } - mount -t zfs -p \ + /sbin/mount -t zfs -p \ | grep -E "^${_dsname}(/|\s)" \ | 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 } @@ -993,7 +993,7 @@ # Unmount in reverse order: unmount can do it for us echo "Unmounting all datasets mounted at \`${_directory}'" - umount -a -F "${_dir_fn_fstab}" -v + /sbin/umount -a -F "${_dir_fn_fstab}" -v # # XXX TBD: Hooks to create some new top-level dirs (/srv /proc et @@ -1021,7 +1021,7 @@ # echo "Remounting only the root dataset at \`${_directory}'" [ ! -d "${_directory}" ] && mkdir "${_directory}" - mount -t zfs "${_root_dataset}" "${_directory}" + /sbin/mount -t zfs "${_root_dataset}" "${_directory}" # # Re-create all currently missing top-level dirs (aka mountpoint) # in the new clone. Most probably they serve as mountpoints for other @@ -1042,7 +1042,7 @@ done } echo "Unmounting the new root dataset" - umount "${_directory}" + /sbin/umount "${_directory}" echo "Re-setting some ZFS properties on the new cloned dataset" zfs set readonly=on "${_root_dataset}" # @@ -1066,7 +1066,7 @@ # Mount again echo "Mounting all datasets rooted at \`${_directory}'" [ ! -d "${_directory}" ] && mkdir "${_directory}" - mount -a -F "${_dir_fn_fstab}" -v + /sbin/mount -a -F "${_dir_fn_fstab}" -v # Update and/or merge configs if [ -n "${_etcupdate_tarball}" ]; then
