Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG-FIX] Fixed bug related to recurring sudo prompt for functions that even don't require it #531

Merged
merged 1 commit into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion auto_cpufreq/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ 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)
Expand Down
3 changes: 2 additions & 1 deletion bin/auto-cpufreq
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def main(config, daemon, debug, install, remove, live, log, monitor, stats, vers
# set governor override unless None or invalid
if force is not None:
not_running_daemon_check()
set_override(force)
root_check() # Calling root_check before set_override as it will require sudo access
set_override(force) # Calling set override, only if force has some values

if len(sys.argv) == 1:

Expand Down