From 486a9a6dc21b742e1a85db681ac1368a5ef59912 Mon Sep 17 00:00:00 2001 From: Lab Rat <35325046+rootCircle@users.noreply.github.com> Date: Sat, 24 Jun 2023 05:42:56 +0000 Subject: [PATCH] Adding root_check before set_override method execution (#524) This will ensure that set_override calls are always in su mode. So, in effect all override using 'force' can clearly access the governer_override_state path file, and write changes to it, without externally tinkering the environment. --- auto_cpufreq/core.py | 1 + 1 file changed, 1 insertion(+) diff --git a/auto_cpufreq/core.py b/auto_cpufreq/core.py index 2dcdff1..d2a21e4 100644 --- a/auto_cpufreq/core.py +++ b/auto_cpufreq/core.py @@ -96,6 +96,7 @@ def get_override(): return "default" def set_override(override): + root_check() # Calling root_check inside if and elif might be too verbose and is susceptible to bugs in future if override in ["powersave", "performance"]: with open(governor_override_state, "wb") as store: pickle.dump(override, store)