summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-09-17 10:29:36 +0000
committerThierry Vignaud <tv@mageia.org>2012-09-17 10:29:36 +0000
commit2f247af65d67f1095d06b1f3695ebd3d7a8a6b39 (patch)
tree68ae5980fb6fd8fa90d463a67426475551ef21a1
parent250dcee065e54f545f690762efc0232f38b3a2fd (diff)
downloaddrakx-2f247af65d67f1095d06b1f3695ebd3d7a8a6b39.tar
drakx-2f247af65d67f1095d06b1f3695ebd3d7a8a6b39.tar.gz
drakx-2f247af65d67f1095d06b1f3695ebd3d7a8a6b39.tar.bz2
drakx-2f247af65d67f1095d06b1f3695ebd3d7a8a6b39.tar.xz
drakx-2f247af65d67f1095d06b1f3695ebd3d7a8a6b39.zip
(raw) do not crash when trying to guess homedir before running another process (mga#7403)
(backported from trunk)
-rw-r--r--perl-install/NEWS3
-rw-r--r--perl-install/run_program.pm3
2 files changed, 5 insertions, 1 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS
index dc9c3cb91..be16cb0e0 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -1,3 +1,6 @@
+- do not crash when trying to guess homedir before running another
+ process (mga#7403)
+
Version 14.21.2 - 5 September 2012
- autologin:
diff --git a/perl-install/run_program.pm b/perl-install/run_program.pm
index fbc721d82..2bd262c2a 100644
--- a/perl-install/run_program.pm
+++ b/perl-install/run_program.pm
@@ -61,7 +61,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;