Skip to content

Commit

Permalink
use different command in check_permissions.sh to suppot macosx
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderRichert-NOAA committed Jul 3, 2023
1 parent a3713f9 commit b4a87bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions util/check_permissions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ path=$PWD

# Check upstream hierarchy of current directory
while [ $path != '/' ]; do
o_perms=$(stat $path --format="%A" | grep -o "...$")
if [ ${o_perms:0:1} != 'r' ]; then
o_perms=$(ls -ld $path | awk '{print $1}' | grep -oE "[r-][w-][x-].?$")
if [ "${o_perms:0:1}" != 'r' ]; then
echo "Path $path is not readable by non-owners; set o+r" 1>&2
iret=1
fi
if [ ${o_perms:2:3} != 'x' ]; then
if [ "${o_perms:2:3}" != 'x' ]; then
echo "Path $path is not accessible by non-owners; set o+x" 1&>2
iret=1
fi
Expand Down

0 comments on commit b4a87bb

Please sign in to comment.