Browse Source

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
pull/4516/head
Daniel Gibbs 1 year ago
parent
commit
1f50055f5a
No known key found for this signature in database GPG Key ID: 2076B128385E8C55
  1. 4
      lgsm/modules/check_permissions.sh

4
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

Loading…
Cancel
Save