summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpad <pad@mandriva.com>1999-09-06 10:41:53 +0000
committerpad <pad@mandriva.com>1999-09-06 10:41:53 +0000
commit8ba1a1156e59eef70ea530272b4446f3ba445d73 (patch)
tree3d1301b1120d5c7cac0f2f0cb417660e0d34d47b
parenta53cc3a2866b729ce7f6a36ca9a66cd6afd55a74 (diff)
downloaddrakx-8ba1a1156e59eef70ea530272b4446f3ba445d73.tar
drakx-8ba1a1156e59eef70ea530272b4446f3ba445d73.tar.gz
drakx-8ba1a1156e59eef70ea530272b4446f3ba445d73.tar.bz2
drakx-8ba1a1156e59eef70ea530272b4446f3ba445d73.tar.xz
drakx-8ba1a1156e59eef70ea530272b4446f3ba445d73.zip
PAD possible BUG with setRootPassword and addUser
-rw-r--r--perl-install/install_steps_interactive.pm22
1 files changed, 10 insertions, 12 deletions
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index fd96d1e32..b3008775a 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -393,7 +393,7 @@ wish to access and any applicable user name and password."),
#------------------------------------------------------------------------------
sub setRootPassword($) {
my ($o) = @_;
- $o->{superuser} ||= {};
+ $o->{superuser}{password2} ||= $o->{user}{password} ||= "";
my %sup = %{$o->{superuser}};
$o->ask_from_entries_ref(_("Set root password"),
@@ -414,29 +414,27 @@ sub setRootPassword($) {
#------------------------------------------------------------------------------
sub addUser($) {
my ($o) = @_;
- $o->{user} ||= {};
$o->{user}{password2} ||= $o->{user}{password} ||= "";
- my $u = $o->{user};
+ my %u = %{$o->{user}};
my @fields = qw(realname name password password2);
-
my @shells = install_any::shells($o);
$o->ask_from_entries_ref(
_("Add user"),
_("Enter a user"),
[ _("Real name"), _("User name"), _("Password"), _("Password (again)"), _("Shell") ],
- [ (map { \$u->{$_}} @fields),
- {val => \$u->{shell}, list => \@shells, not_edit => !$::expert},
+ [ (map { \$u{$_}} @fields),
+ {val => \$u{shell}, list => \@shells, not_edit => !$::expert},
],
focus_out => sub {
- print "int $_[0], $u->{name}, $u->{realname},\n";
- ($u->{name}) = $u->{realname} =~ /\U(\S+)/ if $_[0] eq 0;
+ print "int $_[0], $u{name}, $u{realname}, $u{shell}\n";
+ ($u{name}) = $u{realname} =~ /\U(\S+)/ if $_[0] eq 0;
},
complete => sub {
- $u->{password} eq $u->{password2} or $o->ask_warn('', [ _("You must enter the same password"), _("Please try again") ]), return (1,2);
- (length $u->{password} < 6) and $o->ask_warn('', _("This password is too simple")), return (1,1);
- $u->{name} or $o->ask_warn('', _("Please give a user name")), return (1,0);
- $u->{name} =~ /^[a-z0-9_-]+$/ or $o->ask_warn('', _("The user name must contain only lower cased letters, numbers, `-' and `_'")), return (1,0);
+ $u{password} eq $u{password2} or $o->ask_warn('', [ _("You must enter the same password"), _("Please try again") ]), return (1,2);
+ (length $u{password} < 6) and $o->ask_warn('', _("This password is too simple")), return (1,1);
+ $u{name} or $o->ask_warn('', _("Please give a user name")), return (1,0);
+ $u{name} =~ /^[a-z0-9_-]+$/ or $o->ask_warn('', _("The user name must contain only lower cased letters, numbers, `-' and `_'")), return (1,0);
return 0;
},
);