Last Comment Bug 28001 - Parsing in LDAPUrl(String url) ignores attributes
: Parsing in LDAPUrl(String url) ignores attributes
Product: Directory
Classification: Components
Component: LDAP Java SDK (show other bugs)
: other
: x86 Windows NT
P3 critical (vote)
: ---
Assigned To: miodrag
Depends on:
  Show dependency treegraph
Reported: 2000-02-16 08:12 PST by Peter.Kilian
Modified: 2000-05-06 13:00 PDT (History)
0 users
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---


Description User image Peter.Kilian 2000-02-16 08:12:59 PST
I create an instance of LDAPUrl using the constructor LDAPUrl (String url).
My LDAP URL "LDAP://|(cn=a*))" has attributes, but no DN. 
During the parsing of the URL string the attributes are ignored.
In Version 1.4 of, in Line 152, readNextConstruct(urlParser)
is called. In readNextConstruct() are two calls of StringTokenizer.nextToken().
This is correct if you have a DN. In this case the first call
returns the '?' and the next returns the attributes. But if you have
no DN (DN.equals("?") in Line 144) the first call returns the attributes
and the second retuns the '?' after the attributes.
Comment 1 User image Mark Smith (:mcs) 2000-02-16 09:00:02 PST
My interpretation of RFC 2255 (LDAPv3 URL format) and 2253 (LDAPv3 DN 
representation) is that the URL you mention has a zero length DN ("") which is 
perfectly legal.  So it does sound like a bug to me.  Reassiging to Miodrag.
Comment 2 User image miodrag 2000-02-25 08:45:12 PST
Rob thinks this is a bug because, one could consider the URL to represent the 
root DSE. So the following: "LDAP://*))" 
should return all attributes of the root DSE, for example. 
Comment 3 User image miodrag 2000-05-06 13:00:01 PDT
The bug has been fixed. In addition, the following problems have been fixed in 
the LDAPUrl class:

1) Any value can be passed as search scope. If it is incorrect, it is simply 
ignored, no exception. 
2) If the filter part is not enclosed in (), it is silently ignored and the 
defult one is used. 
3) Some weird looking URLs are accepted like ldap:::host or 

The fix has been cheked in 05-06-00 in the mozilla source tree.

Checking in ldapjdk/netscape/ldap/;
/cvsroot/mozilla/directory/java-sdk/ldapjdk/netscape/ldap/,v  <--  L
new revision: 1.5; previous revision: 1.4

Note You need to log in before you can comment on or make changes to this bug.