From 8045286272b953bc3c02b7f4b70c1a21c2dc7b8c Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Wed, 21 Nov 2007 20:27:38 +0000 Subject: Resolves: bug 371771 Bug Description: '.' (dot) in the server ID Reviewed by: nkinder (Thanks!) Fix Description: Remove . and , from the characters allowed in the server ID. Also use the more descriptive error message. Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none --- ldap/admin/src/scripts/DSDialogs.pm | 4 ++-- ldap/admin/src/scripts/Util.pm.in | 2 +- ldap/admin/src/scripts/setup-ds.res.in | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ldap/admin/src/scripts/DSDialogs.pm b/ldap/admin/src/scripts/DSDialogs.pm index 0af12b14..22fe512a 100644 --- a/ldap/admin/src/scripts/DSDialogs.pm +++ b/ldap/admin/src/scripts/DSDialogs.pm @@ -99,9 +99,9 @@ my $dsserverid = new Dialog ( my $res = $DialogManager::SAME; my $path = $self->{manager}->{setup}->{configdir} . "/slapd-" . $ans; if (!isValidServerID($ans)) { - $self->{manager}->alert("dialog_dsserverid_error", $ans); + $self->{manager}->alert("error_invalid_serverid", $ans); } elsif (-d $path) { - $self->{manager}->alert("dialog_dsserverid_inuse", $ans); + $self->{manager}->alert("error_server_already_exists", $path); } else { $res = $DialogManager::NEXT; $self->{manager}->{inf}->{slapd}->{ServerIdentifier} = $ans; diff --git a/ldap/admin/src/scripts/Util.pm.in b/ldap/admin/src/scripts/Util.pm.in index 7dd89b9f..7b2e1a5c 100644 --- a/ldap/admin/src/scripts/Util.pm.in +++ b/ldap/admin/src/scripts/Util.pm.in @@ -107,7 +107,7 @@ sub isValidDN { sub isValidServerID { my $servid = shift; - my $validchars = '#%,.:\w@_-'; + my $validchars = '#%:\w@_-'; return $servid =~ /^[$validchars]+$/o; } diff --git a/ldap/admin/src/scripts/setup-ds.res.in b/ldap/admin/src/scripts/setup-ds.res.in index db2939e1..4ffdc6b2 100644 --- a/ldap/admin/src/scripts/setup-ds.res.in +++ b/ldap/admin/src/scripts/setup-ds.res.in @@ -108,7 +108,7 @@ invalid port number, or the port already being in use by another\ program, or low port restriction. Please choose another value for\ ServerPort. Error: $!\n error_invalid_serverid = The ServerIdentifier '%s' contains invalid characters. It must\ -contain only alphanumeric characters and the following: #%,.:@_-\n +contain only alphanumeric characters and the following: #%:@_-\n\n error_opening_scripttmpl = Could not open the script template file '%s'. Error: %s\n error_creating_directory = Could not create directory '%s'. Error: %s\n error_chowning_directory = Could not change ownership of directory '%s' to userid '%s': Error: %s\n -- cgit