summaryrefslogtreecommitdiffstats
path: root/perl-install/install_steps.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-11-30 10:23:54 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-11-30 10:23:54 +0000
commitd2afb181655c6c89f17fd7dc184a6dc790bfc099 (patch)
tree57eca3ff147b60a096693effc1acfb0d5f2526e3 /perl-install/install_steps.pm
parentd11474959ade7795ba689e3be35ef7b8868c0747 (diff)
downloaddrakx-d2afb181655c6c89f17fd7dc184a6dc790bfc099.tar
drakx-d2afb181655c6c89f17fd7dc184a6dc790bfc099.tar.gz
drakx-d2afb181655c6c89f17fd7dc184a6dc790bfc099.tar.bz2
drakx-d2afb181655c6c89f17fd7dc184a6dc790bfc099.tar.xz
drakx-d2afb181655c6c89f17fd7dc184a6dc790bfc099.zip
- rely on adduser(8) to set the users password instead of using write_passwd_user()
- use adduser(8) during install (we now use the same code during and after install)
Diffstat (limited to 'perl-install/install_steps.pm')
-rw-r--r--perl-install/install_steps.pm40
1 files changed, 1 insertions, 39 deletions
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index 0752c50d5..b91ac2eed 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -777,45 +777,7 @@ sub addUser {
symlinkf("$::prefix/etc/group", '/etc/group');
}
- my (%uids, %gids);
- foreach (glob_("$::prefix/home")) { my ($u, $g) = (stat($_))[4,5]; $uids{$u} = 1; $gids{$g} = 1 }
-
- foreach (@$users) {
- $_->{home} ||= "/home/$_->{name}";
-
- my $u = $_->{uid} || ($_->{oldu} = (stat("$::prefix$_->{home}"))[4]) || int getpwnam($_->{name});
- my $g = $_->{gid} || ($_->{oldg} = (stat("$::prefix$_->{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++) {} }
-
- $_->{uid} = $u; $uids{$u} = 1;
- $_->{gid} = $g; $gids{$g} = 1;
- }
-
- any::write_passwd_user($_, $o->{authentication}{md5}) foreach @$users;
-
- append_to_file("$::prefix/etc/group",
- map { "$_->{name}:x:$_->{gid}:\n" } grep { ! getgrgid($_->{gid}) } @$users);
-
- foreach my $u (@$users) {
- if (! -d "$::prefix$u->{home}") {
- my $mode = $o->{security} < 2 ? 0755 : 0750;
- eval { cp_af("$::prefix/etc/skel", "$::prefix$u->{home}") };
- if ($@) {
- log::l("copying of skel failed: $@"); mkdir("$::prefix$u->{home}", $mode);
- } else {
- chmod $mode, "$::prefix$u->{home}";
- }
- }
- require commands;
- eval { commands::chown_("-r", "$u->{uid}.$u->{gid}", "$::prefix$u->{home}") }
- if $u->{uid} != $u->{oldu} || $u->{gid} != $u->{oldg};
- }
- #- since we wrote the password in /etc/passwd, we must convert to shadow
- run_program::rooted($::prefix, 'pwconv') if $o->{authentication}{shadow};
-
- any::addUsers($users);
+ any::add_users($users, $o->{authentication});
if ($o->{autologin}) {
$o->{desktop} ||= first(any::sessions());