Description of problem: The "Directory server network port" field is accepting any values like Alhanumeric, Alphabets and special characters. It doesn't validate the port number at the prompt and hence the instance creation fails in the end. Version-Release number of selected component (if applicable): DS9.0 How reproducible: Consistently Steps to Reproduce: 1. Run setup-ds.pl script and pass all the valid entries except the port no. 2. Pass a alphanumeric value, say "12NEW" when it prompts for "Directory server network port": 3. Port number is not validated at the prompt and setup program proceeds with the instance creation. Actual results: Instance creation fails due to which the port is not valid. Expected results: Port number should be validated at the right place to avoid unnecessary failures. Additional info: error message displayed in the command prompt... Could not import LDIF file '/tmp/ldif7t5qmO.ldif'. Error: 256. Output: importing data ... [30/Nov/2009:13:41:24 +051800] dse - The entry cn=config in file /etc/dirsrv/slapd-alphaNport/dse.ldif is invalid, error code 1 (Operations error) - nsslapd-port: "123asss" is invalid, ports must range from 0 to 65535 [30/Nov/2009:13:41:24 +051800] dse - Could not load config file [dse.ldif] [30/Nov/2009:13:41:24 +051800] dse - Please edit the file to correct the reported problems and then restart the server. Error: Could not create directory server instance 'alphaNport'. Exiting . . . Log file is '/tmp/setupKUmlra.log'
Created attachment 407177 [details] 0001-Bug-542570-Directory-Server-port-number-is-not-valid.patch 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.
Comment on attachment 407177 [details] 0001-Bug-542570-Directory-Server-port-number-is-not-valid.patch This works for the case where you run setup-ds.pl interactively, but does not catch the case where the user has provided the value via cmd line (slapd.ServerPort=bogus) or in a .inf file.
Created attachment 409238 [details] 0001-Bug-542570-Directory-Server-port-number-is-not-valid.patch The patch has been modified to validate the port provided via slapd.ServerPort parameter as well.
*** Bug 574532 has been marked as a duplicate of this bug. ***
To ssh://git.fedorahosted.org/git/389/ds.git 78c5066..1d7f7f5 master -> master commit 1d7f7f52485922e9fa992de0e74ede1d44b81097 Author: Endi S. Dewata <edewata> Date: Sat Apr 17 00:08:35 2010 -0500 To ssh://git.fedorahosted.org/git/389/ds.git 7fd0ad8..6fa8766 Directory_Server_8_2_Branch -> Directory_Server_8_2_Branch commit 6fa876657c99509d770876b7c7c25dbebc8ebe53 Author: Endi S. Dewata <edewata> Date: Fri Apr 16 11:26:32 2010 -0500
verified RHEL 4 version: redhat-ds-base-8.2.0-2010060704.el4dsrv OUTPUT Running setup-ds.pl: The standard directory server network port number is 389. However, if you are not logged as the superuser, or port 389 is in use, the default value will be a random unused port number greater than 1024. If you want to use port 389, make sure that you are logged in as the superuser, that port 389 is not in use. Directory server network port [18261]: 12NEW The port 12NEW is not a valid port. Please choose a valid port.