Skip to content
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

Fix unknow pdu Error and show the Ber class #352

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/net/ldap/pdu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class Error < RuntimeError; end

def initialize(ber_object)
begin
@message_id = ber_object[0].to_i
@message_id = ber_object[0]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the benefit of removing this coercion?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ggalancs ☝️

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HarlemSquirrel Believe this was to prevent a few casting issues when the item could not be converted into an integer. Run into a few of these myself when testing.

# Grab the bottom five bits of the identifier so we know which type of
# PDU this is.
#
Expand All @@ -94,7 +94,7 @@ def initialize(ber_object)
@app_tag = ber_object[1].ber_identifier & 0x1f
@ldap_controls = []
rescue Exception => ex
raise Net::LDAP::PDU::Error, "LDAP PDU Format Error: #{ex.message}"
raise Net::LDAP::PDU::Error, "LDAP PDU Format Error: #{ex.message} Ber Object is #{ber_object}"
end

case @app_tag
Expand Down Expand Up @@ -123,7 +123,7 @@ def initialize(ber_object)
when ExtendedResponse
parse_extended_response(ber_object[1])
else
raise LdapPduError.new("unknown pdu-type: #{@app_tag}")
raise Net::LDAP::PDU::Error, "unknown pdu-type: #{@app_tag}"
end

parse_controls(ber_object[2]) if ber_object[2]
Expand Down
2 changes: 1 addition & 1 deletion lib/net/ldap/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Net
class LDAP
VERSION = "0.16.2"
VERSION = "0.16.2.3"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change the version here?

end
end