Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

ldapi:// + SASL authentication fix. #1

Merged
merged 1 commit into from

2 participants

@cmikk

When performing SASL authentication, the Net::LDAP calls the ->peerhost() method on the LDAP connection's IO::Socket object. For UNIX domain sockets, no peerhost() method is defined. This patch checks whether the peerhost() method is defined before calling it.

Chris Mikkelson Check whether LDAP socket object has a peerhost() method defined
before calling it. This fixes SASL authentication over UNIX domain
(ldapi://) sockets.
163be7b
@gbarr gbarr referenced this pull request from a commit
@gbarr gbarr Merged pull request #1 from cmikk/master.
ldapi:// + SASL authentication fix.
bdd254c
@gbarr gbarr merged commit bdd254c into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 28, 2011
  1. Check whether LDAP socket object has a peerhost() method defined

    Chris Mikkelson authored
    before calling it. This fixes SASL authentication over UNIX domain
    (ldapi://) sockets.
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/Net/LDAP.pm
View
5 lib/Net/LDAP.pm
@@ -384,7 +384,10 @@ sub bind {
# If we're talking to a round-robin, the canonical name of
# the host we are talking to might not match the name we
# requested
- my $connected_name = $ldap->{net_ldap_socket}->peerhost;
+ my $connected_name;
+ if ($ldap->{net_ldap_socket}->can('peerhost')) {
+ $connected_name = $ldap->{net_ldap_socket}->peerhost;
+ }
$connected_name ||= $ldap->{net_ldap_host};
$sasl_conn = eval {
Something went wrong with that request. Please try again.