Issue Details (XML | Word | Printable)

Key: DIRSERVER-785
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Emmanuel Lecharny
Reporter: Ed Roberts
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Directory ApacheDS

When searching the directory with broken search expressions the search never returns (infinite loop)

Created: 23/Nov/06 03:56 PM   Updated: 15/Feb/09 02:06 PM
Return to search
Component/s: None
Affects Version/s: 1.5.4
Fix Version/s: 1.5.5

Time Tracking:
Not Specified

Environment: Windows 2000, JDK 1.4.2_03

Resolution Date: 14/Sep/08 08:43 AM


 Description  « Hide
I executed a search on a context and the search did not return.

2006-11-23 15:20:18,243 DEBUG [MYLDAPClientClass]function - searching : filter [(&(cn=somerandomstring)(objectClass=RakInstanceDescriptor)]

I noticed from my debug that my search filter was not terminated correctly. It would make development easier, especially for those not knowing immediately that they had provided a duff filter, if the search method threw an exception to say that the filter was invalid.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Emmanuel Lecharny added a comment - 23/Nov/06 05:28 PM
This would be a very interesting feature, but it's totally impossible to implement it.

The reason is that the server don't receive the filter the way you write it. The LdapProtocol for a Search Request is a binary protocol, not a textual one, and the search filter is written this way for your request :

(&(cn=somerandomstring)(objectClass=RakInstanceDescriptor))

is translated to :

0xA0
  0xA3 0x16
    0x04 0x02 'c'n'
    0x04 0x10 'somerandomstring'
  0xA3 0x24
    0x04 0x0B 'objectClass'
    0x04 0x15 'RakInstanceDescriptor'

This is the client side parser which should be fixed...

Ok, now, if you use the shared-ldap API to parse the filter, then we have a problem, but this is another JIRA :)

Emmanuel Lecharny added a comment - 09/Sep/08 07:23 AM
After having read the issue again, I realised that it was a real problem when using an embedded server, not a problem when using a remote server.

We have to provide a safer parser for filters.

Emmanuel Lecharny added a comment - 14/Sep/08 08:43 AM
It seems to be fixed. I just have added a test to check that broken filters throw the correct exception (InvalidSearchFilterException) : http://svn.apache.org/viewvc?rev=695143&view=rev

Emmanuel Lecharny added a comment - 15/Feb/09 02:06 PM
closed