Skip to content

Commit

Permalink
feat: ignore .swp files when doing permissions check
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dgibbs64 committed Feb 28, 2024
1 parent fce9f65 commit 1f50055
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lgsm/modules/check_permissions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1f50055

Please sign in to comment.