Feature #12811

ASCII-8BIT to UTF-8 problems -update net-ldap with net-ldap-1 -v0.4.0

Added by Terence Mill almost 5 years ago. Updated almost 2 years ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:LDAP
Target version:-
Resolution:

Description

There are net-ldap charset bugs which hit when using the library far redmnine usage, e.g in redmine_ldap_sync plugin

The bug is solved in net-ldap-1 -v 0.4.0

Please upgrade and testbed.


Related issues

Related to Redmine - Feature #17618: Upgrade net-ldap version to 0.12.0 Closed
Related to Redmine - Defect #21453: LDAP account creation fails when first name/last name con... Closed

History

#1 Updated by Miodrag Milic almost 5 years ago

+1.

You also cant add it to the Gemfile.local so u need to change it after each update.

#2 Updated by Ricardo S almost 5 years ago

+1

#3 Updated by Etienne Massip almost 5 years ago

net-ldap-1 is actually not the same gem but a gem specifically bundled for this fix ; the problem has been fixed in net-ldap master but is maybe not to be released soon because project has become inactive since then.

#4 Updated by Jean-Philippe Lang almost 5 years ago

Sad to see that there's no stable gem for using LDAP. I would prefer to include the patch in Redmine rather than switching to this gem. Does this single fix below solve the encoding problems?

https://github.com/ruby-ldap/ruby-net-ldap/pull/44/files

#5 Updated by Terence Mill almost 5 years ago

Jean-Philippe Lang wrote:

Sad to see that there's no stable gem for using LDAP. I would prefer to include the patch in Redmine rather than switching to this gem. Does this single fix below solve the encoding problems?

https://github.com/ruby-ldap/ruby-net-ldap/pull/44/files

Yes, that shall fix it.

#6 Updated by Terence Mill over 4 years ago

Please pull this patch into the next release, as redmine_ldap_sync is a major plugin and without in some cases unsuable.

#7 Updated by Ricardo S over 4 years ago

In the meanwhile I've included the following patch on the ldap_sync plugin.

require 'net/ldap'

module Net::BER::Extensions::String
  def raw_utf8_encoded
    if self.respond_to?(:encode) && self.encoding.name != 'ASCII-8BIT'
      self.encode('UTF-8').force_encoding('ASCII-8BIT')
    else
      self
    end
  end
end

If it gets integrated on the next release I'll remove it.

#9 Updated by Etienne Massip about 3 years ago

#10 Updated by Jan from Planio www.plan.io almost 2 years ago

  • Description updated (diff)

Removing link to net-ldap-1. Please note the -1 at the end -- it's not the official gem!

Using it instead of the proper net-ldap gem as specified in Redmine's Gemfile can lead to a severe authentication bypass scenario under certain circumstances because net-ldap-1 changes how successful or unsuccessful authentication is reported back to the caller (Redmine).

Please do not use net-ldap-1 and wait (or help work on) a proper fix for this in Redmine.

#11 Updated by Toshi MARUYAMA almost 2 years ago

  • Category changed from Gems support to LDAP

#12 Updated by Toshi MARUYAMA almost 2 years ago

  • Related to Defect #21453: LDAP account creation fails when first name/last name contain non ASCII added

Also available in: Atom PDF