diff options
Diffstat (limited to 'perl-install/run_program.pm')
-rw-r--r-- | perl-install/run_program.pm | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/perl-install/run_program.pm b/perl-install/run_program.pm index 86386d081..7288ef816 100644 --- a/perl-install/run_program.pm +++ b/perl-install/run_program.pm @@ -201,11 +201,8 @@ sub raw { my $uid; $uid = $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]; - $home = $full_user->[7] if $full_user; + $options->{setuid} = $uid; } - local $ENV{HOME} = $home if $home; my $args = $options->{sensitive_arguments} ? '<hidden arguments>' : join(' ', @args); log::explanations("running: $real_name $args" . ($root ? " with root $root" : "")); @@ -273,6 +270,7 @@ sub raw { require POSIX; my ($logname, $home) = (getpwuid($options->{setuid}))[0,7]; $ENV{LOGNAME} = $logname if $logname; + $ENV{HOME} = $home if $home; # if we were root and are going to drop privilege, keep a copy of the X11 cookie: if (!$> && $home) { |