perl-ldap
view release on metacpan or search on metacpan
* t/07filtermatch.t: use core module Text::Soundex instead of String::Approx
* Message.pm: fix regression w.r.t. Net::LDAP::Message::Dummy
Enhancements:
* Makefile.PL: make dependencies reflect reality better
* LDAP.pm: avoid warning in new() that might have occurred in corner cases
0.50_01 -- Sat Nov 17 18:05:15 CET 2012
Bug Fixes:
* RT#80482 fix display of =item inet6 in LDAP.pod
* RT#66753: new key & cert for SSL server tests
* RT#79763 Net::LDAP::Util's $VERSION increased
* t/06constant.t: numbering glitch in t/06constant.t
* FilterMatch.pm: fix mapping of greaterOrEqual
* FAQ.pod: small fixes
Enhancements:
* add constant LDAP_PROXY_AUTHZ_FAILURE
* FilterMatch.pm: complete overhaul
- update matching rules known in OpenLDAP
lib/Net/LDAP.pm view on Meta::CPAN
$obj->debug($arg->{debug} || 0 );
$obj->outer;
}
sub connect_ldap {
my ($ldap, $host, $arg) = @_;
my $port = $arg->{port} || 389;
my $class = (CAN_IPV6) ? CAN_IPV6 : 'IO::Socket::INET';
my $domain = $arg->{inet4} ? AF_INET : ($arg->{inet6} ? AF_INET6 : AF_UNSPEC);
# separate port from host overwriting given/default port
$host =~ s/^([^:]+|\[.*\]):(\d+)$/$1/ and $port = $2;
if ($arg->{inet6} && !CAN_IPV6) {
$@ = 'unable to load IO::Socket::INET6; no IPv6 support';
return undef;
}
$ldap->{net_ldap_socket} = $class->new(
PeerAddr => $host,
PeerPort => $port,
LocalAddr => $arg->{localaddr} || undef,
Proto => 'tcp',
($class eq 'IO::Socket::IP' ? 'Family' : 'Domain') => $domain,
lib/Net/LDAP.pm view on Meta::CPAN
$ldap->{net_ldap_port} = $port;
}
# Different OpenSSL verify modes.
my %ssl_verify = qw(none 0 optional 1 require 3);
sub connect_ldaps {
my ($ldap, $host, $arg) = @_;
my $port = $arg->{port} || 636;
my $domain = $arg->{inet4} ? AF_INET : ($arg->{inet6} ? AF_INET6 : AF_UNSPEC);
if ($arg->{inet6} && !CAN_IPV6) {
$@ = 'unable to load IO::Socket::INET6; no IPv6 support';
return undef;
}
require IO::Socket::SSL;
# separate port from host overwriting given/default port
$host =~ s/^([^:]+|\[.*\]):(\d+)$/$1/ and $port = $2;
$ldap->{net_ldap_socket} = IO::Socket::SSL->new(
lib/Net/LDAP.pod view on Meta::CPAN
values of attributes not matching this REGEX into Perl UTF-8 strings
so that the regular Perl operators (pattern matching, ...) can operate
as one expects even on strings with international characters.
If this option is not given, attribute values are treated as byte strings.
Example: raw =E<gt> qr/(?i:^jpegPhoto|;binary)/
=item inet4 =E<gt> N
=item inet6 =E<gt> N
Try to connect to the server using the specified IP protocol only,
i.e. either IPv4 or IPv6.
If the protocol selected is not supported, connecting will fail.
The default is to use any of the two protocols.
=back
B<Example>
t/40connect.t view on Meta::CPAN
$ldap = client(inet4 => 1);
ok($ldap, 'client with IPv4' .
($ldap ? (', bound to ' . $ldap->{net_ldap_socket}->peerhost) : ''));
SKIP: {
skip('No IPv6 capable IO::Socket module installed', 1)
unless (eval { require IO::Socket::INET6; } or
eval { require IO::Socket::IP; IO::Socket::IP->VERSION(0.20); });
$ldap = client(inet6 => 1);
ok($ldap, 'client with IPv6' .
($ldap ? (', bound to ' . $ldap->{net_ldap_socket}->peerhost) : ''));
}
t/common.pl view on Meta::CPAN
END {
kill_server();
}
sub client {
my %arg = @_;
my $ldap;
my $count;
local $^W = 0;
my %opt = map { $_ => $arg{$_} } grep { exists($arg{$_}) } qw/inet4 inet6 debug/;
if ($arg{ssl}) {
require Net::LDAPS;
until($ldap = Net::LDAPS->new($HOST, %opt, port => $SSL_PORT, version => 3)) {
die "ldaps://$HOST:$SSL_PORT/ $@" if ++$count > 10;
sleep 1;
}
}
elsif ($arg{ipc}) {
require Net::LDAPI;
( run in 0.504 second using v1.01-cache-2.11-cpan-87723dcf8b7 )