From 001811bf874c72a924849a3e2ecfbb2c2a213798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Sj=C3=B6gren?= Date: Tue, 16 Feb 2016 23:23:27 +0100 Subject: [PATCH] use stat to verify permissions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Sjögren --- tests/3_docker_daemon_configuration_files.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/3_docker_daemon_configuration_files.sh b/tests/3_docker_daemon_configuration_files.sh index 8865ceb..7c141a0 100644 --- a/tests/3_docker_daemon_configuration_files.sh +++ b/tests/3_docker_daemon_configuration_files.sh @@ -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"