From a7b2cdc8c3ee5fcc23155d791cafc48f554008f2 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Fri, 16 Apr 2010 11:26:32 -0500 Subject: Bug 542570 - Directory Server port number is not validated in the beginning. https://bugzilla.redhat.com/show_bug.cgi?id=542570 Resolves: bug 542570 Bug Description: Directory Server port number is not validated in the beginning. Fix Description: The code has been modified to validate the port value from the beginning of the string to the end to ensure that it only contains digits and to generate the appropriate error message. Reviewed by: rmeggins (and pushed) --- ldap/admin/src/scripts/DSCreate.pm.in | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ldap/admin/src/scripts/DSCreate.pm.in') diff --git a/ldap/admin/src/scripts/DSCreate.pm.in b/ldap/admin/src/scripts/DSCreate.pm.in index dcd55afb..a156f108 100644 --- a/ldap/admin/src/scripts/DSCreate.pm.in +++ b/ldap/admin/src/scripts/DSCreate.pm.in @@ -82,6 +82,9 @@ sub checkPort { } } + if ($inf->{slapd}->{ServerPort} !~ /^\d+$/) { + return ('error_port_invalid', $inf->{slapd}->{ServerPort}); + } if (!portAvailable($inf->{slapd}->{ServerPort})) { return ('error_port_available', $inf->{slapd}->{ServerPort}, $!); } -- cgit