https://issues.apache.org/bugzilla/show_bug.cgi?id=53997
Priority: P2
Bug ID: 53997
Assignee: [email protected]
Summary: Ampersand in LDAP search filter invalidates LDAP
Sampler XML response data
Severity: normal
Classification: Unclassified
Reporter: [email protected]
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)([email protected]))</searchfilter>
Post Correction
<searchfilter>(&(objectclass=x-commonProfile)(sn=Millerp)(givenName=Markp)([email protected]))</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.