Skip to content

Conversation

@jammasterj89
Copy link
Contributor

Issue #459 raised that check_2 was only checking for 644 or 600 permissions, this now checks for anything less than or equal to 644.

Signed-off-by: Niall T 19202716+jammasterj89@users.noreply.github.com

Issue docker#459 raised that check_2 was only checking for 644 or 600 permissions, this now checks for anything less than or equal to 644.

Signed-off-by: Niall T 19202716+jammasterj89@users.noreply.github.com
@konstruktoid
Copy link
Collaborator

Hi and thanks for the PR.
Could you include all other permission checks as well?

$ git grep 'stat -c %a'
tests/3_docker_daemon_configuration_files.sh:    if [ "$(stat -c %a $file)" -eq 644 ] || [ "$(stat -c %a $file)" -eq 600 ]; then
tests/3_docker_daemon_configuration_files.sh:    if [ "$(stat -c %a $file)" -eq 644 ] || [ "$(stat -c %a $file)" -eq 600 ]; then
tests/3_docker_daemon_configuration_files.sh:    if [ "$(stat -c %a $directory)" -eq 755 ] || [ "$(stat -c %a $directory)" -eq 700 ]; then
tests/3_docker_daemon_configuration_files.sh:      if [ "$(stat -c %a $p)" -ne 444 ] && [ "$(stat -c %a $p)" -ne 400 ]; then
tests/3_docker_daemon_configuration_files.sh:    if [ "$(stat -c %a $tlscacert)" -eq 444 ] || [ "$(stat -c %a $tlscacert)" -eq 400 ]; then
tests/3_docker_daemon_configuration_files.sh:    if [ "$(stat -c %a $tlscert)" -eq 444 ] || [ "$(stat -c %a $tlscert)" -eq 400 ]; then
tests/3_docker_daemon_configuration_files.sh:    if [ "$(stat -c %a $tlskey)" -eq 400 ]; then
tests/3_docker_daemon_configuration_files.sh:    if [ "$(stat -c %a $file)" -eq 660 ] || [  "$(stat -c %a $file)" -eq 600 ]; then
tests/3_docker_daemon_configuration_files.sh:    if [ "$(stat -c %a $file)" -eq 644 ] || [  "$(stat -c %a $file)" -eq 640 ] || [ "$(stat -c %a $file)" -eq 600 ]; then
tests/3_docker_daemon_configuration_files.sh:    if [ "$(stat -c %a $file)" -eq 644 ] || [ "$(stat -c %a $file)" -eq 600 ]; then
tests/3_docker_daemon_configuration_files.sh:    if [ "$(stat -c %a $file)" -eq 644 ] || [ "$(stat -c %a $file)" -eq 600 ]; then

Replace multiple -eq with -le for file permission checks. Except for line 228 which uses slightly different logic so is -ge.

Signed-off-by: Niall T 19202716+jammasterj89@users.noreply.github.com
@konstruktoid
Copy link
Collaborator

Thanks alot @jammasterj89!

@jammasterj89
Copy link
Contributor Author

Thanks alot @jammasterj89!

Thanks for the quick merge! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants