Issue 7261 - ldapsearch with base specified does not return anything
Summary: ldapsearch with base specified does not return anything
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: 2.4.31
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-25 20:51 UTC by ashish@sendmail.com
Modified: 2014-08-01 21:03 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description ashish@sendmail.com 2012-04-25 20:51:19 UTC
Full_Name: Ashish Gawarikar
Version: 2.4.31
OS: Redhat 5.8
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (63.211.143.38)


Configure slapd with multiple databases:

database        bdb
directory       /var/ldap/openldap-bdb24
suffix          "sendmailMTAMapName=virtuser,sendmailMTACluster=hub,dc=example,dc=com"
subordinate     advertise
dbconfig        set_lg_dir /var/ldap/openldap-bdb24/log

database        bdb
directory       /var/ldap/openldap-bdb23
suffix          "sendmailMTAMapName=stduser,sendmailMTACluster=hub,dc=example,dc=com"
subordinate     advertise
dbconfig        set_lg_dir /var/ldap/openldap-bdb23/log

database        bdb
directory       /var/ldap/openldap-bdb22
suffix          "sendmailMTAMapName=generics,sendmailMTACluster=hub,dc=example,dc=com"
subordinate     advertise
dbconfig        set_lg_dir /var/ldap/openldap-bdb22/log

database        bdb
directory       /var/sendmail/ldap/openldap-bdb21
suffix          "sendmailMTAAliasGrouping=aliases,sendmailMTACluster=hub,dc=example,dc=com"
subordinate     advertise
dbconfig        set_lg_dir /var/ldap/openldap-bdb21/log

database        bdb
directory       /var/ldap/openldap-bdb20
suffix          "sendmailMTACluster=hub,dc=example,dc=com"
subordinate     advertise
dbconfig        set_lg_dir /var/ldap/openldap-bdb20/log

database        bdb
directory       /var/ldap/openldap-bdb13
suffix          "sendmailMTAMapName=b,sendmailMTACluster=QQQ,dc=example,dc=com"
subordinate     advertise
dbconfig        set_lg_dir /var/ldap/openldap-bdb13/log

database        bdb
directory       /var/ldap/openldap-bdb12
suffix          "sendmailMTAMapName=E,sendmailMTACluster=QQQ,dc=example,dc=com"
subordinate     advertise
dbconfig        set_lg_dir /var/ldap/openldap-bdb12/log

database        bdb
directory       /var/ldap/openldap-bdb11
suffix          "sendmailMTAMapName=Es,sendmailMTACluster=QQQ,dc=example,dc=com"
subordinate     advertise
dbconfig        set_lg_dir /var/ldap/openldap-bdb11/log

database        bdb
directory       /var/ldap/openldap-bdb10
suffix          "sendmailMTACluster=QQQ,dc=example,dc=com"
subordinate     advertise
dbconfig        set_lg_dir /var/ldap/openldap-bdb10/log

database        hdb
directory       /var/ldap/openldap-bdb
suffix          ""


===
10 ldifs:

1.ldif
dn: sendmailMTAMapName=virtuser,sendmailMTACluster=hub,dc=example,dc=com
objectClass: sendmailMTAMap
objectClass: sendmailMTA
objectClass: top
objectClass: extensibleObject
sendmailMTACluster: hub
sendmailMTAMapName: virtuser

2.ldif
dn: sendmailMTAMapName=stduser,sendmailMTACluster=hub,dc=example,dc=com
objectClass: sendmailMTAMap
objectClass: sendmailMTA
objectClass: top
objectClass: extensibleObject
sendmailMTACluster: hub
sendmailMTAMapName: stduser

3.ldif
dn: sendmailMTAMapName=generics,sendmailMTACluster=hub,dc=example,dc=com
objectClass: sendmailMTAMap
objectClass: sendmailMTA
objectClass: top
objectClass: extensibleObject
sendmailMTACluster: hub
sendmailMTAMapName: generics

4.ldif
dn: sendmailMTAAliasGrouping=aliases,sendmailMTACluster=hub,dc=example,dc=com
objectClass: sendmailMTAAlias
objectClass: sendmailMTA
objectClass: top
objectClass: extensibleObject
sendmailMTAAliasGrouping: aliases
sendmailMTACluster: hub

5.ldif
dn: sendmailMTACluster=hub,dc=example,dc=com
objectClass: sendmailMTA
objectClass: top
objectClass: extensibleObject
sendmailMTACluster: hub

6.ldif
dn: sendmailMTAMapName=b,sendmailMTACluster=QQQ,dc=example,dc=com
objectClass: sendmailMTAMap
objectClass: sendmailMTA
objectClass: top
objectClass: extensibleObject
sendmailMTACluster: QQQ
sendmailMTAMapName: b

7.ldif
dn: sendmailMTAMapName=E,sendmailMTACluster=QQQ,dc=example,dc=com
objectClass: sendmailMTAMap
objectClass: sendmailMTA
objectClass: top
objectClass: extensibleObject
sendmailMTACluster: QQQ
sendmailMTAMapName: E

8.ldif
dn: sendmailMTAMapName=Es,sendmailMTACluster=QQQ,dc=example,dc=com
objectClass: sendmailMTAMap
objectClass: sendmailMTA
objectClass: top
objectClass: extensibleObject
sendmailMTACluster: QQQ
sendmailMTAMapName: Es

9.ldif
dn: sendmailMTACluster=QQQ,dc=example,dc=com
objectClass: sendmailMTA
objectClass: top
objectClass: extensibleObject
sendmailMTACluster: QQQ

10.ldif
dn: dc=example,dc=com
objectClass: top
objectClass: extensibleObject
dc: example

dn: dc=com
objectClass: top
objectClass: extensibleObject

Add entries in the db using:
slapadd -w -l 1.ldif -b 
sendmailMTAMapName=virtuser,sendmailMTACluster=hub,dc=example,dc=com
slapadd -w -l 2.ldif -b 
sendmailMTAMapName=stduser,sendmailMTACluster=hub,dc=example,dc=com
slapadd -w -l 3.ldif -b
sendmailMTAMapName=generics,sendmailMTACluster=hub,dc=example,dc=com
slapadd -w -l 4.ldif -b
sendmailMTAAliasGrouping=aliases,sendmailMTACluster=hub,dc=example,dc=com
slapadd -w -l 5.ldif -b sendmailMTACluster=hub,dc=example,dc=com
slapadd -w -l 6.ldif -b
sendmailMTAMapName=b,sendmailMTACluster=QQQ,dc=example,dc=com
slapadd -w -l 7.ldif -b
sendmailMTAMapName=E,sendmailMTACluster=QQQ,dc=example,dc=com
slapadd -w -l 8.ldif -b
sendmailMTAMapName=Es,sendmailMTACluster=QQQ,dc=example,dc=com
slapadd -w -l 9.ldif -b sendmailMTACluster=QQQ,dc=example,dc=com
# rest in the default bucket
slapadd -w -l 10.ldif -b ''

===========
Do an ldapsearch without the base specified:

ldapsearch -x

# aliases, hub, example.com
dn: sendmailMTAAliasGrouping=aliases,sendmailMTACluster=hub,dc=example,dc=com
objectClass: sendmailMTAAlias
objectClass: sendmailMTA
objectClass: top
objectClass: extensibleObject
sendmailMTAAliasGrouping: aliases
sendmailMTACluster: hub

# hub, example.com
dn: sendmailMTACluster=hub,dc=example,dc=com
objectClass: sendmailMTA
objectClass: top
objectClass: extensibleObject
sendmailMTACluster: hub

...


Do an ldapsearch with base:

 ldapsearch  -x -b "dc=example,dc=com"
# extended LDIF
#
# LDAPv3
# base <dc=example,dc=com> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#

# search result
search: 2


Similar search works on Openldap 2.3.x


=================================================================================
sendmail.schema file
# Copyright (c) 2000-2002, 2005 Sendmail, Inc. and its suppliers.
#       All rights reserved.
#
# By using this file, you agree to the terms and conditions set
# forth in the LICENSE file which can be found at the top level of
# the sendmail distribution.
#
# $Id: sendmail.schema,v 8.22 2005/09/16 20:18:14 ca Exp $

# Note that this schema is experimental at this point as it has had little
# public review.  Therefore, it may change in future versions.  Feedback
# via sendmail-YYYY@support.sendmail.org is encouraged (replace YYYY with
# the current year, e.g., 2005).

# OID arcs for Sendmail
# enterprise:           1.3.6.1.4.1
# sendmail:             enterprise.6152
# sendmail-at:          sendmail.3.1
# sendmail-oc:          sendmail.3.2

###########################################################################
#
# The Sendmail MTA attributes and objectclass
#
###########################################################################

# attribute sendmailMTACluster  cis
attributetype ( 1.3.6.1.4.1.6152.10.3.1.10
        NAME 'sendmailMTACluster'
        DESC 'cluster name associated with a set of MTAs'
        EQUALITY caseIgnoreIA5Match
        SUBSTR caseIgnoreIA5SubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} )

# attribute sendmailMTAHost     cis
attributetype ( 1.3.6.1.4.1.6152.10.3.1.11
        NAME 'sendmailMTAHost'
        DESC 'host name associated with a MTA cluster'
        EQUALITY caseIgnoreIA5Match
        SUBSTR caseIgnoreIA5SubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} )

#objectClass sendmailMTA
#       requires
#               objectClass
#       allows
#               sendmailMTACluster,
#               sendmailMTAHost,
#               Description

objectclass ( 1.3.6.1.4.1.6152.10.3.2.10
        NAME 'sendmailMTA'
        SUP top STRUCTURAL
        DESC 'Sendmail MTA definition'
        MAY ( sendmailMTACluster $ sendmailMTAHost $ Description ) )

###########################################################################
#
# The Sendmail MTA shared attributes
#
###########################################################################

# attribute sendmailMTAKey      cis
attributetype ( 1.3.6.1.4.1.6152.10.3.1.13
        NAME 'sendmailMTAKey'
        DESC 'key (left hand side) of an aliases or map entry'
        EQUALITY caseIgnoreMatch
        SUBSTR caseIgnoreSubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )

###########################################################################
#
# The Sendmail MTA Map attributes and objectclasses
#
###########################################################################

# attribute sendmailMTAMapName  cis
attributetype ( 1.3.6.1.4.1.6152.10.3.1.14
        NAME 'sendmailMTAMapName'
        DESC 'identifier for the particular map'
        EQUALITY caseIgnoreMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} SINGLE-VALUE )

# attribute sendmailMTAMapValue cis
attributetype ( 1.3.6.1.4.1.6152.10.3.1.16
        NAME 'sendmailMTAMapValue'
        DESC 'value (right hand side) of a map entry'
        EQUALITY caseIgnoreMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )

# attribute sendmailMTAMapSearch cis
attributetype ( 1.3.6.1.4.1.6152.10.3.1.24
        NAME 'sendmailMTAMapSearch'
        DESC 'recursive search for values of a map entry'
        EQUALITY caseExactMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )

# attribute sendmailMTAMapURL cis
attributetype ( 1.3.6.1.4.1.6152.10.3.1.25
        NAME 'sendmailMTAMapURL'
        DESC 'recursive search URL for values of a map entry'
        EQUALITY caseExactMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )

#objectClass sendmailMTAMap
#       requires
#               objectClass,
#               sendmailMTAMapName,
#       allows
#               sendmailMTACluster,
#               sendmailMTAHost,
#               Description

objectclass ( 1.3.6.1.4.1.6152.10.3.2.11
        NAME 'sendmailMTAMap'
        SUP sendmailMTA STRUCTURAL
        DESC 'Sendmail MTA map definition'
        MUST sendmailMTAMapName
        MAY ( sendmailMTACluster $ sendmailMTAHost $ Description ) )

#objectClass sendmailMTAObject
#       requires
#               objectClass,
#               sendmailMTAMapName,
#               sendmailMTAKey,
#       allows
#               sendmailMTACluster,
#               sendmailMTAHost,
#               sendmailMTAMapValue,
#               sendmailMTAMapSearch,
#               sendmailMTAMapURL,
#               Description

objectclass ( 1.3.6.1.4.1.6152.10.3.2.12
        NAME 'sendmailMTAMapObject'
        SUP sendmailMTAMap STRUCTURAL
        DESC 'Sendmail MTA map object'
        MUST ( sendmailMTAMapName $ sendmailMTAKey )
        MAY ( sendmailMTACluster $ sendmailMTAHost $
                sendmailMTAMapValue $ sendmailMTAMapSearch $
                sendmailMTAMapURL $ Description ) )


###########################################################################
#
# The Sendmail MTA Alias attributes and objectclasses
#
###########################################################################

# attribute sendmailMTAAliasGrouping    cis
attributetype ( 1.3.6.1.4.1.6152.10.3.1.18
        NAME 'sendmailMTAAliasGrouping'
        DESC 'name that identifies a particular aliases grouping'
        EQUALITY caseIgnoreIA5Match
        SUBSTR caseIgnoreIA5SubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} )

# attribute sendmailMTAAliasValue       cis
attributetype ( 1.3.6.1.4.1.6152.10.3.1.20
        NAME 'sendmailMTAAliasValue'
        DESC 'value (right hand side) of an alias'
        EQUALITY caseIgnoreMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )

# attribute sendmailMTAAliasSearch cis
attributetype ( 1.3.6.1.4.1.6152.10.3.1.26
        NAME 'sendmailMTAAliasSearch'
        DESC 'recursive search for values of an alias'
        EQUALITY caseExactMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )

# attribute sendmailMTAAliasURL cis
attributetype ( 1.3.6.1.4.1.6152.10.3.1.27
        NAME 'sendmailMTAAliasURL'
        DESC 'recursive search URL for values of an alias'
        EQUALITY caseExactMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )

#objectClass sendmailMTAAlias
#       requires
#               objectClass,
#       allows
#               sendmailMTAAliasGrouping,
#               sendmailMTACluster,
#               sendmailMTAHost,
#               Description

objectclass ( 1.3.6.1.4.1.6152.10.3.2.13
        NAME 'sendmailMTAAlias'
        SUP sendmailMTA STRUCTURAL
        DESC 'Sendmail MTA alias definition'
        MAY ( sendmailMTAAliasGrouping $
                sendmailMTACluster $ sendmailMTAHost $ Description ) )

#objectClass sendmailMTAAliasObject
#       requires
#               objectClass,
#               sendmailMTAKey,
#       allows
#               sendmailMTAAliasGrouping,
#               sendmailMTACluster,
#               sendmailMTAHost,
#               sendmailMTAAliasValue,
#               sendmailMTAAliasSearch,
#               sendmailMTAAliasURL,
#               Description

objectclass ( 1.3.6.1.4.1.6152.10.3.2.14
        NAME 'sendmailMTAAliasObject'
        SUP sendmailMTAAlias STRUCTURAL
        DESC 'Sendmail MTA alias object'
        MUST sendmailMTAKey
        MAY ( sendmailMTAAliasGrouping $ sendmailMTACluster $
                sendmailMTAHost $ sendmailMTAAliasValue $
                sendmailMTAAliasSearch $ sendmailMTAAliasURL $ Description ) )

###########################################################################
#
# The Sendmail MTA Class attributes and objectclass
#
###########################################################################

# attribute sendmailMTAClassName        cis
attributetype ( 1.3.6.1.4.1.6152.10.3.1.22
        NAME 'sendmailMTAClassName'
        DESC 'identifier for the class'
        EQUALITY caseIgnoreMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} SINGLE-VALUE )

# attribute sendmailMTAClassValue       cis
attributetype ( 1.3.6.1.4.1.6152.10.3.1.23
        NAME 'sendmailMTAClassValue'
        DESC 'member of a class'
        EQUALITY caseIgnoreMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )

# attribute sendmailMTAClassSearch cis
attributetype ( 1.3.6.1.4.1.6152.10.3.1.28
        NAME 'sendmailMTAClassSearch'
        DESC 'recursive search for members of a class'
        EQUALITY caseExactMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )

# attribute sendmailMTAClassURL cis
attributetype ( 1.3.6.1.4.1.6152.10.3.1.29
        NAME 'sendmailMTAClassURL'
        DESC 'recursive search URL for members of a class'
        EQUALITY caseExactMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )

#objectClass sendmailMTAClass
#       requires
#               objectClass,
#               sendmailMTAClassName,
#       allows
#               sendmailMTACluster,
#               sendmailMTAHost,
#               sendmailMTAClassValue,
#               sendmailMTAClassSearch,
#               sendmailMTAClassURL,
#               Description

objectclass ( 1.3.6.1.4.1.6152.10.3.2.15
        NAME 'sendmailMTAClass'
        SUP sendmailMTA STRUCTURAL
        DESC 'Sendmail MTA class definition'
        MUST sendmailMTAClassName
        MAY ( sendmailMTACluster $ sendmailMTAHost $
                sendmailMTAClassValue $ sendmailMTAClassSearch $
                sendmailMTAClassURL $ Description ) )
Comment 1 ashish@sendmail.com 2012-04-26 18:02:30 UTC
dn: dc=com
objectClass: top
objectClass: extensibleObject

http://www.openldap.org/its/index.cgi/Incoming?id=7261  is not bug (at least not
reproducible with the data added). That is because I missed out the
objectClass: domain in the above entry.

Comment 2 Howard Chu 2012-05-09 19:21:23 UTC
changed notes
changed state Open to Closed
Comment 3 OpenLDAP project 2014-08-01 21:03:53 UTC
invalid