From: Alexander Popov Date: Sat, 16 Nov 2024 13:12:17 +0000 (+0300) Subject: Handle the case of denied permission in the autodetect mode X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=16b5717331b3b232d3e8ff62b3e86ba27914db87;p=kconfig-hardened-check.git Handle the case of denied permission in the autodetect mode --- diff --git a/kernel_hardening_checker/__init__.py b/kernel_hardening_checker/__init__.py index 87b6e77..58c3843 100755 --- a/kernel_hardening_checker/__init__.py +++ b/kernel_hardening_checker/__init__.py @@ -38,6 +38,8 @@ def _open(file: str) -> TextIO: return open(file, 'rt', encoding='utf-8') except FileNotFoundError: sys.exit(f'[!] ERROR: unable to open {file}, are you sure it exists?') + except PermissionError: + sys.exit(f'[!] ERROR: unable to open {file}, permission denied') def detect_kconfig(version_fname: str) -> Tuple[StrOrNone, str]: