-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfix/filter parser fails to parse blackets #157
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. |
@@ -10,6 +10,10 @@ def test_multibyte_characters | |||
assert_kind_of Net::LDAP::Filter, Net::LDAP::Filter::FilterParser.parse("(cn=名前)") | |||
end | |||
|
|||
def test_brackets | |||
assert_kind_of Net::LDAP::Filter, Net::LDAP::Filter::FilterParser.parse("(cn=[{something}])") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.