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.
This commit is contained in:
Lab Rat 2023-06-24 05:42:56 +00:00 committed by GitHub
parent d593e3e839
commit 486a9a6dc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -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)