changeset 699:4243b087fc2d

fjail: Check simple result directly
author Franz Glasner <fzglas.hg@dom66.de>
date Tue, 01 Oct 2024 20:05:36 +0200
parents f8bd9471345a
children 31953a5653e9
files sbin/fjail
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/sbin/fjail	Tue Oct 01 20:00:44 2024 +0200
+++ b/sbin/fjail	Tue Oct 01 20:05:36 2024 +0200
@@ -582,8 +582,7 @@
     # make it writeable temporarily if it is mounted read-only:
     #
     _vestatus=""
-    _veds="$(_get_zfs_dataset_for_varempty "${_mp}")"
-    if [ $? -eq 0 ]; then
+    if _veds="$(_get_zfs_dataset_for_varempty "${_mp}")" ; then
         _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; }