admserv/newinst/src/ConfigDSDialogs.pm | 32 ++++++++++++++++++++------------
1 file changed, 20 insertions(+), 12 deletions(-)
New commits:
commit e855d30b07280bf15edf9fdcef301933987bb2b9
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Wed Mar 9 10:57:00 2011 -0800
Bug 476925 - Admin Server: Do not allow 8-bit passwords for the admin user
https://bugzilla.redhat.com/show_bug.cgi?id=476925
Description: Due to the following reasons, password of the admin
user is not supposed to include 8-bit characters.
1) Admin Console | Configure | Access does not take 8-bit password.
If such characters are entered, the characters are dropped.
(e.g., if "députés" is entered, the password will be "dputs".
2) Character encoding of Admin Express's login window depends on
browsers' implementation. And the server has no way to get
the character encoding information.
Despite of it, setup-ds-admin.pl accepts 8-bit admin user password.
This patch changes the behavior and rejects it.
diff --git a/admserv/newinst/src/ConfigDSDialogs.pm
b/admserv/newinst/src/ConfigDSDialogs.pm
index b390502..8ec9ea0 100644
--- a/admserv/newinst/src/ConfigDSDialogs.pm
+++ b/admserv/newinst/src/ConfigDSDialogs.pm
@@ -300,22 +300,30 @@ my $configdsadmin = new Dialog (
$self->{manager}->{inf}->{General}->{ConfigDirectoryAdminID}
= $ans;
}
} elsif ($index == 1) { # verify initial password
- my $test = $ans;
- if ($test) {
- $test =~ s/\s//g;
- }
- if (!$ans or (length($test) != length($ans))) {
- $self->{manager}->alert("dialog_configdsadmin_invalid");
+ if ($ans =~ /[\x00-\x7f]/) {
+ my $test = $ans;
+ if ($test) {
+ $test =~ s/\s//g;
+ }
+ if (!$ans or (length($test) != length($ans))) {
+
$self->{manager}->alert("dialog_configdsadmin_invalid");
+ } else {
+ $res = $DialogManager::NEXT;
+ $self->{firstpassword} = $ans; # save for next index
+ }
} else {
- $res = $DialogManager::NEXT;
- $self->{firstpassword} = $ans; # save for next index
+ $self->{manager}->alert("dialog_configdsadmin_invalid");
}
} elsif ($index == 2) { # verify second password
- if ($ans ne $self->{firstpassword}) {
- $self->{manager}->alert("dialog_configdsadmin_nomatch");
+ if ($ans =~ /[\x00-\x7f]/) {
+ if ($ans ne $self->{firstpassword}) {
+
$self->{manager}->alert("dialog_configdsadmin_nomatch");
+ } else {
+
$self->{manager}->{inf}->{General}->{ConfigDirectoryAdminPwd} = $ans;
+ $res = $DialogManager::NEXT;
+ }
} else {
- $self->{manager}->{inf}->{General}->{ConfigDirectoryAdminPwd}
= $ans;
- $res = $DialogManager::NEXT;
+ $self->{manager}->alert("dialog_configdsadmin_invalid");
}
}
return $res;