Issue Details (XML | Word | Printable)

Key: DIRSERVER-297
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alex Karasulu
Reporter: Giamma
Votes: 0
Watchers: 0
Operations

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

NormalizationService is failing to parse escaped names

Created: 06/Jul/05 07:37 AM   Updated: 21/Apr/07 11:13 AM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Resolution Date: 25/Aug/05 06:35 AM


 Description  « Hide

I wrote a custom partition to extract data from our oracle database.
Some of the names returned from out db needs to be escaped because they have special chars like: "," "/" and "="
This is done using LdapName.escapeAttributeValue().

Unfortunately the DnParser (in NormalizationService) is not doing the right thing when processing these escaped names.

I had to change the code in NormalizationService to still call the parser (to check invalid DN syntax) but I skipped
using the text returned by the parser because it would remove spaces after an escaped ","

Let's say I have a RDN like this:
"ou=some test, something else"

After I escaped it it wil be like this:
"ou=some test\\, something else"

The parser will remove the space after the escaped ","
"ou=some test\\,something else"

And that breaks the code in my custom partition because it's not finding the right object.

Here is the fix I made.
But it's just an hack. I think the problem is in the DnParser. But I do not have the source for that.

 protected void process( NextInterceptor nextInterceptor, Delete call ) throws NamingException
    {
        synchronized( parser )
        {
            // call.getName( parser.parse( call.getName().toString() ) );
            // call it anyway to catch invalid DN syntax
            parser.parse( call.getName().toString() );
        }

        super.process( nextInterceptor, call );
    }

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Alex Karasulu added a comment - 25/Aug/05 06:20 AM
Tried to isolate this bug with the following test case committed on revision 239929 here:

http://svn.apache.org/viewcvs.cgi?rev=239929&view=rev

Alex Karasulu added a comment - 25/Aug/05 06:22 AM
The test case commited above passes without a problem. The space in the value is not lost after escaping the ',' before the space. Are you sure this problem still exists? If so please report. I will perform an integration test to make sure normalized parsing does not cause this problem before I close this issue. Let me know before then or let me know so I can reopen this issue. Thanks.

Alex Karasulu added a comment - 25/Aug/05 06:35 AM
Could not isolate the problem. Somehow this issue was fixed with the changes made across releases. Please confirm if the problem persists.

Emmanuel Lecharny added a comment - 21/Apr/07 11:13 AM
Closing all issues created in 2005 and before which are marked resolved