Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 710630

Summary: no root password in new-style config
Product: Red Hat Enterprise Linux 6 Reporter: Dimitri Maziuk <dmaziuk>
Component: openldapAssignee: Jan Vcelak <jvcelak>
Status: CLOSED NOTABUG QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.0CC: jplans, jvcelak, rvokal, tsmetana
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-08-11 16:22:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dimitri Maziuk 2011-06-03 21:14:10 UTC
Description of problem:

slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d 

fails to migrate rootpw to the "new-style" configuration.

Version-Release number of selected component (if applicable):

openldap-servers-2.4.19

How reproducible:

always

Steps to Reproduce:
1. create /etc/openldap/slapd.conf with rootpw
2. run slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d 
3. restart slapd
4. run e.g. ldapsearch -W -x -D "cn=manager,dc=YOUR_DC" "$@"  and enter rootpw from #1 at the prompt.

Actual results:

ldap_bind: Invalid credentials (49)

Expected results:

Dump of LDAP database.

Comment 2 Jan Vcelak 2011-06-03 21:53:31 UTC
Please, use the latest OpenLDAP package available in RHEL6. Anyway, I'm unable
to reproduce the issue with both openldap-servers-2.4.19-15.el6_0.2.x86_64 and
openldap-servers-2.4.23-15.el6.x86_64

# service slapd stop
Stopping slapd:                                            [  OK  ]
# cd /etc/openldap
# grep ^root slapd.conf.bak
rootdn          "cn=Manager,dc=my-domain,dc=com"
rootpw          secret
# rm -rf slapd.d
# mkdir slapd.d
# slaptest -f slapd.conf.bak -F slapd.d
config file testing succeeded
# grep ^olcRoot slapd.d/cn\=config/olcDatabase\=\{1\}bdb.ldif 
olcRootDN: cn=Manager,dc=my-domain,dc=com
olcRootPW:: c2VjcmV0
# chown -R ldap: slapd.d
# service slapd start
Starting slapd:                                            [  OK  ]
# ldapsearch -LLL -x -D "cn=Manager,dc=my-domain,dc=com" -w secret
dn: dc=my-domain,dc=com
objectClass: dcObject
objectClass: organization
o: xx
dc: my-domain

Please, can you double check?

Comment 3 Dimitri Maziuk 2011-06-03 22:23:12 UTC
It seems if you wipe out slapd.d completely, do the slaptest -f slapd.conf.bak -F slapd.d, then chown -R ldap:ldap slapd.d, it will work. 

As a naive root user (well, you can't su - ldap anyway), from clean slate:

[root@rendena etc]# yum install openldap-servers
...
Installing     : openldap-servers-2.4.19-15.el6_0.2.x86_64
...
[root@rendena openldap]# yum install openldap-clients
...
Installing     : openldap-clients-2.4.19-15.el6_0.2.x86_64
...
[root@rendena etc]# cd openldap
[root@rendena openldap]# slappasswd -s 'temp123'
{SSHA}C3MiVoyqm9KOgxQ/r0CdiJ7Mj3iAx4aw

[root@rendena etc]# vi slapd.conf.bak
-- changed: 
suffix          "dc=nmrfam,dc=wisc,dc=edu"
rootdn          "cn=Manager,dc=nmrfam,dc=wisc,dc=edu"
rootpw {SSHA}C3MiVoyqm9KOgxQ/r0CdiJ7Mj3iAx4aw
-- (since "secret" and "My-domain.com" aren't useful to anyone)

[root@rendena openldap]# slaptest -f slapd.conf.bak -F slapd.d
config file testing succeeded
[root@rendena openldap]# service slapd start
Starting slapd:                                            [  OK  ]
[root@rendena openldap]# ldapsearch -LL -x -D "cn=Manager,dc=nmrfam,dc=wisc,dc=edu" -w 'temp123'
ldap_bind: Invalid credentials (49)
[root@rendena openldap]# grep ^olcRoot slapd.d/cn\=config/olcDatabase\=\{1\}bdb.ldif
olcRootDN: cn=Manager,dc=my-domain,dc=com

Comment 4 Jan Vcelak 2011-08-11 16:22:01 UTC
The purpose of "slaptest -f slapd.conf -F slapd.d" is to convert the old style configuration to new one. It can not be used for updating the configuration. For this purpose, ldapmodify  can be used (cn=config root).

When slapd.d is empty, attribute olcRootPW is created and set correctly. Therefore I am closing this report as NOTABUG.