changeset 198:dd8a9bbdf8c0

Better error handling when changing privileges and flags of var/empty
author Franz Glasner <fzglas.hg@dom66.de>
date Sun, 21 Aug 2022 11:00:58 +0200
parents 3181a6b5758e
children a8b6584d24ec
files sbin/fjail
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/sbin/fjail	Sun Aug 21 10:49:00 2022 +0200
+++ b/sbin/fjail	Sun Aug 21 11:00:58 2022 +0200
@@ -504,8 +504,8 @@
         fi
     fi
     # Set the access rights and the file flags as given in mtree
-    chmod 0555 "${_mp}/var/empty"
-    chflags schg "${_mp}/var/empty"
+    chmod 0555 "${_mp}/var/empty" || { echo "WARNING: Cannot chmod on var/empty" >&2; }
+    chflags schg "${_mp}/var/empty" || { echo "WARNING: Cannot chflags on var/empty" >&2; }
     # Reset the read-only status of the mountpoint as it was before
     if [ "${_vestatus}" = "on" ]; then
         zfs set readonly=on ${_veds} >/dev/null 2>/dev/null || { echo "ERROR: cannot reactivate readonly-status of ${_mp}/var/empty" >&2; return 1; }