You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jmeter.apache.org by bu...@apache.org on 2012/10/12 19:06:55 UTC

[Bug 53997] New: Ampersand in LDAP search filter invalidates LDAP Sampler XML response data

https://issues.apache.org/bugzilla/show_bug.cgi?id=53997

          Priority: P2
            Bug ID: 53997
          Assignee: issues@jmeter.apache.org
           Summary: Ampersand in LDAP search filter invalidates LDAP
                    Sampler XML response data
          Severity: normal
    Classification: Unclassified
          Reporter: mark.o.miller@gmail.com
          Hardware: Macintosh
            Status: NEW
           Version: 2.8
         Component: Main
           Product: JMeter

When LDAP sampler includes an AND (&) operator in the LDAP filter, this filter
value is echoed in the XML response data. 

The ampersand character is not escaped in the xml. 

In the XML the filter will appear in its original form:
(&(sn=smith)(givenName=dave))

Then, attempts to process the response data as XML (XPath assertions,
extractors, etc) fail to parse the XML and generate errors. 

As a workaround, I use a jruby postprocessor:
res = $prev.getResponseDataAsString()
res.gsub!("&","&")#the ampersand breaks the xml so encode it
$prev.setResponseData(res,"utf-8")

Pre Correction
<searchfilter>(&(objectclass=x-commonProfile)(sn=Millerp)(givenName=Markp)(x-emailAddress1=26e7b5b3@yopmail.com))</searchfilter>

Post Correction
<searchfilter>(&amp;(objectclass=x-commonProfile)(sn=Millerp)(givenName=Markp)(x-emailAddress1=26e7b5b3@yopmail.com))</searchfilter>

Once corrected, other XML based operations are successful. 

Considering that the character is valid and predictable in the LDAP context, I
consider this a bug (even though the workaround is fairly trivial).

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 53997] LDAP Extended Request: Escape ampersand (&), left angle bracket (<) and right angle bracket (>) in search filter tag in XML response data

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53997

Milamber <mi...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
           Hardware|Macintosh                   |All
         Resolution|---                         |FIXED

--- Comment #1 from Milamber <mi...@apache.org> ---
Thanks for report.
Fixed in trunk.


URL: http://svn.apache.org/viewvc?rev=1397875&view=rev
Log:
LDAP Extended Request: Escape ampersand (&), left angle bracket (<) and right
angle bracket (>) in search filter tag in XML response data
Bugzilla Id: 53997

Modified:
   
jmeter/trunk/src/protocol/ldap/org/apache/jmeter/protocol/ldap/sampler/LDAPExtSampler.java
    jmeter/trunk/xdocs/changes.xml

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 53997] LDAP Extended Request: Escape ampersand (&), left angle bracket (<) and right angle bracket (>) in search filter tag in XML response data

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53997

--- Comment #2 from Milamber <mi...@apache.org> ---


For reference:
http://www.w3.org/TR/2000/REC-xml-20001006#syntax

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 53997] LDAP Extended Request: Escape ampersand (&), left angle bracket (<) and right angle bracket (>) in search filter tag in XML response data

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53997

--- Comment #3 from Milamber <mi...@apache.org> ---
Thanks Philippe!

URL: http://svn.apache.org/viewvc?rev=1397905&view=rev
Log:
Better way
LDAP Extended Request: Escape ampersand (&), left angle bracket (<) and right
angle bracket (>) in search filter tag in XML response data
Bugzilla Id: 53997

Modified:
   
jmeter/trunk/src/protocol/ldap/org/apache/jmeter/protocol/ldap/sampler/LDAPExtSampler.java

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 53997] LDAP Extended Request: Escape ampersand (&), left angle bracket (<) and right angle bracket (>) in search filter tag in XML response data

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53997

Milamber <mi...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Ampersand in LDAP search    |LDAP Extended Request:
                   |filter invalidates LDAP     |Escape ampersand (&), left
                   |Sampler XML response data   |angle bracket (<) and right
                   |                            |angle bracket (>) in search
                   |                            |filter tag in XML response
                   |                            |data
                 OS|                            |All

-- 
You are receiving this mail because:
You are the assignee for the bug.