Peng
The default of "-b" should be whatever you have specified in your
ldap.conf configuration file. In a fresh install, without any
configuration, I do not believe it will look for any base. The "-b" flag
is used to specify the base of the tree from where you wish to begin your
search. If you also pass the "-v" flag, it will spit out the base you are
using ex:" # base <dc=somedomain,dc=com> with scope subtree". In the
ldap.conf (typically located in your /etc/opendlap directory in linux),
the directive you want to set is "BASE". It natively comes with something
that is commented out ex: #BASE dc=example,dc=com. You need to
uncomment and add the appropriate base location from where you wish to
operate. Bear in mind that this affects the behavior of all your OpenLDAP
client calls if the "-b" is not specified in the command string.
Regards,
Brad Hartlove
-----Original Message-----
From: openldap-technical-bounces@OpenLDAP.org
[mailto:openldap-technical-bounces@OpenLDAP.org] On Behalf Of Peng Yu
Sent: Thursday, March 27, 2014 4:17 PM
To: openldap-technical@openldap.org
Subject: What is the default of `-b`?
Hi,
The man page says the following.
`-b` *searchbase*
: Use *searchbase* as the starting point for the search instead of
the default.
I'm wondering what is the default. If I don't specify -b, I will get an
error. Does anyone know how show all the contents from the database?
Thanks.
$ sudo ldapsearch -Q -LLL -Y EXTERNAL -H ldapi:/// -b cn=config dn
dn: cn=config
dn: cn=module{0},cn=config
dn: cn=schema,cn=config
dn: cn={0}core,cn=schema,cn=config
dn: cn={1}cosine,cn=schema,cn=config
dn: cn={2}nis,cn=schema,cn=config
dn: cn={3}inetorgperson,cn=schema,cn=config
dn: olcBackend={0}hdb,cn=config
dn: olcDatabase={-1}frontend,cn=config
dn: olcDatabase={0}config,cn=config
dn: olcDatabase={1}hdb,cn=config
$ sudo ldapsearch -Q -LLL -Y EXTERNAL -H ldapi:/// dn No such object (32)
--
Regards,
Peng