LDAP connection types (was Re: LDAP not connecting over IPv6)
Quanah Gibson-Mount
quanah at zimbra.com
Wed Jun 1 01:20:21 CEST 2011
--On Wednesday, June 01, 2011 12:33 AM +0200 Mark Martinec
<Mark.Martinec+amavis at ijs.si> wrote:
> Quanah,
>
>> My one comment about this patch would be that the it doesn't support
>> using "ldapi", which is connecting to a local LDAP server over a unix
>> socket.
>
> It doesn't? The patch added the 'scheme' attribute to the $default_ldap
> hash just for this purpose - although I haven't tested it.
>
> Something along these lines would probably work according to
> the Net::LDAP documentation:
>
> $default_ldap = {
> hostname => '/socket/path/to/ldap',
> scheme => 'ldapi',
> ...
> };
Yeah, I was thinking about this part of the patch:
+ if (!defined $self->{scheme}) {
+ $self->{scheme} = $self->{hostname} =~ /^ldaps/i ? 'ldaps' : 'ldap';
+ }
since hostname could have "ldapi" in it, as per the Net::LDAP
documentation. This would change the method to "ldap" instead, which would
be wrong.
new ( HOST, OPTIONS )
Creates a new Net::LDAP object and opens a connection to the named host.
HOST may be a host name or an IP number. TCP port may be specified
after the host name followed by a colon (such as localhost:10389). The
default TCP port for LDAP is 389.
You can also specify a URI, such as 'ldaps://127.0.0.1:666' or
'ldapi://%2fvar%2flib%2fldap_sock'. Note that '%2f's in the LDAPI socket
path will be translated into '/'. This is to support LDAP query options
like base, search etc. although the query part of the URI will be ignored
in this context. If port was not specified in the URI, the default is
either 389 or 636 for 'LDAP' and 'LDAPS' schemes respectively.
--Quanah
--
Quanah Gibson-Mount
Sr. Member of Technical Staff
Zimbra, Inc
A Division of VMware, Inc.
--------------------
Zimbra :: the leader in open source messaging and collaboration
More information about the amavis-users
mailing list