|
|
@ -28,7 +28,7 @@ check_command "[ \$(stat -c '%U' /opt/world.txt) = 'jack' ] && [ \$(stat -c '%G' |
|
|
|
check_command "[ \$(stat -c '%A' /opt/world.txt) = '-rwxrw-r--' ]" 6 |
|
|
|
check_command "[ \$(stat -c '%A' /opt/world.txt) = '-rwxrw-r--' ]" 6 |
|
|
|
|
|
|
|
|
|
|
|
# 7. 检查/opt/myfile目录的属组是否为hr,并且递归设置 |
|
|
|
# 7. 检查/opt/myfile目录的属组是否为hr,并且递归设置 |
|
|
|
check_command "[ \$(stat -c '%G' /opt/myfile) = 'hr' ] && [ \$(find /opt/myfile -not -group hr | wc -l) -eq 1 ]" 7 |
|
|
|
check_command "[ \$(stat -c '%G' /opt/myfile) = 'hr' ] && [ \$(find /opt/myfile -not -group hr | wc -l) -eq 0 ]" 7 |
|
|
|
|
|
|
|
|
|
|
|
# 8. 检查/opt/myfile目录的权限是否允许所有用户创建文件或子目录,且新文件继承属组 |
|
|
|
# 8. 检查/opt/myfile目录的权限是否允许所有用户创建文件或子目录,且新文件继承属组 |
|
|
|
check_command "[ \$(stat -c '%a' /opt/myfile) = '2777' ]" 8 |
|
|
|
check_command "[ \$(stat -c '%a' /opt/myfile) = '2777' ]" 8 |
|
|
|