summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mandriva.org>2010-02-11 16:41:14 +0000
committerPascal Terjan <pterjan@mandriva.org>2010-02-11 16:41:14 +0000
commit68ca7baa726e29a016e2888b7fddd22936ecacaf (patch)
treebab4d0ebcae767c336d78e96f5fe2ffd02d1e11f /perl-install
parentc927fd62adce544a15404e73526a92a8f36e2ac0 (diff)
downloaddrakx-68ca7baa726e29a016e2888b7fddd22936ecacaf.tar
drakx-68ca7baa726e29a016e2888b7fddd22936ecacaf.tar.gz
drakx-68ca7baa726e29a016e2888b7fddd22936ecacaf.tar.bz2
drakx-68ca7baa726e29a016e2888b7fddd22936ecacaf.tar.xz
drakx-68ca7baa726e29a016e2888b7fddd22936ecacaf.zip
run_program: set XAUTHORITY and HOME for the user we will drop privileges to
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/Makefile.config2
-rw-r--r--perl-install/NEWS5
-rw-r--r--perl-install/run_program.pm5
3 files changed, 10 insertions, 2 deletions
diff --git a/perl-install/Makefile.config b/perl-install/Makefile.config
index 0fb48a342..d9d16f1e7 100644
--- a/perl-install/Makefile.config
+++ b/perl-install/Makefile.config
@@ -1,5 +1,5 @@
# -*- Makefile -*-
-VERSION:=11.71.10
+VERSION:=11.71.11
SUDO = sudo
TMPDIR = /tmp
diff --git a/perl-install/NEWS b/perl-install/NEWS
index a0edf7779..2d81b3495 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -1,3 +1,8 @@
+Version 11.71.11 - 11 February 2010
+
+- run_program: set XAUTHORITY and HOME for the user we will drop
+ privileges to
+
Version 11.71.10 - 17 September 2009
- drakhelp:
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 {