summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-12-24 00:26:22 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-12-24 00:26:22 +0000
commit63ee6b158bf74b995d1e6ed294b6d4b3f3e95ca5 (patch)
treedb9522b8dc1c02af74c6c5050a58e7fd002bdc55 /perl-install/standalone
parent685a29887953bf36c2d0dab4e7bce8a64bd8934e (diff)
downloaddrakx-63ee6b158bf74b995d1e6ed294b6d4b3f3e95ca5.tar
drakx-63ee6b158bf74b995d1e6ed294b6d4b3f3e95ca5.tar.gz
drakx-63ee6b158bf74b995d1e6ed294b6d4b3f3e95ca5.tar.bz2
drakx-63ee6b158bf74b995d1e6ed294b6d4b3f3e95ca5.tar.xz
drakx-63ee6b158bf74b995d1e6ed294b6d4b3f3e95ca5.zip
no_comment
Diffstat (limited to 'perl-install/standalone')
-rwxr-xr-xperl-install/standalone/adduserdrake30
1 files changed, 15 insertions, 15 deletions
diff --git a/perl-install/standalone/adduserdrake b/perl-install/standalone/adduserdrake
index 490f09b7e..0bc27dd94 100755
--- a/perl-install/standalone/adduserdrake
+++ b/perl-install/standalone/adduserdrake
@@ -4,6 +4,7 @@ use lib qw(/usr/lib/libDrakX);
use common qw(:common :functional :system :file);
use interactive;
+use any;
local $_ = join '', @ARGV;
@@ -50,26 +51,25 @@ if ($in->ask_from_entries_refH(
},
)) {
push @users, $u;
- $u->{pw} = $isMD5 ? c::crypt_md5($u->{password}, salt(8)) : crypt($u->{password}, salt(2));
- system("adduser $u->{name}");
- substInFile {
+ $u->{pw} = $isMD5 ? c::crypt_md5($u->{password}, salt(8)) : crypt($u->{password}, salt(2));
+ $u = {};
+ goto new;
+}
+my @u = map { $_->{name} } @users;
+
+system("adduser $_") foreach @u;
+any::addUsers('', @u);
+
+substInFile {
+ foreach my $u (@users) {
if (/^$u->{name}:/) {
chomp;
my %l; @l{@etc_pass_fields} = split ':';
add2hash($u, \%l);
$_ = join(':', @$u{@etc_pass_fields}) . "\n";
}
- } "/etc/passwd";
-
- system("pwconv") if $isShadow;
-
- my $msec = "/etc/security/msec";
- substInFile { s/^$u->{name}\n//; $_ .= "$u->{name}\n" if eof } "$msec/user.conf" if -d $msec;
- system("$msec/init-sh/grpuser.sh --refresh");
-
- $u = {};
- goto new;
-}
-
+ }
+} "/etc/passwd";
+system("pwconv") if $isShadow;
$in->exit(0);