04-25-07 12:11 AM
SubtreeSpecificationParser and LDAP filter
------------------------------------------
Key: DIRSERVER-916
URL: https://issues.apache.org/jira/browse/DIRSERVER-916
Project: Directory ApacheDS
Issue Type: Bug
Reporter: Stefan Seelmann
Fix For: 1.5.1
I got a curious error. While playing with the new LS subtreespecification ed
itor and writing a subtreespecification with an LDAP filter the SubtreeSpeci
ficationParser *sometimes* gets killed.
It seems like the parser is stateful. If I first write some subtreespecifica
tions w/o an LDAP filter the parser seems to be stable. But when adding it j
ust after starting the server the parser dies with an "Read end dead".
It was able to reproduce it with the following steps, using the trunk:
1.) Create an entry with the following subtreespecification
-------------------------------------------------------------------
dn: cn=subentry,dc=example,dc=com
objectClass: accessControlSubentry
objectClass: subentry
objectClass: top
cn: subentry
prescriptiveaci: { identificationTag "dummy", precedence 1, authenticat
ionLe
vel none, itemOrUserFirst userFirst: { userClasses { }, userPermi
ssions {
} } }
subtreespecification: { specificationFilter (cn=test) }
-------------------------------------------------------------------
2.) Shutdown the server
3.) Startup the server
4.) Overwrite the subtreespecification value with a refinement
-------------------------------------------------------------------
dn: cn=subentry,dc=example,dc=com
changetype: modify
replace: subtreespecification
subtreespecification: { specificationFilter item:top }
-
-------------------------------------------------------------------
4.) Overwrite the subtreespecification value with a filter
-------------------------------------------------------------------
dn: cn=subentry,dc=example,dc=com
changetype: modify
replace: subtreespecification
subtreespecification: { specificationFilter (cn=test) }
-
-------------------------------------------------------------------
The client receives the following error message:
-------------------------------------------------------------------
ldap_modify: Invalid syntax (21)
additional info: failed to modify entry cn=subentry,dc=example,dc=com: faile
d to parse the new subtreeSpecification
-------------------------------------------------------------------
The server throws the following exception:
-------------------------------------------------------------------
[22:46:49] ERROR [org.apache.directory.server.core.subtree.SubentryS
ervice] - failed to parse the new subtreeSpecification
java.text.ParseException: Parser failure on subtree specification:
{ specificationFilter (cn=test) }
Antlr exception trace:
filterParser failed. Read end dead
at org.apache.directory.shared.ldap.subtree.SubtreeSpecificationParser.parse
(SubtreeSpecificationParser.java:133)
at org.apache.directory.server.core.subtree.SubentryService.modify(SubentryS
ervice.java:1045)
at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.mod
ify(InterceptorChain.java:1162)
at org.apache.directory.server.core.schema.SchemaService.modify(SchemaServic
e.java:1517)
at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.mod
ify(InterceptorChain.java:1162)
at org.apache.directory.server.core.operational.OperationalAttributeService.
modify(OperationalAttributeService.java:177)
at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.mod
ify(InterceptorChain.java:1162)
at org.apache.directory.server.core.exception.ExceptionService.modify(Except
ionService.java:291)
at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.mod
ify(InterceptorChain.java:1162)
at org.apache.directory.server.core.authz.DefaultAuthorizationService.modify
(DefaultAuthorizationService.java:241)
at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.mod
ify(InterceptorChain.java:1162)
at org.apache.directory.server.core.authz.AuthorizationService.modify(Author
izationService.java:510)
at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.mod
ify(InterceptorChain.java:1162)
at org.apache.directory.server.core.referral.ReferralService.modify(Referral
Service.java:746)
at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.mod
ify(InterceptorChain.java:1162)
at org.apache.directory.server.core.authn.AuthenticationService.modify(Authe
nticationService.java:351)
at org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.mod
ify(InterceptorChain.java:1162)
at org.apache.directory.server.core.normalization.NormalizationService.modif
y(NormalizationService.java:132)
at org.apache.directory.server.core.interceptor.InterceptorChain.modify(Inte
rceptorChain.java:761)
at org.apache.directory.server.core.partition.PartitionNexusProxy.modify(Par
titionNexusProxy.java:362)
at org.apache.directory.server.core.partition.PartitionNexusProxy.modify(Par
titionNexusProxy.java:349)
at org.apache.directory.server.core.jndi.ServerDirContext.modifyAttributes(S
erverDirContext.java:233)
at javax.naming.directory.InitialDirContext.modifyAttributes(InitialDirConte
xt.java:153)
at org.apache.directory.server.ldap.support.ModifyHandler.messageReceived(Mo
difyHandler.java:80)
at org.apache.mina.handler.demux.DemuxingIoHandler.messageReceived(DemuxingI
oHandler.java:144)
at org.apache.directory.server.ldap. LdapProtocolProvider$LdapProtocolHandler
.messageReceived(LdapProtocolProvider.java:427)
at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageRe
ceived(AbstractIoFilterChain.java:703)
at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageRecei
ved(AbstractIoFilterChain.java:362)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1200(Abstract
IoFilterChain.java:54)
at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageR
eceived(AbstractIoFilterChain.java:800)
at org.apache.mina.filter.LoggingFilter.messageReceived(LoggingFilter.java:9
7)
at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageRecei
ved(AbstractIoFilterChain.java:362)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1200(Abstract
IoFilterChain.java:54)
at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageR
eceived(AbstractIoFilterChain.java:800)
at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(Si
mpleProtocolDecoderOutput.java:60)
at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(Protocol
CodecFilter.java:190)
at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageRecei
ved(AbstractIoFilterChain.java:362)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1200(Abstract
IoFilterChain.java:54)
at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageR
eceived(AbstractIoFilterChain.java:800)
at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilte
r.java:243)
at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(
ExecutorFilter.java:305)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.
runTask(ThreadPoolExecutor.java:665)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.
run(ThreadPoolExecutor.java:690)
at java.lang.Thread.run(Thread.java:595)
-------------------------------------------------------------------
Now when trying to modify the subtreespecification again, the client gets th
e follwoing message, but no server logs:
-------------------------------------------------------------------
ldap_modify: Loop detected (54)
additional info: failed to modify entry cn=subentry,dc=example,dc=com: Unexp
ected exception
-------------------------------------------------------------------
The same error occurs when trying to delete the entry
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[ Post a follow-up to this message ]
|