summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-09-04 15:45:31 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-09-04 15:45:31 +0000
commit997cd903a80f4715c6dd6f621c1639bf2dc78a17 (patch)
tree4c3f319ef2f7a3baebe8a1de529503d812f1299b
parent6ca7d220f9116657035547e814bb039bc63cca2b (diff)
downloaddrakx-997cd903a80f4715c6dd6f621c1639bf2dc78a17.tar
drakx-997cd903a80f4715c6dd6f621c1639bf2dc78a17.tar.gz
drakx-997cd903a80f4715c6dd6f621c1639bf2dc78a17.tar.bz2
drakx-997cd903a80f4715c6dd6f621c1639bf2dc78a17.tar.xz
drakx-997cd903a80f4715c6dd6f621c1639bf2dc78a17.zip
(addUser): fix calling with a user already existing (mainly for installs keeping the / non-formatted, special for pixel)
-rw-r--r--perl-install/install_steps.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index 0159e1e3a..5f329bf12 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -722,8 +722,8 @@ sub addUser {
foreach (@$users) {
$_->{home} ||= "/home/$_->{name}";
- my $u = $_->{uid} || ($_->{oldu} = (stat("$p$_->{home}"))[4]);
- my $g = $_->{gid} || ($_->{oldg} = (stat("$p$_->{home}"))[5]);
+ my $u = $_->{uid} || ($_->{oldu} = (stat("$p$_->{home}"))[4]) || int getpwnam($_->{name});
+ my $g = $_->{gid} || ($_->{oldg} = (stat("$p$_->{home}"))[5]) || int getgrnam($_->{name});
#- search for available uid above 501 else initscripts may fail to change language for KDE.
if (!$u || getpwuid($u)) { for ($u = 501; getpwuid($u) || $uids{$u}; $u++) {} }
if (!$g) { for ($g = 501; getgrgid($g) || $gids{$g}; $g++) {} }