]> git.baikalelectronics.ru Git - kernel.git/commit
tools / cpupower: Correctly detect if running as root
authorMichal Privoznik <mprivozn@redhat.com>
Sun, 14 Dec 2014 12:36:52 +0000 (13:36 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 19 Dec 2014 22:01:03 +0000 (23:01 +0100)
commitcc7258bd84ab80b8d8db1cbf1693ee98d89b83be
tree456df70b2c1e6d0df4c94c2e199575b6d687bff5
parentdf5487daf4c66f98e5711566a166c24d795786a8
tools / cpupower: Correctly detect if running as root

Some operations, like frequency-set, need root privileges. However,
the way that this is detected is not correct. The getuid() is called,
while in fact geteuid() should be. This way we can allow
distributions or users to set SETUID flags on the cpupower binary if
they want to and let regular users change the cpu frequency governor.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
tools/power/cpupower/utils/cpupower.c