From aeba550344af64018408429d990d0d6cca381f4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hasan=20=C3=87ALI=C5=9EIR?= Date: Mon, 30 Sep 2024 12:55:45 +0300 Subject: [PATCH] use tune2fs for only ext filesystems to check ACL mount --- fastcgi_ops_root.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/fastcgi_ops_root.sh b/fastcgi_ops_root.sh index 973c210..d49e558 100644 --- a/fastcgi_ops_root.sh +++ b/fastcgi_ops_root.sh @@ -132,11 +132,16 @@ for cmd in "${required_commands[@]}"; do fi done -# Check ACL configured properly +# Check ACL configured properly for only ext filesystem +# XFS and Btrfs have ACL support enabled by default fs="$(df / | awk 'NR==2 {print $1}')" -if ! tune2fs -l "${fs}" | grep -q "Default mount options:.*acl"; then - echo -e '\e[91mError:\e[0m \e[96mFilesystem not mounted with the acl!\e[0m' - exit 1 +fs_type="$(df -T / | awk 'NR==2 {print $2}')" + +if [[ "${fs_type}" =~ ^(ext2|ext3|ext4)$ ]]; then + if ! tune2fs -l "${fs}" | grep -q "Default mount options:.*acl"; then + echo -e '\e[91mError:\e[0m \e[96mFilesystem not mounted with the acl!\e[0m' + exit 1 + fi fi # Discover script path