From: Thomas Renninger <trenn@suse.de>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Michal Privoznik <mprivozn@redhat.com>,
rafael.j.wysocki@intel.com, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cpupower: Correctly detect if running as root
Date: Wed, 17 Dec 2014 17:22:54 +0100 [thread overview]
Message-ID: <12251128.9086t2JFoE@skinner> (raw)
In-Reply-To: <1660884.y6rjWabQcf@vostro.rjw.lan>
On Sunday, December 14, 2014 10:29:24 PM Rafael J. Wysocki wrote:
> On Sunday, December 14, 2014 01:36:52 PM Michal Privoznik wrote:
> > 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>
>
> An ACK from Thomas is needed.
Patch is correct, Thanks!
Acked-by: Thomas Renninger <trenn@suse.de>
Thomas
>
> > ---
> >
> > tools/power/cpupower/utils/cpupower.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tools/power/cpupower/utils/cpupower.c
> > b/tools/power/cpupower/utils/cpupower.c index 7cdcf88..9ea9143 100644
> > --- a/tools/power/cpupower/utils/cpupower.c
> > +++ b/tools/power/cpupower/utils/cpupower.c
> > @@ -199,7 +199,7 @@ int main(int argc, const char *argv[])
> >
> > }
> >
> > get_cpu_info(0, &cpupower_cpu_info);
> >
> > - run_as_root = !getuid();
> > + run_as_root = !geteuid();
> >
> > if (run_as_root) {
> >
> > ret = uname(&uts);
> > if (!ret && !strcmp(uts.machine, "x86_64") &&
next prev parent reply other threads:[~2014-12-17 16:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-14 12:36 [PATCH] cpupower: Correctly detect if running as root Michal Privoznik
2014-12-14 21:29 ` Rafael J. Wysocki
2014-12-17 16:22 ` Thomas Renninger [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-12-24 11:08 Michal Privoznik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=12251128.9086t2JFoE@skinner \
--to=trenn@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mprivozn@redhat.com \
--cc=rafael.j.wysocki@intel.com \
--cc=rjw@rjwysocki.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox