diff options
-rw-r--r-- | perl-install/any.pm | 9 | ||||
-rw-r--r-- | perl-install/install_steps_interactive.pm | 3 | ||||
-rwxr-xr-x | perl-install/standalone/adduserdrake | 2 |
3 files changed, 8 insertions, 6 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm index 67d540631..f49318924 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -495,7 +495,7 @@ sub inspect { } sub ask_user_one { - my ($in, $users, $security, %options) = @_; + my ($in, $users, $security, $u, %options) = @_; my @icons = facesnames(); @@ -508,7 +508,6 @@ sub ask_user_one { ctools => N("access to compilation tools"), ); - my $u; $u->{password2} ||= $u->{password} ||= ''; $u->{shell} ||= '/bin/bash'; my $names = @$users ? N("(already added %s)", join(", ", map { $_->{realname} || $_->{name} } @$users)) : ''; @@ -563,10 +562,12 @@ sub ask_user_one { } sub ask_users { - my ($in, $users, $security) = @_; + my ($in, $users, $security, $suggested_names) = @_; while (1) { - ask_user_one($in, $users, $security) and return; + my $u = {}; + $u->{name} = shift @$suggested_names; + ask_user_one($in, $users, $security, $u) and return; } } diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index 9be687103..c269ff682 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -1181,7 +1181,8 @@ sub addUser { if !member('mandrake', map { $_->{name} } @{$o->{users}}); } if ($o->{security} >= 1 || $clicked) { - any::ask_users($o, $o->{users}, $o->{security}); + my @suggested_names = @{$o->{users}} ? () : all("$::prefix/home"); + any::ask_users($o, $o->{users}, $o->{security}, \@suggested_names); } add2hash($o, any::get_autologin()); any::autologin($o, $o); diff --git a/perl-install/standalone/adduserdrake b/perl-install/standalone/adduserdrake index 4db218671..40659017f 100755 --- a/perl-install/standalone/adduserdrake +++ b/perl-install/standalone/adduserdrake @@ -19,7 +19,7 @@ if (my @l = grep { ! /^-/ } @ARGV) { $users = [ map { { name => $_, realname => $_ } } @l ]; } else { $in = 'interactive'->vnew('su'); - any::ask_users($in, $users, $ENV{SECURE_LEVEL}); + any::ask_users($in, $users, $ENV{SECURE_LEVEL}, []); } system("adduser", $_->{name}) foreach @$users; |