Bugfix/filter parser fails to parse blackets#157
Conversation
Conflicts: lib/net/ldap/filter.rb spec/unit/ldap/filter_parser_spec.rb
|
@satoryu 👍 I'm not familiar with the bracket syntax in your code. What does it mean, and how is it used? Could you point me to where it's declared in the spec? I found http://tools.ietf.org/html/rfc4511#section-4.5.1.7, but did not dig further into X.511 Clause 7.8. |
There was a problem hiding this comment.
What does it mean, and how is it used?
Do you point this cn=[{something}] ? if so, this filter does not make sense as a filter.
As I read the article, I came to think FilterParser should parse a given string including []{} as a filter.
There was a problem hiding this comment.
I see, this just allows other valid characters to be constructed into a filter. @satoryu could you write an integration test against OpenLDAP to ensure this is valid? There are instructions here. Also, have you tested this to be valid against ActiveDirectory?
There was a problem hiding this comment.
I got it 🍣 I'll try to write an integration test.
now I'm using this patch against ActiveDirectory. it works well in my environment :)
|
I am not familiar with ruby, but I have a problem to set filter in Redmine, while this bug is present in this library. Developer sent me to this library... http://www.redmine.org/issues/11289 I fixed it temporarily like so: root@samui:# diff -up ruby/1.9.1/gems/net-ldap-0.3.1/lib/net/ldap/filter.rb.bak ruby/1.9.1/gems/net-ldap-0.3.1/lib/net/ldap/filter.rb
--- ruby/1.9.1/gems/net-ldap-0.3.1/lib/net/ldap/filter.rb.bak 2014-11-11 16:25:00.619443359 +0500
+++ ruby/1.9.1/gems/net-ldap-0.3.1/lib/net/ldap/filter.rb 2014-11-13 13:34:51.391417719 +0500
@@ -733,7 +733,7 @@ class Net::LDAP::Filter
scanner.scan(/\s*/)
if op = scanner.scan(/<=|>=|!=|:=|=/)
scanner.scan(/\s*/)
- if value = scanner.scan(/(?:[-\w*.+@=,#\$%&!'\s]|\\[a-fA-F\d]{2})+/)
+ if value = scanner.scan(/(?:[-\w*.+@=,\[\]#\$%&!'\s]|\\[a-fA-F\d]{2})+/)
# 20100313 AZ: Assumes that "(uid=george*)" is the same as
# "(uid=george* )". The standard doesn't specify, but I can find
# no examples that suggest otherwise. |
|
Sorry, guys. just I've confirmed the updates works well in Integration Test. |
…rse_blackets Bugfix/filter parser fails to parse blackets
…ils_to_parse_blackets Bugfix/filter parser fails to parse blackets
I forgot I sent a pull-request #72 to the upstream repository. the upstream has been evolving since I sent the pull request.
So I've merged the head of the branch master and rewrite a test code.
@jch Thank you for informing me.