From 1f50055f5ac0e0bed0ea01f82f82ef4dca3deec2 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 28 Feb 2024 22:05:42 +0000 Subject: [PATCH] feat: ignore .swp files when doing permissions check a .swp file is a temp file created by vim. If a file is being edited by a non linuxgsm user then this could cause a permissions issue. Adding this exception to prevent this issue --- lgsm/modules/check_permissions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/modules/check_permissions.sh b/lgsm/modules/check_permissions.sh index 572b403cc1..31c64cd17f 100644 --- a/lgsm/modules/check_permissions.sh +++ b/lgsm/modules/check_permissions.sh @@ -14,12 +14,12 @@ fn_check_ownership() { fi fi if [ -d "${modulesdir}" ]; then - if [ "$(find "${modulesdir}" -not -user "$(whoami)" | wc -l)" -ne "0" ]; then + if [ "$(find "${modulesdir}" -not -name '*.swp' -not -user "$(whoami)" | wc -l)" -ne "0" ]; then funcownissue=1 fi fi if [ -d "${serverfiles}" ]; then - if [ "$(find "${serverfiles}" -not -user "$(whoami)" | wc -l)" -ne "0" ]; then + if [ "$(find "${serverfiles}" -not -name '*.swp' -not -user "$(whoami)" | wc -l)" -ne "0" ]; then filesownissue=1 fi fi