diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2016-06-03 16:14:18 +0200 |
---|---|---|
committer | Thierry Vignaud <thierry.vignaud@gmail.com> | 2016-06-03 17:42:44 +0200 |
commit | 97a49721274c5538f121811195e802669424c316 (patch) | |
tree | c9f8bece3f052c13e251c8cda8133bbbc0920baa | |
parent | 1446f4ac0b364c041d7de0e5a186e9709a300388 (diff) | |
download | drakx-97a49721274c5538f121811195e802669424c316.tar drakx-97a49721274c5538f121811195e802669424c316.tar.gz drakx-97a49721274c5538f121811195e802669424c316.tar.bz2 drakx-97a49721274c5538f121811195e802669424c316.tar.xz drakx-97a49721274c5538f121811195e802669424c316.zip |
guess the right user after the switch to polkit
adjust the env variable to look at (mga#18288)
-rw-r--r-- | perl-install/NEWS | 1 | ||||
-rw-r--r-- | perl-install/run_program.pm | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS index 03799a6d7..db9743e06 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,5 +1,6 @@ - running commands as user: o fix the fallback when the helper didn't provide the real UID (mga#18288) + o guess the right user after the switch to polkit (mga#18288) Version 17.33 - 27 May 2016 diff --git a/perl-install/run_program.pm b/perl-install/run_program.pm index 0b5776a2d..300179832 100644 --- a/perl-install/run_program.pm +++ b/perl-install/run_program.pm @@ -160,7 +160,7 @@ Runs $name with @args parameters. $options is a hash ref that can contains: =item * B<root>: $name will be chrooted in $root prior to run -=item * B<as_user>: $name will be run as $ENV{USERHELPER_UID} or with the UID of parent process. Implies I<setuid> +=item * B<as_user>: $name will be run as $ENV{PKEXEC_UID} or with the UID of parent process. Implies I<setuid> =item * B<sensitive_arguments>: parameters will be hidden in logs (b/c eg there's a password) @@ -199,7 +199,7 @@ sub raw { my $home; if ($options->{as_user}) { my $uid; - $uid = $ENV{USERHELPER_UID} && getpwuid($ENV{USERHELPER_UID}); + $uid = $ENV{PKEXEC_UID} && getpwuid($ENV{PKEXEC_UID}); $uid ||= common::get_parent_uid(); my ($full_user) = grep { $_->[2] eq $uid } list_passwd(); $options->{setuid} = getpwnam($full_user->[0]) if $full_user->[0]; |