my $config = {
yaml_dir => './yaml/',
- listen => 'localhost:2389',
+ listen => shift @ARGV || 'localhost:1389',
upstream_ldap => 'ldap.ffzg.hr',
upstream_ssl => 1,
overlay_prefix => 'ffzg-',
if ( defined $response->{protocolOp}->{searchResEntry} ) {
my $uid = $response->{protocolOp}->{searchResEntry}->{objectName};
- warn "## SEARCH $uid";
+ warn "## objectName $uid";
my @attrs;
}
-$ENV{LANG} = 'C'; # so we don't double-encode utf-8 if LANG is utf-8
-
my $listenersock = IO::Socket::INET->new(
Listen => 5,
Proto => 'tcp',
Reuse => 1,
LocalAddr => $config->{listen},
-);
+) || die "can't open listen socket: $!";
my $targetsock = $config->{upstream_ssl}
PeerPort => 389,
)
: IO::Socket::SSL->new( $config->{upstream_ldap} . ':ldaps')
- ;
+ || die "can't open upstream socket: $!";
run_proxy($listenersock,$targetsock);