Bug 1654101

Summary: dscreate related issues
Product: Red Hat Enterprise Linux 8 Reporter: Amita Sharma <amsharma>
Component: 389-ds-baseAssignee: mreynolds
Status: CLOSED CURRENTRELEASE QA Contact: RHDS QE <ds-qe-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.0CC: amsharma, lkrispen, mhonek, mreynolds, msauton, nkinder, rmeggins, spichugi, tbordaz, tmihinto, vashirov
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 389-ds-base-1.4.0.20-1.module+el8+2553+e9a4c637 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-13 23:03:16 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 Amita Sharma 2018-11-28 04:16:19 UTC
Description of problem:
dscreate related issues

Version-Release number of selected component (if applicable):
389-ds-base-1.4.0.19-2.module+el8+1+36e60e1d.x86_64

How reproducible:
Always

Steps to Reproduce:
1. There is no provision to go back to the previous step while using dscreate interactive command.

2. There was the option given in the steup-ds.pl as 
"- Type "Control-B" or the word "back" then "Enter" to go back to the previous screen"

But this does not work with dscreate interactive

Comment 1 Têko Mihinto 2018-11-28 15:38:19 UTC
Description of problem:

dscreate should check for a valid instance name before attempting to create the instance.

Version-Release number of selected component (if applicable):
389-ds-base-1.4.0.19-2.module+el8+1+36e60e1d.x86_64


How reproducible:
Always.

Steps to Reproduce:
1. Launch dscreate in interactive mode and use an invalid instance name:

# dscreate interactive
Install Directory Server (interactive mode)
===========================================

Enter system's hostname [rhds-test-day-7]:

Use strict hostname verification (set to "no" if using GSSAPI behind a load balancer) [yes]: no

Enter the instance name [rhds-test-day-7]: Test_Teko 1 2 3    
Server identifier can not contain a space

Enter the instance name [rhds-test-day-7]: Test_Têko

Enter port number []: 1389

Create self-signed certificate database [yes]: NO

Enter Directory Manager DN [cn=Directory Manager]:

Enter the Directory Manager password:
Confirm the Directory Manager Password:

Enter the database suffix (or enter "none" to skip) [dc=rhds-test-day-7]: dc=Test,dc=com

Create sample entries in the suffix [no]: yes

Are you ready to install? [no]: yes

Starting installation...
Invalid unit name "dirsrv@Test_Têko" was escaped as "dirsrv@Test_T\xc3\xaako" (maybe you should use systemd-escape?)
Created symlink /etc/systemd/system/multi-user.target.wants/dirsrv@Test_T\xc3\xaako.service → /usr/lib/systemd/system/dirsrv@.service.
Invalid unit name "dirsrv@Test_Têko" was escaped as "dirsrv@Test_T\xc3\xaako" (maybe you should use systemd-escape?)
Job for dirsrv@Test_T\xc3\xaako.service failed because of unavailable resources or another system error.
See "systemctl status "dirsrv@Test_T\\xc3\\xaako.service"" and "journalctl -xe" for details.
Error: Command '['/usr/bin/systemctl', 'start', 'dirsrv@Test_Têko']' returned non-zero exit status 1.

#

2. Check the status:

# systemctl status "dirsrv@Test_T\\xc3\\xaako.service"
● dirsrv@Test_T\xc3\xaako.service - 389 Directory Server Test_T\xc3\xaako.
   Loaded: loaded (/usr/lib/systemd/system/dirsrv@.service; enabled; vendor preset: disabled)
   Active: failed (Result: resources)

Nov 28 09:39:29 rhds-test-day-7 systemd[1]: /usr/lib/systemd/system/dirsrv@.service:40: .include directives are deprecated, and support for them will be removed in a future version of systemd. Please use>
Nov 28 09:39:29 rhds-test-day-7 systemd[1]: /usr/lib/systemd/system/dirsrv@.service:40: .include directives are deprecated, and support for them will be removed in a future version of systemd. Please use>
Nov 28 09:39:35 rhds-test-day-7 systemd[1]: dirsrv@Test_T\xc3\xaako.service: Failed to load environment files: No such file or directory
Nov 28 09:39:35 rhds-test-day-7 systemd[1]: dirsrv@Test_T\xc3\xaako.service: Failed to run 'start-pre' task: No such file or directory
Nov 28 09:39:35 rhds-test-day-7 systemd[1]: dirsrv@Test_T\xc3\xaako.service: Failed with result 'resources'.
Nov 28 09:39:35 rhds-test-day-7 systemd[1]: Failed to start 389 Directory Server Test_T\xc3\xaako..
Nov 28 10:22:23 rhds-test-day-7 systemd[1]: /usr/lib/systemd/system/dirsrv@.service:40: .include directives are deprecated, and support for them will be removed in a future version of systemd. Please use>


Actual results:
dscreate accepts the invalid instance name and the creation fails.

Expected results:
dscreate should reject invalid instance names.

Additional info:

Comment 2 Têko Mihinto 2018-11-28 16:31:10 UTC
Description of problem:
dscreate should skip the step "Create sample entries in the suffix" if no suffix is created.

Steps to Reproduce:
1. Launch dscreate in interactive mode
2. Select "none" for the step "Enter the database suffix"
3. Select "yes" for the step "Create sample entries in the suffix"
4. Check in the dse.ldif file that no suffix is created ( thus no sample entry ).

# dscreate interactive
Install Directory Server (interactive mode)
===========================================
...
Enter the database suffix (or enter "none" to skip) [dc=rhds-test-day-7]: none

Create sample entries in the suffix [no]: yes

Are you ready to install? [no]: yes

Starting installation...
Created symlink /etc/systemd/system/multi-user.target.wants/dirsrv → /usr/lib/systemd/system/dirsrv@.service.
Completed installation for test
#

# grep -ic nsslapd-suffix ./dse.ldif
0
#

Comment 3 Marc Sauton 2018-11-28 18:29:10 UTC
related to comment 2:
in one of my tests, regardless of interactive or from-file with or without sample entries, dscreate did NOT create a backend for userroot under cn=config, no db either, no suffix entry.

Comment 4 Marc Sauton 2018-11-28 20:16:30 UTC
bz 1654451 - dscreate permissions and SELinux labels "too relaxed/open", "incorrect"
https://bugzilla.redhat.com/1654451

Comment 7 Amita Sharma 2019-01-08 08:36:54 UTC
(In reply to Têko Mihinto from comment #1)
> Description of problem:
> 
> dscreate should check for a valid instance name before attempting to create
> the instance.
> 
> Version-Release number of selected component (if applicable):
> 389-ds-base-1.4.0.19-2.module+el8+1+36e60e1d.x86_64
> 
> 
> How reproducible:
> Always.
> 
> Steps to Reproduce:
> 1. Launch dscreate in interactive mode and use an invalid instance name:
> 
> # dscreate interactive
> Install Directory Server (interactive mode)
> ===========================================
> 
> Enter system's hostname [rhds-test-day-7]:
> 
> Use strict hostname verification (set to "no" if using GSSAPI behind a load
> balancer) [yes]: no
> 
> Enter the instance name [rhds-test-day-7]: Test_Teko 1 2 3    
> Server identifier can not contain a space
> 
> Enter the instance name [rhds-test-day-7]: Test_Têko
> 
> Enter port number []: 1389
> 
> Create self-signed certificate database [yes]: NO
> 
> Enter Directory Manager DN [cn=Directory Manager]:
> 
> Enter the Directory Manager password:
> Confirm the Directory Manager Password:
> 
> Enter the database suffix (or enter "none" to skip) [dc=rhds-test-day-7]:
> dc=Test,dc=com
> 
> Create sample entries in the suffix [no]: yes
> 
> Are you ready to install? [no]: yes
> 
> Starting installation...
> Invalid unit name "dirsrv@Test_Têko" was escaped as
> "dirsrv@Test_T\xc3\xaako" (maybe you should use systemd-escape?)
> Created symlink
> /etc/systemd/system/multi-user.target.wants/dirsrv@Test_T\xc3\xaako.service
> → /usr/lib/systemd/system/dirsrv@.service.
> Invalid unit name "dirsrv@Test_Têko" was escaped as
> "dirsrv@Test_T\xc3\xaako" (maybe you should use systemd-escape?)
> Job for dirsrv@Test_T\xc3\xaako.service failed because of unavailable
> resources or another system error.
> See "systemctl status "dirsrv@Test_T\\xc3\\xaako.service"" and "journalctl
> -xe" for details.
> Error: Command '['/usr/bin/systemctl', 'start', 'dirsrv@Test_Têko']'
> returned non-zero exit status 1.
> 
> #
> 
> 2. Check the status:
> 
> # systemctl status "dirsrv@Test_T\\xc3\\xaako.service"
> ● dirsrv@Test_T\xc3\xaako.service - 389 Directory Server Test_T\xc3\xaako.
>    Loaded: loaded (/usr/lib/systemd/system/dirsrv@.service; enabled; vendor
> preset: disabled)
>    Active: failed (Result: resources)
> 
> Nov 28 09:39:29 rhds-test-day-7 systemd[1]:
> /usr/lib/systemd/system/dirsrv@.service:40: .include directives are
> deprecated, and support for them will be removed in a future version of
> systemd. Please use>
> Nov 28 09:39:29 rhds-test-day-7 systemd[1]:
> /usr/lib/systemd/system/dirsrv@.service:40: .include directives are
> deprecated, and support for them will be removed in a future version of
> systemd. Please use>
> Nov 28 09:39:35 rhds-test-day-7 systemd[1]: dirsrv@Test_T\xc3\xaako.service:
> Failed to load environment files: No such file or directory
> Nov 28 09:39:35 rhds-test-day-7 systemd[1]: dirsrv@Test_T\xc3\xaako.service:
> Failed to run 'start-pre' task: No such file or directory
> Nov 28 09:39:35 rhds-test-day-7 systemd[1]: dirsrv@Test_T\xc3\xaako.service:
> Failed with result 'resources'.
> Nov 28 09:39:35 rhds-test-day-7 systemd[1]: Failed to start 389 Directory
> Server Test_T\xc3\xaako..
> Nov 28 10:22:23 rhds-test-day-7 systemd[1]:
> /usr/lib/systemd/system/dirsrv@.service:40: .include directives are
> deprecated, and support for them will be removed in a future version of
> systemd. Please use>
> 
> 
> Actual results:
> dscreate accepts the invalid instance name and the creation fails.
> 
> Expected results:
> dscreate should reject invalid instance names.
> 
> Additional info:

This is working fine -
[root@server-rhel8 ds]# dscreate interactive
Install Directory Server (interactive mode)
===========================================

Enter system's hostname [server-rhel8.example.com]: 

Use strict hostname verification (set to "no" if using GSSAPI behind a load balancer) [yes]: 

Enter the instance name [server-rhel8]: Test_Teko 1 2 3
Server identifier can not contain a space

Enter the instance name [server-rhel8]: Test_Têko
Server identifier can not contain non ascii characters

Enter the instance name [server-rhel8]: @#$
Server identifier has invalid characters, please choose a different value

Enter the instance name [server-rhel8]: 0

Enter port number [389]: 

Create self-signed certificate database [yes]: 

Enter secure port number [636]: 

Enter Directory Manager DN [cn=Directory Manager]: 

Enter the Directory Manager password: 
Confirm the Directory Manager Password: 

Enter the database suffix (or enter "none" to skip) [dc=server-rhel8,dc=example,dc=com]: dc=example,dc=com

Create sample entries in the suffix [no]: yes

Are you ready to install? [no]: yes

Starting installation...
Created symlink /etc/systemd/system/multi-user.target.wants/dirsrv → /usr/lib/systemd/system/dirsrv@.service.
Completed installation for 0

Comment 8 Amita Sharma 2019-01-08 08:39:59 UTC
(In reply to Têko Mihinto from comment #2)
> Description of problem:
> dscreate should skip the step "Create sample entries in the suffix" if no
> suffix is created.
> 
> Steps to Reproduce:
> 1. Launch dscreate in interactive mode
> 2. Select "none" for the step "Enter the database suffix"
> 3. Select "yes" for the step "Create sample entries in the suffix"
> 4. Check in the dse.ldif file that no suffix is created ( thus no sample
> entry ).
> 
> # dscreate interactive
> Install Directory Server (interactive mode)
> ===========================================
> ...
> Enter the database suffix (or enter "none" to skip) [dc=rhds-test-day-7]:
> none
> 
> Create sample entries in the suffix [no]: yes
> 
> Are you ready to install? [no]: yes
> 
> Starting installation...
> Created symlink
> /etc/systemd/system/multi-user.target.wants/dirsrv →
> /usr/lib/systemd/system/dirsrv@.service.
> Completed installation for test
> #
> 
> # grep -ic nsslapd-suffix ./dse.ldif
> 0
> #

This is working fine -
[root@server-rhel8 ds]# dscreate interactive
Install Directory Server (interactive mode)
===========================================

Enter system's hostname [server-rhel8.example.com]: 

Use strict hostname verification (set to "no" if using GSSAPI behind a load balancer) [yes]: 

Enter the instance name [server-rhel8]: 

Enter port number [389]: 

Create self-signed certificate database [yes]: 

Enter secure port number [636]: 

Enter Directory Manager DN [cn=Directory Manager]: 

Enter the Directory Manager password: 
Confirm the Directory Manager Password: 

Enter the database suffix (or enter "none" to skip) [dc=server-rhel8,dc=example,dc=com]: none

Are you ready to install? [no]: yes

Starting installation...
Created symlink /etc/systemd/system/multi-user.target.wants/dirsrv → /usr/lib/systemd/system/dirsrv@.service.
Completed installation for server-rhel8