mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-06-08 11:25:51 +08:00
common: avoid shell in sudo_read (#38022)
This commit is contained in:
@@ -48,7 +48,7 @@ def sudo_write(val: str, path: str) -> None:
|
||||
|
||||
def sudo_read(path: str) -> str:
|
||||
try:
|
||||
return subprocess.check_output(f"sudo cat {path}", shell=True, encoding='utf8').strip()
|
||||
return subprocess.check_output(["sudo", "cat", "--", path], encoding='utf8').strip()
|
||||
except Exception:
|
||||
return ""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user