Browse Source

Show non-root files on stig test

Bob Mottram 7 years ago
parent
commit
b8a873f9d2
1 changed files with 42 additions and 36 deletions
  1. 42
    36
      tests/check-cmd-owner.sh

+ 42
- 36
tests/check-cmd-owner.sh View File

2
 
2
 
3
 if [ -d "/bin" ];then
3
 if [ -d "/bin" ];then
4
 
4
 
5
-        COUNT=$(find -L /bin  \! -user root  -exec ls -l {} \; |wc -l)
5
+    COUNT=$(find -L /bin  \! -user root  -exec ls -l {} \; |wc -l)
6
 
6
 
7
-        if [ $COUNT -eq 0 ];then
8
-                :
9
-        else
10
-                exit 1
11
-        fi
7
+    if [ $COUNT -eq 0 ];then
8
+        :
9
+    else
10
+        find -L /bin  \! -user root  -exec ls -l {} \;
11
+        exit 1
12
+    fi
12
 fi
13
 fi
13
 if [ -d "/usr/bin" ];then
14
 if [ -d "/usr/bin" ];then
14
 
15
 
15
-        COUNT=$(find -L /usr/bin  \! -user root  -exec ls -l {} \; |wc -l)
16
+    COUNT=$(find -L /usr/bin  \! -user root  -exec ls -l {} \; |wc -l)
16
 
17
 
17
-        if [ $COUNT -eq 0 ];then
18
-                :
19
-        else
20
-                exit 1
21
-        fi
18
+    if [ $COUNT -eq 0 ];then
19
+        :
20
+    else
21
+        find -L /usr/bin  \! -user root  -exec ls -l {} \;
22
+        exit 1
23
+    fi
22
 fi
24
 fi
23
 if [ -d "/usr/local/bin" ];then
25
 if [ -d "/usr/local/bin" ];then
24
 
26
 
25
-        COUNT=$(find -L /usr/local/bin  \! -user root  -exec ls -l {} \; |wc -l)
27
+    COUNT=$(find -L /usr/local/bin  \! -user root  -exec ls -l {} \; |wc -l)
26
 
28
 
27
-        if [ $COUNT -eq 0 ];then
28
-                :
29
-        else
30
-                exit 1
31
-        fi
29
+    if [ $COUNT -eq 0 ];then
30
+        :
31
+    else
32
+        find -L /usr/local/bin  \! -user root  -exec ls -l {} \;
33
+        exit 1
34
+    fi
32
 fi
35
 fi
33
 if [ -d "/sbin" ];then
36
 if [ -d "/sbin" ];then
34
 
37
 
35
-        COUNT=$(find -L /sbin  \! -user root  -exec ls -l {} \; |wc -l)
38
+    COUNT=$(find -L /sbin  \! -user root  -exec ls -l {} \; |wc -l)
36
 
39
 
37
-        if [ $COUNT -eq 0 ];then
38
-                :
39
-        else
40
-                exit 1
41
-        fi
40
+    if [ $COUNT -eq 0 ];then
41
+        :
42
+    else
43
+        find -L /sbin  \! -user root  -exec ls -l {} \;
44
+        exit 1
45
+    fi
42
 fi
46
 fi
43
 if [ -d "/usr/sbin" ];then
47
 if [ -d "/usr/sbin" ];then
44
 
48
 
45
-        COUNT=$(find -L /usr/sbin  \! -user root  -exec ls -l {} \; |wc -l)
49
+    COUNT=$(find -L /usr/sbin  \! -user root  -exec ls -l {} \; |wc -l)
46
 
50
 
47
-        if [ $COUNT -eq 0 ];then
48
-                :
49
-        else
50
-                exit 1
51
-        fi
51
+    if [ $COUNT -eq 0 ];then
52
+        :
53
+    else
54
+        find -L /usr/sbin  \! -user root  -exec ls -l {} \;
55
+        exit 1
56
+    fi
52
 fi
57
 fi
53
 if [ -d "/usr/local/sbin" ];then
58
 if [ -d "/usr/local/sbin" ];then
54
 
59
 
55
-        COUNT=$(find -L /usr/local/sbin  \! -user root  -exec ls -l {} \; |wc -l)
60
+    COUNT=$(find -L /usr/local/sbin  \! -user root  -exec ls -l {} \; |wc -l)
56
 
61
 
57
-        if [ $COUNT -eq 0 ];then
58
-                :
59
-        else
60
-                exit 1
61
-        fi
62
+    if [ $COUNT -eq 0 ];then
63
+        :
64
+    else
65
+        find -L /usr/local/sbin  \! -user root  -exec ls -l {} \;
66
+        exit 1
67
+    fi
62
 fi
68
 fi