citaret
citaret

Reputation: 446

What's wrong with the new added ldap database?

I add a new domain to openldap mdb database, but I can not access it, what's the problem?

Here is the process:

$ ldapadd -H ldapi:// -Y EXTERNAL -f newdb.ldif

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
adding new entry "olcDatabase=mdb,cn=config"

cat newdb.ldif

dn: olcDatabase=mdb,cn=config
objectClass: olcMdbConfig
olcDatabase: mdb
olcDbDirectory: /var/lib/ldap
olcSuffix: dc=example01,dc=com
olcRootDN: cn=admin,dc=example01,dc=com
olcRootPW: {SSHA}J9qNsUzm8nVDQdqWV6XUC0vZQWtml7Cs

I can list it through search base "cn=config":

$ ldapsearch -H ldapi:// -Y EXTERNAL -b "cn=config" "(olcRootDN=*)" olcSuffix olcRootDN olcRootPW -LLL -Q

dn: olcDatabase={21}mdb,cn=config
olcSuffix: dc=example01,dc=com
olcRootDN: cn=admin,dc=example01,dc=com
olcRootPW: {SSHA}J9qNsUzm8nVDQdqWV6XUC0vZQWtml7Cs

But I can not access it, and I can not add items to it:

$ ldapsearch -H ldapi:// -Y EXTERNAL -b 'dc=example01,dc=com' -s base '(objectclass=*)' -LLL -Q
No such object (32)

Any help is appreciated.

Upvotes: 0

Views: 174

Answers (1)

Ludovic Poitou
Ludovic Poitou

Reputation: 4878

Adding the configuration for a new database doesn't create the top entry of in that database. You need to use ldapadd to add the entry "dc=example01,dc=com" (with an objectClass Domain)

Upvotes: 1

Related Questions