https://bugs.openldap.org/show_bug.cgi?id=9678
Issue ID: 9678 Summary: slapadd prints “olcRootPW: value #0: <olcRootPW> can only be set when rootdn is under suffix” and then crashes Product: OpenLDAP Version: 2.5.7 Hardware: All OS: All Status: UNCONFIRMED Severity: normal Priority: --- Component: slapd Assignee: bugs@openldap.org Reporter: dpa-openldap@aegee.org Target Milestone: ---
Created attachment 840 --> https://bugs.openldap.org/attachment.cgi?id=840&action=edit Valgrind output
Calling ``` slapadd -n0 -F/home/d/ldap/conf <<ABC dn: cn=config objectClass: olcGlobal cn: config olcAuthzRegexp: uid=([^@,]+)@example.org,cn=[^,]*,cn=auth uid=$1,cn=users,dc=example,dc=org
dn: olcDatabase=frontend,cn=config objectClass: olcDatabaseConfig objectClass: olcFrontendConfig olcDatabase: frontend
dn: olcDatabase=config,cn=config objectClass: olcDatabaseConfig olcDatabase: config olcRootDN: uid=yyy,cn=users,dc=example,dc=org olcRootPW: zzz ABC ```
prints
PROXIED attributeDescription "DC" inserted. olcRootPW: value #0: <olcRootPW> can only be set when rootdn is under suffix slapadd: could not add entry dn="olcDatabase={0}config,cn=config" (line=12): Segmentation fault (core dumped)
The output of valgrind, when it runs the above command, is attached.
https://bugs.openldap.org/show_bug.cgi?id=9678
--- Comment #1 from Ondřej Kuzník ondra@mistotebe.net --- On Fri, Sep 10, 2021 at 07:41:01AM +0000, openldap-its@openldap.org wrote:
Calling
slapadd -n0 -F/home/d/ldap/conf <<ABC [...] dn: olcDatabase=config,cn=config objectClass: olcDatabaseConfig olcDatabase: config olcRootDN: uid=yyy,cn=users,dc=example,dc=org olcRootPW: zzz ABC
Hi Dilian, thanks for the report.
It seems that config_add_internal calls backend_destroy_one() for the config backend invalidating the memory for the rest of the run. We check to make sure we don't free the frontend but we don't check for cn=config. cn=config doesn't keep a pointer to its BackendDB or BackendInfo so a fix should find a way around that.
Regards,
https://bugs.openldap.org/show_bug.cgi?id=9678
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |needs_review
https://bugs.openldap.org/show_bug.cgi?id=9678
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |2.5.8 Assignee|bugs@openldap.org |hyc@openldap.org Keywords|needs_review |
https://bugs.openldap.org/show_bug.cgi?id=9678
Howard Chu hyc@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |TEST Status|UNCONFIRMED |RESOLVED
--- Comment #2 from Howard Chu hyc@openldap.org --- fixed in git master
https://bugs.openldap.org/show_bug.cgi?id=9678
--- Comment #3 from Quanah Gibson-Mount quanah@openldap.org --- • 09a22d55 by Howard Chu at 2021-09-14T20:01:47+01:00 ITS#9678 slapadd: avoid destroying configDB prematurely
https://bugs.openldap.org/show_bug.cgi?id=9678
--- Comment #4 from Quanah Gibson-Mount quanah@openldap.org --- RE26: • 4be655ea by Howard Chu at 2021-09-15T15:36:37+00:00 ITS#9678 slapadd: avoid destroying configDB prematurely
RE25:
• 92e7cee3 by Howard Chu at 2021-09-15T15:40:49+00:00 ITS#9678 slapadd: avoid destroying configDB prematurely
https://bugs.openldap.org/show_bug.cgi?id=9678
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|TEST |FIXED Status|RESOLVED |VERIFIED