Revert previous commit

This commit is contained in:
Mykola Grymalyuk
2023-05-17 19:30:23 -06:00
parent 0cc8b7b705
commit 2d5ea95ee0
2 changed files with 5 additions and 5 deletions

View File

@@ -452,7 +452,7 @@ class KernelDebugKitObject:
if self.passive is True:
return
if os.geteuid() != 0:
if os.getuid() != 0:
logging.warning("- Cannot remove KDK, not running as root")
return
@@ -567,7 +567,7 @@ class KernelDebugKitUtilities:
bool: True if successful, False if not
"""
if os.geteuid() != 0:
if os.getuid() != 0:
logging.warning("- Cannot install KDK, not running as root")
return False
@@ -598,7 +598,7 @@ class KernelDebugKitUtilities:
bool: True if successful, False if not
"""
if os.geteuid() != 0:
if os.getuid() != 0:
logging.warning("- Cannot install KDK, not running as root")
return False
@@ -659,7 +659,7 @@ class KernelDebugKitUtilities:
logging.warning("- Malformed KDK Info.plist provided, cannot create backup")
return
if os.geteuid() != 0:
if os.getuid() != 0:
logging.warning("- Cannot create KDK backup, not running as root")
return

View File

@@ -531,7 +531,7 @@ def check_boot_mode():
def elevated(*args, **kwargs) -> subprocess.CompletedProcess:
# When running through our GUI, we run as root, however we do not get uid 0
# Best to assume CLI is running as root
if os.geteuid() == 0 or check_cli_args() is not None:
if os.getuid() == 0 or check_cli_args() is not None:
return subprocess.run(*args, **kwargs)
else:
return subprocess.run(["sudo"] + [args[0][0]] + args[0][1:], **kwargs)