summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mandriva.org>2010-02-11 16:45:45 +0000
committerPascal Terjan <pterjan@mandriva.org>2010-02-11 16:45:45 +0000
commit0c18b9dcece7095322902d947136188a1681a4fb (patch)
tree1af35673b01caceb8e4d3d42e01179da8c5bf355
parentfb730ae27d52fbbe3f0d43ac786187f891f1e3d9 (diff)
downloaddrakx-backup-do-not-use-0c18b9dcece7095322902d947136188a1681a4fb.tar
drakx-backup-do-not-use-0c18b9dcece7095322902d947136188a1681a4fb.tar.gz
drakx-backup-do-not-use-0c18b9dcece7095322902d947136188a1681a4fb.tar.bz2
drakx-backup-do-not-use-0c18b9dcece7095322902d947136188a1681a4fb.tar.xz
drakx-backup-do-not-use-0c18b9dcece7095322902d947136188a1681a4fb.zip
run_program: set XAUTHORITY and HOME for the user we will drop privileges todistro/mdv2008.0
-rw-r--r--perl-install/Makefile.config2
-rw-r--r--perl-install/NEWS4
-rw-r--r--perl-install/run_program.pm5
3 files changed, 9 insertions, 2 deletions
diff --git a/perl-install/Makefile.config b/perl-install/Makefile.config
index 39722493c..acc1ba6fa 100644
--- a/perl-install/Makefile.config
+++ b/perl-install/Makefile.config
@@ -1,5 +1,5 @@
# -*- Makefile -*-
-VERSION:=10.4.239.5
+VERSION:=10.4.239.6
SUDO = sudo
TMPDIR = /tmp
diff --git a/perl-install/NEWS b/perl-install/NEWS
index 940c1e4d0..e79f22f45 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -1,3 +1,7 @@
+Version 10.4.239.6 - 11 February 2010
+
+- run_program: set XAUTHORITY and HOME for the user we will drop
+ privileges to
- drakhelp:
o fix firefox launch bug #29775
- do open bug in running firefox drakbug (#31109)
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 {