use stat to verify permissions

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
This commit is contained in:
Thomas Sjögren 2016-02-16 23:23:27 +01:00
parent f81bc4d6d2
commit 001811bf87

View file

@ -402,8 +402,7 @@ fi
check_3_26="3.26 - Verify that Docker socket file permissions are set to 660"
file="/var/run/docker.sock"
if [ -S "$file" ]; then
perms=$(ls -ld "$file" | awk '{print $1}')
if [ "$perms" = "srw-rw----" ]; then
if [ "$(stat -c %a $file)" -eq 660 ]; then
pass "$check_3_26"
else
warn "$check_3_26"