summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mandriva.org>2010-02-11 16:38:18 +0000
committerPascal Terjan <pterjan@mandriva.org>2010-02-11 16:38:18 +0000
commit5d8548e97b83f1755cd5b4785cb727d939379502 (patch)
tree8ca93e4b7549aba59d375daa43070a08bcd45694
parentf027685083f5658b9f1dbdf522b58ce51b2c1e25 (diff)
downloaddrakx-backup-do-not-use-distro/mdv2009.1.tar
drakx-backup-do-not-use-distro/mdv2009.1.tar.gz
drakx-backup-do-not-use-distro/mdv2009.1.tar.bz2
drakx-backup-do-not-use-distro/mdv2009.1.tar.xz
drakx-backup-do-not-use-distro/mdv2009.1.zip
run_program: set XAUTHORITY and HOME for the user we will drop privileges todistro/mdv2009.1
-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 4eb1b91fa..e5e9032f8 100644
--- a/perl-install/Makefile.config
+++ b/perl-install/Makefile.config
@@ -1,5 +1,5 @@
# -*- Makefile -*-
-VERSION:=12.35.2
+VERSION:=12.35.3
SUDO = sudo
TMPDIR = /tmp
diff --git a/perl-install/NEWS b/perl-install/NEWS
index 1343b4cd0..3fe961a69 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -1,3 +1,8 @@
+Version 12.35.3 - 11 February 2010
+
+- run_program: set XAUTHORITY and HOME for the user we will drop
+ privileges to
+
Version 12.35.2 - 22 October 2009
- service_harddrake: allow to force screen resolution using
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 {