From: Graham B. <gb...@po...> - 2003-01-16 19:16:17
|
On Sat, Jan 11, 2003 at 04:48:18PM +0100, Peter Marschall wrote: > Hi, > > On Thursday 09 January 2003 14:43, Ziya Suzen wrote: > > I was running some tests on my sand-box station and because my OpenLDAP > > is compiled with TCP wrappers I cannot connect to it. Sure the > > solution can be adding slapd to hosts.allow but I thought a better > > solution could be using Unix sockets. And I came up with the following > > patch to LDAP.pm. What do you think? > > > > BTW, I have only tested ldapi:// syntax. I wanted to get your opinions > > before going any further. I think your ldaps:// implementation is wrong. It needs todo what Net::LDAPS is currently doing. I also think the connect dispatch should look something like if ($host_or_url =~m!^([a-z]+)://([/\w\.\-\@\#\~]+?)(?::(\d+))?/?$!i) { my $connect = $obj->can("_connect_$1") or croak("Cannot handle $1 URIs"); $host = $2; local $arg->{port} = $3 if $3; $obj->$connect($host, $arg); } The foreach to allow the user to pass multiple hosts should be around this and the old code. > there has been a similar patch on the list a few weeks ago. > It added a Net::LDAPI.pm file for the ldapi:// connection. That was going to be my reply too :) However after thinking for a bit, I think I like the option to pass a URI to Net::LDAP and have it DWIM. Being able to specify different protocols when giving a list of hosts to try to connect to might be useful. Graham. |