From 6bb4cf411eb5526883f0a5cd10187f4066a0b5fb Mon Sep 17 00:00:00 2001 From: oxGorou <98001973+oxGorou@users.noreply.github.com> Date: Sat, 25 Apr 2026 21:47:35 +0700 Subject: [PATCH 1/4] Apply suggested fix to UXTU4Unix/UXTU4Unix.py from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- UXTU4Unix/UXTU4Unix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UXTU4Unix/UXTU4Unix.py b/UXTU4Unix/UXTU4Unix.py index e106576..0959afa 100644 --- a/UXTU4Unix/UXTU4Unix.py +++ b/UXTU4Unix/UXTU4Unix.py @@ -686,7 +686,7 @@ def install_manual(): prompt_restart() def prompt_restart(): - choice = input("Do you want to restart your computer to take effects? (y/n)").lower() + choice = input("Do you want to restart your computer to take effect? (y/n)").lower() if choice == "y": input("Save your current work before restarting. Press Enter to continue") restart_command = '''osascript -e 'tell app "System Events" to restart' ''' From 81bce12f7ce22bf165efef0c0e712a9706d76cdf Mon Sep 17 00:00:00 2001 From: oxGorou <98001973+oxGorou@users.noreply.github.com> Date: Sat, 25 Apr 2026 21:47:35 +0700 Subject: [PATCH 2/4] Apply suggested fix to UXTU4Unix/UXTU4Unix.py from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- UXTU4Unix/UXTU4Unix.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/UXTU4Unix/UXTU4Unix.py b/UXTU4Unix/UXTU4Unix.py index 0959afa..1867b68 100644 --- a/UXTU4Unix/UXTU4Unix.py +++ b/UXTU4Unix/UXTU4Unix.py @@ -491,10 +491,14 @@ def pass_cfg(): choice = input("Option: ").strip() if choice == "1": while True: - subprocess.run("sudo -k", shell=True) + subprocess.run(["sudo", "-k"]) password = getpass.getpass("Enter your sudo (login) password: ") - sudo_check_command = f"echo '{password}' | sudo -S ls /" - sudo_check_process = subprocess.run(sudo_check_command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + sudo_check_process = subprocess.run( + ["sudo", "-S", "-k", "ls", "/"], + input=(password + "\n").encode(), + stdout=subprocess.PIPE, + stderr=subprocess.PIPE + ) if sudo_check_process.returncode == 0: cfg.set('User', 'Password', password) with open(CONFIG_PATH, 'w') as config_file: From 4dcbb3c73d720c29d3d5c3e88d4fbb8f5a3b67f9 Mon Sep 17 00:00:00 2001 From: oxGorou <98001973+oxGorou@users.noreply.github.com> Date: Sat, 25 Apr 2026 21:47:36 +0700 Subject: [PATCH 3/4] Apply suggested fix to UXTU4Unix/UXTU4Unix.py from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- UXTU4Unix/UXTU4Unix.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/UXTU4Unix/UXTU4Unix.py b/UXTU4Unix/UXTU4Unix.py index 1867b68..b66c21b 100644 --- a/UXTU4Unix/UXTU4Unix.py +++ b/UXTU4Unix/UXTU4Unix.py @@ -265,8 +265,13 @@ def welcome_tutorial(): while True: subprocess.run("sudo -k", shell=True) password = getpass.getpass("Enter your sudo (login) password: ") - sudo_check_command = f"echo '{password}' | sudo -S ls /" - sudo_check_process = subprocess.run(sudo_check_command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + sudo_check_process = subprocess.run( + ["sudo", "-S", "ls", "/"], + input=password + "\n", + text=True, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE + ) if sudo_check_process.returncode == 0: break else: From a009268bd316d17f00e51125cb8fa240c651c80e Mon Sep 17 00:00:00 2001 From: oxGorou <98001973+oxGorou@users.noreply.github.com> Date: Sat, 25 Apr 2026 21:47:36 +0700 Subject: [PATCH 4/4] Apply suggested fix to UXTU4Unix/UXTU4Unix.py from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- UXTU4Unix/UXTU4Unix.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/UXTU4Unix/UXTU4Unix.py b/UXTU4Unix/UXTU4Unix.py index b66c21b..e2b8556 100644 --- a/UXTU4Unix/UXTU4Unix.py +++ b/UXTU4Unix/UXTU4Unix.py @@ -9,6 +9,7 @@ import json import select import plistlib +import shlex from configparser import ConfigParser LOCAL_VERSION = "0.4.2" @@ -60,10 +61,23 @@ def clear(): def get_hardware_info(command, use_sudo=False): password = cfg.get('User', 'Password', fallback='') + command_args = shlex.split(command) if use_sudo: - command = f"echo '{password}' | sudo -S {command}" - process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) - output, error = process.communicate() + process = subprocess.Popen( + ['sudo', '-S'] + command_args, + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE + ) + output, error = process.communicate(input=(password + '\n').encode('utf-8')) + else: + process = subprocess.Popen( + command_args, + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE + ) + output, error = process.communicate() return output.decode('utf-8').strip() def get_codename():