Details
Description
If I search for "(unknown=)" I correctly get no results. But if I search for "(&(unknown=))" I get:
Caused by: javax.naming.NamingExc
eption: OID for name 'unknown' was not found within the OID registry
at org
.apache.directory.server.schema.registries.DefaultOidRegistry.getOid(Default
OidRegistry.java:113)
at org.apache.directory.server.core.normalization.Nor
malizingVisitor.visit(NormalizingVisitor.java:88)
... 25 more
Other variations of boolean operators also fail, such as "(|(uid=)(unknown=))" where "(uid=*)" by itself yields results.
According to RFC 4511 section 4.5.1, servers MUST NOT return errors in this situation.
I found similar bugs, such as DIRSERVER-645 and DIRSERVER-836, but nothing covering this exact situation.
The error is not specific to ldapsearch; I actually found the error using another application, and I was simply testing with something simpler and more widely available. I filed this as minor, because in most cases you can obviously avoid using an invalid attribute, but it's actually worse than that. The original application can't be modified, for example, and I can't use Apache DS as the LDAP server with it because the exception causes the LDAP autoconfiguration to fail.
The full ldapsearch command line and output:
$ ldapsearch -x -H ldap://localhost:10389 -D 'uid=admin,ou=system' -w **** -b 'ou=system' -s sub '(&(unknown=*))' uid
- extended LDIF
# - LDAPv3
- base <ou=system> with scope sub
- filter: (&(unknown=*))
- requesting: uid
#
- search result
search: 2
result: 36 Alias dereferencing problem
text: failed on search operation: Unexpected exception.:
SearchRequest
baseDn : 'ou=system'
filter : '(& (unknown=*) ) '
scop
e : whole subtree
typesOnly : false
no limit
Time Limit : no
limit
Deref Aliases : never Deref Aliases
attributes : 'uid
'
:
org.apache.directory.server.core.interceptor.InterceptorException: Unexp
ected exception. [Root exception is java.lang.RuntimeException: OID for name
'unknown' was not found within the OID registry]
at org.apache.directory.s
erver.core.interceptor.InterceptorChain.throwInterceptorException(Intercepto
rChain.java:1472)
at org.apache.directory.server.core.interceptor.Intercept
orChain.search(InterceptorChain.java:888)
at org.apache.directory.server.co
re.partition.PartitionNexusProxy.search(PartitionNexusProxy.java:492)
at or
g.apache.directory.server.core.partition.PartitionNexusProxy.search(Partitio
nNexusProxy.java:434)
at org.apache.directory.server.core.jndi.ServerContex
t.doSearchOperation(ServerContext.java:249)
at org.apache.directory.server.
core.jndi.ServerDirContext.search(ServerDirContext.java:642)
at org.apache.
directory.server.ldap.support.SearchHandler.messageReceived(SearchHandler.ja
va:376)
at org.apache.mina.handler.demux.DemuxingIoHandler.messageReceived(
DemuxingIoHandler.java:141)
at org.apache.directory.server.ldap.LdapProtoco
lProvider$LdapProtocolHandler.messageReceived(LdapProtocolProvider.java:428)
at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.message
Received(AbstractIoFilterChain.java:570)
at org.apache.mina.common.support.
AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299
)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(Abstr
actIoFilterChain.java:53)
at org.apache.mina.common.support.AbstractIoFilte
rChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
at org.a
pache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimpleProt
ocolDecoderOutput.java:58)
at org.apache.mina.filter.codec.ProtocolCodecFil
ter.messageReceived(ProtocolCodecFilter.java:176)
at org.apache.mina.common
.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain
.java:299)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1
100(AbstractIoFilterChain.java:53)
at org.apache.mina.common.support.Abstra
ctIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilt
er.java:220)
at org.apache.mina.filter.executor.ExecutorFilter$ProcessEvent
sRunnable.run(ExecutorFilter.java:264)
at java.util.concurrent.ThreadPoolEx
ecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.
ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thr
ead.run(Thread.java:613)
Caused by: java.lang.RuntimeException: OID for name
'unknown' was not found within the OID registry
at org.apache.directory.se
rver.core.normalization.NormalizingVisitor.visit(NormalizingVisitor.java:93)
at org.apache.directory.shared.ldap.filter.PresenceNode.accept(PresenceNod
e.java:97)
at org.apache.directory.shared.ldap.filter.BranchNode.accept(Bra
nchNode.java:408)
at org.apache.directory.server.core.normalization.Normali
zationService.search(NormalizationService.java:210)
at org.apache.directory
.server.core.interceptor.InterceptorChain.search(InterceptorChain.java:880)
... 21 more
Caused by: javax.naming.NamingException: OID for name 'unknown'
was not found within the OID registry
at org.apache.directory.server.schem
a.registries.DefaultOidRegistry.getOid(DefaultOidRegistry.java:113)
at org.
apache.directory.server.core.normalization.NormalizingVisitor.visit(Normaliz
ingVisitor.java:88)
... 25 more
- numResponses: 1
Attachments
Issue Links
- depends upon
-
DIRSERVER-972 Write test cases to observe server behavior on "Undefined" search filter items
- Reopened
- is cloned by
-
DIRSERVER-1152 OR search with multiple attributes if one is bad, search fails
- Closed
- is related to
-
DIRSERVER-971 Provide specific filter nodes for True, False and Undefined, and handle them in the search engine
- Open