changeset 203:eb95c986cc59

Use -t filesystem in all "zfs list" calls
author Franz Glasner <fzglas.hg@dom66.de>
date Sun, 21 Aug 2022 12:18:15 +0200
parents 6b7a084ddf1d
children ef397b84b047
files sbin/fjail
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/sbin/fjail	Sun Aug 21 12:08:59 2022 +0200
+++ b/sbin/fjail	Sun Aug 21 12:18:15 2022 +0200
@@ -174,7 +174,7 @@
         echo "ERROR: no parent dataset given" >&2
         return 2
     fi
-    _pmp=$(zfs list -H -o mountpoint "${_pds}" 2>/dev/null) || { echo "ERROR: dataset \`${_pds}' does not exist" >&2; return 1; }
+    _pmp=$(zfs list -H -o mountpoint -t filesystem "${_pds}" 2>/dev/null) || { echo "ERROR: dataset \`${_pds}' does not exist" >&2; return 1; }
     case "${_pmp}" in
         none)
             echo "ERROR: dataset \`${_pds}' has no mountpoint" >&2
@@ -195,7 +195,7 @@
     fi
     _ds="${_pds}/${_cds}"
     echo "Resulting new root dataset is \`${_ds}' at mountpoint \`${_pmp}/${_cds}'"
-    if zfs list -H -o mountpoint "${_ds}" >/dev/null 2>/dev/null; then
+    if zfs list -H -o mountpoint -t filesystem "${_ds}" >/dev/null 2>/dev/null; then
         echo "ERROR: dataset \`${_ds}' does already exist" >&2
         return 1
     fi
@@ -496,7 +496,7 @@
     _vestatus=""
     _veds="$(_get_dataset_for_varempty "${_mp}")"
     if [ $? -eq 0 ]; then
-        _vestatus=$(zfs list -H -o readonly ${_veds} 2>/dev/null) || { echo "ERROR: cannot determine readonly status of ${_mp}/var/empty" >&2; return 1; }
+        _vestatus=$(zfs list -H -o readonly -t filesystem ${_veds} 2>/dev/null) || { echo "ERROR: cannot determine readonly status of ${_mp}/var/empty" >&2; return 1; }
         if [ "${_vestatus}" = "on" ]; then
             zfs set readonly=off ${_veds} 1> /dev/null || { echo "ERROR: cannot reset readonly-status of ${_mp}/var/empty" >&2; return 1; }
         fi