From 95c9336f9bd714d281e5da30e3f03e38768b2d37 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Sat, 9 Nov 2024 22:14:28 +0300 Subject: [PATCH] Minor renaming --- kernel_hardening_checker/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel_hardening_checker/__init__.py b/kernel_hardening_checker/__init__.py index 95d2da6..6c45d04 100755 --- a/kernel_hardening_checker/__init__.py +++ b/kernel_hardening_checker/__init__.py @@ -41,7 +41,7 @@ def _open(file: str) -> TextIO: sys.exit(f'[!] ERROR: unable to open {file}, are you sure it exists?') -def detect_arch_kconfig(fname: str) -> Tuple[StrOrNone, str]: +def detect_arch_by_kconfig(fname: str) -> Tuple[StrOrNone, str]: arch = None with _open(fname) as f: @@ -60,7 +60,7 @@ def detect_arch_kconfig(fname: str) -> Tuple[StrOrNone, str]: return arch, 'OK' -def detect_arch_sysctl(fname: str) -> Tuple[StrOrNone, str]: +def detect_arch_by_sysctl(fname: str) -> Tuple[StrOrNone, str]: arch_mapping = { 'ARM64': r'^aarch64|armv8', 'ARM': r'^armv[3-7]', @@ -269,7 +269,7 @@ def perform_checking(mode: StrOrNone, version: TupleOrNone, # detect the kernel microarchitecture if kconfig: - arch, msg = detect_arch_kconfig(kconfig) + arch, msg = detect_arch_by_kconfig(kconfig) if arch is None: sys.exit(f'[!] ERROR: {msg}') if mode != 'json': @@ -277,7 +277,7 @@ def perform_checking(mode: StrOrNone, version: TupleOrNone, else: assert(not cmdline), 'wrong perform_checking() usage' assert(sysctl), 'wrong perform_checking() usage' - arch, msg = detect_arch_sysctl(sysctl) + arch, msg = detect_arch_by_sysctl(sysctl) if mode != 'json': if arch is None: print(f'[!] WARNING: {msg}, arch-dependent checks will be dropped') -- 2.31.1