google-code-export / ruby-activeldap

Automatically exported from code.google.com/p/ruby-activeldap
Other
1 stars 1 forks source link

when dn contains integer, exception occurs in "compute_dn" method of base.rb #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. a dn like "ifindex=1,cn=device1"
2. when delete, update the object, exception occurs

What version of the product are you using? On what operating system?

1.0.1

Additional Infomation:

I modified the compute_dn method in base.rb file to fix this issue:

    def compute_dn(escape_dn_value=false)
      return base if @dn_is_base

      dn_value = id
      if dn_value.nil?
        raise DistinguishedNameNotSetError.new,
                _("%s's DN attribute (%s) isn't set") % [self, dn_attribute]
      end
      unless dn_value.is_a?(Integer)
    dn_value = DN.escape_value(dn_value) if escape_dn_value
      end
      _base = base
      _base = nil if _base.empty?
      ["#{dn_attribute}=#{dn_value}", _base].compact.join(",")
    end

Original issue reported on code.google.com by ery....@gmail.com on 4 Feb 2009 at 1:57

GoogleCodeExporter commented 9 years ago
Thanks for reporting.
I've fixed it in trunk.

Original comment by kou...@gmail.com on 4 Feb 2009 at 12:44

GoogleCodeExporter commented 9 years ago
koutou, thx, any new release on rubyforge?

Original comment by ery....@gmail.com on 11 Feb 2009 at 6:34

GoogleCodeExporter commented 9 years ago
I've already requested it to will in ML:
http://rubyforge.org/pipermail/ruby-activeldap-discuss/2009-February/000739.html

It is not released yet but will be released soon. (I hope so.)

Original comment by kou...@gmail.com on 11 Feb 2009 at 6:40