From 424aceb1169f409a6cfbe6f3b22a96518bcf87ff Mon Sep 17 00:00:00 2001 From: shreyamalviya Date: Wed, 9 Jun 2021 19:38:45 +0530 Subject: [PATCH] Use constants instead of permission masks --- .../cc/setup/island_config_options_validator.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/monkey/monkey_island/cc/setup/island_config_options_validator.py b/monkey/monkey_island/cc/setup/island_config_options_validator.py index fdf25ef85..66df126be 100644 --- a/monkey/monkey_island/cc/setup/island_config_options_validator.py +++ b/monkey/monkey_island/cc/setup/island_config_options_validator.py @@ -7,11 +7,14 @@ from monkey_island.cc.setup.island_config_options import IslandConfigOptions def raise_on_invalid_options(options: IslandConfigOptions): + LINUX_READ_ONLY_BY_USER = 0o400 + WINDOWS_READ_ONLY = 1179817 + _raise_if_not_isfile(options.crt_path) - _raise_if_incorrect_permissions(options.crt_path, 0o400, 1179817) + _raise_if_incorrect_permissions(options.crt_path, LINUX_READ_ONLY_BY_USER, WINDOWS_READ_ONLY) _raise_if_not_isfile(options.key_path) - _raise_if_incorrect_permissions(options.key_path, 0o400, 1179817) + _raise_if_incorrect_permissions(options.key_path, LINUX_READ_ONLY_BY_USER, WINDOWS_READ_ONLY) def _raise_if_not_isfile(f: str):