mirror of
https://github.com/AdnanHodzic/auto-cpufreq.git
synced 2025-06-06 06:40:35 +02:00
Fix unsafe access to PATH (#756)
* Fix unsafe access to PATH * Fix leading separator if PATH is empty
This commit is contained in:
parent
7ac55199f2
commit
a1ac308be7
@ -22,7 +22,10 @@ from auto_cpufreq.power_helper import *
|
|||||||
filterwarnings("ignore")
|
filterwarnings("ignore")
|
||||||
|
|
||||||
# add path to auto-cpufreq executables for GUI
|
# add path to auto-cpufreq executables for GUI
|
||||||
os.environ["PATH"] += ":/usr/local/bin"
|
if "PATH" in os.environ:
|
||||||
|
os.environ["PATH"] += os.pathsep + "/usr/local/bin"
|
||||||
|
else:
|
||||||
|
os.environ["PATH"] = "/usr/local/bin"
|
||||||
|
|
||||||
# ToDo:
|
# ToDo:
|
||||||
# - replace get system/CPU load from: psutil.getloadavg() | available in 5.6.2)
|
# - replace get system/CPU load from: psutil.getloadavg() | available in 5.6.2)
|
||||||
@ -908,4 +911,4 @@ def not_running_daemon_check():
|
|||||||
exit(1)
|
exit(1)
|
||||||
elif IS_INSTALLED_WITH_SNAP and dcheck == "disabled":
|
elif IS_INSTALLED_WITH_SNAP and dcheck == "disabled":
|
||||||
daemon_not_running_msg()
|
daemon_not_running_msg()
|
||||||
exit(1)
|
exit(1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user