aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-03-21 15:09:43 +0000
committerThierry Vignaud <tv@mandriva.org>2007-03-21 15:09:43 +0000
commit104207a9c0af17d2fb4b0c510ec0d3de9cc04b4b (patch)
tree56c6f4db5e864dd2dbf715decc372e19e79646de
parentf73cea963a17e12f46572736e614d8f1bda46279 (diff)
downloadrpmdrake-104207a9c0af17d2fb4b0c510ec0d3de9cc04b4b.tar
rpmdrake-104207a9c0af17d2fb4b0c510ec0d3de9cc04b4b.tar.gz
rpmdrake-104207a9c0af17d2fb4b0c510ec0d3de9cc04b4b.tar.bz2
rpmdrake-104207a9c0af17d2fb4b0c510ec0d3de9cc04b4b.tar.xz
rpmdrake-104207a9c0af17d2fb4b0c510ec0d3de9cc04b4b.zip
handle root directory not being /root
-rw-r--r--rpmdrake.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/rpmdrake.pm b/rpmdrake.pm
index 1fa71386..429c328e 100644
--- a/rpmdrake.pm
+++ b/rpmdrake.pm
@@ -150,8 +150,8 @@ sub myexit {
ugtk2::exit(undef, @_);
}
-$ENV{HOME} = '/root' if $> == 0;
-$ENV{HOME} ||= '/root';
+my ($root) = grep { $_->[2] == 0 } list_passwd();
+$ENV{HOME} = $> == 0 ? $root->[7] : $ENV{HOME} || '/root';
our $configfile = "$ENV{HOME}/.rpmdrake";
our ($already_splashed, $changelog_first_config, $max_info_in_descr, $tree_flat, $tree_mode);