admserv/newinst/src/ConfigDSDialogs.pm | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
New commits:
commit 58600d4b814fb6a39bd672a4ebb5b7ac0415605e
Author: Noriko Hosoi <nhosoi(a)jiji.usersys.redhat.com>
Date: Wed Jul 27 10:55:41 2011 -0700
Bug 476925 - Admin Server: Do not allow 8-bit passwords for
the admin user
https://bugzilla.redhat.com/show_bug.cgi?id=476925
Description: There was a bug in the code to check whether a
password string contains a character with the 8-th bit on.
This patch fixes it.
diff --git a/admserv/newinst/src/ConfigDSDialogs.pm
b/admserv/newinst/src/ConfigDSDialogs.pm
index 8ec9ea0..3501870 100644
--- a/admserv/newinst/src/ConfigDSDialogs.pm
+++ b/admserv/newinst/src/ConfigDSDialogs.pm
@@ -300,7 +300,9 @@ my $configdsadmin = new Dialog (
$self->{manager}->{inf}->{General}->{ConfigDirectoryAdminID}
= $ans;
}
} elsif ($index == 1) { # verify initial password
- if ($ans =~ /[\x00-\x7f]/) {
+ if ($ans =~ /[\x80-\xff]/) {
+ $self->{manager}->alert("dialog_configdsadmin_invalid");
+ } else {
my $test = $ans;
if ($test) {
$test =~ s/\s//g;
@@ -311,19 +313,17 @@ my $configdsadmin = new Dialog (
$res = $DialogManager::NEXT;
$self->{firstpassword} = $ans; # save for next index
}
- } else {
- $self->{manager}->alert("dialog_configdsadmin_invalid");
}
} elsif ($index == 2) { # verify second password
- if ($ans =~ /[\x00-\x7f]/) {
+ if ($ans =~ /[\x80-\xff]/) {
+ $self->{manager}->alert("dialog_configdsadmin_invalid");
+ } else {
if ($ans ne $self->{firstpassword}) {
$self->{manager}->alert("dialog_configdsadmin_nomatch");
} else {
$self->{manager}->{inf}->{General}->{ConfigDirectoryAdminPwd} = $ans;
$res = $DialogManager::NEXT;
}
- } else {
- $self->{manager}->alert("dialog_configdsadmin_invalid");
}
}
return $res;