summaryrefslogtreecommitdiffstats
path: root/perl-install/run_program.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/run_program.pm')
-rw-r--r--perl-install/run_program.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/perl-install/run_program.pm b/perl-install/run_program.pm
index 0f84b9087..a74935656 100644
--- a/perl-install/run_program.pm
+++ b/perl-install/run_program.pm
@@ -111,8 +111,11 @@ sub raw {
} else {
if ($options->{setuid}) {
require POSIX;
- $ENV{'LOGNAME'} = getpwuid($options->{setuid}) || $ENV{LOGNAME};
POSIX::setuid($options->{setuid});
+ my ($logname, $home) = (getpwuid($options->{setuid}))[0,7];
+ $ENV{'XAUTHORITY'} = "$home/.Xauthority";
+ $ENV{'LOGNAME'} = $logname || $ENV{LOGNAME};
+ $ENV{'HOME'} = $home;
}
sub die_exit {