summaryrefslogtreecommitdiffstats
path: root/perl-install/install_steps.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-06-05 16:38:06 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-06-05 16:38:06 +0000
commitebf8b4f27c85fce7f150373e4390002a12cd335a (patch)
treecff1359908472f1d8033b7a9ce8b7b15ea7600df /perl-install/install_steps.pm
parent13d8a216905f1fedce666603e2779b5e9bdf302e (diff)
downloaddrakx-backup-do-not-use-ebf8b4f27c85fce7f150373e4390002a12cd335a.tar
drakx-backup-do-not-use-ebf8b4f27c85fce7f150373e4390002a12cd335a.tar.gz
drakx-backup-do-not-use-ebf8b4f27c85fce7f150373e4390002a12cd335a.tar.bz2
drakx-backup-do-not-use-ebf8b4f27c85fce7f150373e4390002a12cd335a.tar.xz
drakx-backup-do-not-use-ebf8b4f27c85fce7f150373e4390002a12cd335a.zip
(addUser): accept gid's which already exist, and don't them in /etc/group
(for auto installs)
Diffstat (limited to 'perl-install/install_steps.pm')
-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 2b6eb83fb..7e0d3f3f4 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -589,7 +589,7 @@ sub addUser {
my $g = $_->{gid} || ($_->{oldg} = (stat("$p$_->{home}"))[5]);
#- 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 || getgrgid($g)) { for ($g = 501; getgrgid($g) || $gids{$g}; $g++) {} }
+ if (!$g ) { for ($g = 501; getgrgid($g) || $gids{$g}; $g++) {} }
$_->{uid} = $u; $uids{$u} = 1;
$_->{gid} = $g; $gids{$g} = 1;
@@ -598,7 +598,7 @@ sub addUser {
any::write_passwd_user($p, $_, $o->{authentication}{md5}) foreach @$users;
open F, ">> $p/etc/group" or die "can't append to group file: $!";
- print F "$_->{name}:x:$_->{gid}:\n" foreach @$users;
+ print F "$_->{name}:x:$_->{gid}:\n" foreach grep { ! getgrgid($_->{gid}) } @$users;
foreach my $u (@$users) {
if (! -d "$p$u->{home}") {