Message ID | 1392639414-3909-4-git-send-email-hdegoede@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/src/backlight.c b/src/backlight.c index 518d756..dc26307 100644 --- a/src/backlight.c +++ b/src/backlight.c @@ -295,6 +295,10 @@ static int __backlight_helper_init(struct backlight *b, char *iface) switch ((b->pid = fork())) { case 0: + if (setgid(getgid()) != 0) + _exit(127); + if (setuid(getuid()) != 0) + _exit(127); close(fds[1]); dup2(fds[0], 0); close(fds[0]);
Event though we've failed to open the backlight normally, we may still be running under a suid-root xserver, so drop any elevated rights before executing what we hope will be pkxec. Signed-off-by: Hans de Goede <hdegoede@redhat.com> --- src/backlight.c | 4 ++++ 1 file changed, 4 insertions(+)