summaryrefslogtreecommitdiffstats
path: root/perl-install/install_steps.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/install_steps.pm')
-rw-r--r--perl-install/install_steps.pm14
1 files changed, 4 insertions, 10 deletions
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index b9ffd80ee..6e8bff2e9 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -232,16 +232,10 @@ sub addUser($) {
my $p = $o->{prefix};
my @passwd = cat_("$p/etc/passwd");;
- !$u{name} || member($u{name}, map { (split ':')[0] } @passwd) and return;
-
- unless ($u{uid}) {
- my @uids = map { (split ':')[2] } @passwd;
- for ($u{uid} = 500; member($u{uid}, @uids); $u{uid}++) {}
- }
- unless ($u{gid}) {
- my @gids = map { (split ':')[2] } cat_("$p/etc/group");
- for ($u{gid} = 500; member($u{gid}, @gids); $u{gid}++) {}
- }
+ !$u{name} || getpwnam($u{name}) and return;
+
+ for ($u{uid} = 500; getpwuid($u{uid}); $u{uid}++) {}
+ for ($u{gid} = 500; getgrgid($u{gid}); $u{gid}++) {}
$u{home} ||= "/home/$u{name}";
$u{password} = crypt_($u{password}) if $u{password};