Bug 2151948

Summary: dscreate for non-root user suggests privileged ports
Product: Red Hat Directory Server Reporter: Viktor Ashirov <vashirov>
Component: 389-ds-baseAssignee: Pierre Rogier <progier>
Status: CLOSED ERRATA QA Contact: LDAP QA Team <idm-ds-qe-bugs>
Severity: high Docs Contact: Zuzana Zoubkova <zzoubkov>
Priority: high    
Version: 12.1CC: aadhikar, bsmejkal, emartyny, idm-ds-dev-bugs, mreynolds, pasik, progier
Target Milestone: DS12.2Keywords: Triaged
Target Release: dirsrv-12.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: sync-to-jira
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-30 09:40:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Viktor Ashirov 2022-12-08 16:59:51 UTC
Description of problem:
dscreate in interactive mode for non-root user suggests default ports 389 and 636. 

$ dscreate  interactive
Install Directory Server (interactive mode)
===========================================
...

Enter port number [389]: 1389

Create self-signed certificate database [yes]:

Enter secure port number [636]: 1636

...

We already do checks if the port is available or not, we should also check if the user is root and is able to use these ports. And if not, provide empty defaults. 

Version-Release number of selected component (if applicable):
389-ds-base-2.1.5-4.module+el9dsrv+16995+8a75ed16.x86_64

How reproducible:
always

Steps to Reproduce:
$ mkdir -p bin
$ dscreate ds-root $HOME/test $HOME/bin
$ hash -r
$ dscreate interactive

Comment 3 Akshay Adhikari 2023-05-08 13:58:29 UTC
Build Tested: 389-ds-base-2.2.7-2.module+el9dsrv+18726+78959e84.x86_64

Steps to Reproduce: 
$ mkdir -p bin
$ dscreate ds-root $HOME/test $HOME/bin
$ hash -r
$ dscreate interactive
Install Directory Server (interactive mode)
===========================================
...

Enter the instance name [ds-test]: 

Enter port number [1389]: 

Create self-signed certificate database [yes]: 

Enter secure port number [1636]: 

....


The server suggests a different set of ports for non-root users, which the user has access to, Marking as VERIFIED.

Comment 5 errata-xmlrpc 2023-05-30 09:40:35 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (redhat-ds:12 bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:3344