summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-09-17 10:29:25 +0000
committerThierry Vignaud <tv@mageia.org>2012-09-17 10:29:25 +0000
commitd7ad6c74d115aa3167d186183d57d407de7e29ff (patch)
treee9f3f132abb6e43da63a447c61d7a5c76f84d855 /perl-install
parentf305e0e772345b54c100349657005eaf37784905 (diff)
downloaddrakx-backup-do-not-use-d7ad6c74d115aa3167d186183d57d407de7e29ff.tar
drakx-backup-do-not-use-d7ad6c74d115aa3167d186183d57d407de7e29ff.tar.gz
drakx-backup-do-not-use-d7ad6c74d115aa3167d186183d57d407de7e29ff.tar.bz2
drakx-backup-do-not-use-d7ad6c74d115aa3167d186183d57d407de7e29ff.tar.xz
drakx-backup-do-not-use-d7ad6c74d115aa3167d186183d57d407de7e29ff.zip
(raw) do not crash when trying to guess homedir before running another process (mga#7403)
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/NEWS2
-rw-r--r--perl-install/run_program.pm3
2 files changed, 4 insertions, 1 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS
index 72f30e5af..6c770ee57 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -1,3 +1,5 @@
+- do not crash when trying to guess homedir before running another
+ process (mga#7403)
- harddrake2:
o remove useless "Autodetect printers" option
diff --git a/perl-install/run_program.pm b/perl-install/run_program.pm
index 3736f4dad..a45b5b79b 100644
--- a/perl-install/run_program.pm
+++ b/perl-install/run_program.pm
@@ -69,7 +69,8 @@ sub raw {
$uid = $ENV{USERHELPER_UID} && getpwuid($ENV{USERHELPER_UID});
$uid ||= common::get_parent_uid();
$options->{setuid} = getpwnam($uid) if $uid;
- $home = $uid->[7] if $uid;
+ my ($full_user) = grep { $_->[2] eq $uid } list_passwd();
+ $home = $full_user->[7] if $full_user;
}
local $ENV{HOME} = $home if $home;