projects
/
virtual-ldap
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
09e629f
)
better errors if sockets can't be opened
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 17 Mar 2009 09:39:05 +0000
(09:39 +0000)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 17 Mar 2009 09:39:05 +0000
(09:39 +0000)
bin/ldap-rewrite.pl
patch
|
blob
|
history
diff --git
a/bin/ldap-rewrite.pl
b/bin/ldap-rewrite.pl
index
6d63f5d
..
db97950
100755
(executable)
--- a/
bin/ldap-rewrite.pl
+++ b/
bin/ldap-rewrite.pl
@@
-20,7
+20,7
@@
use YAML qw/LoadFile/;
my $config = {
yaml_dir => './yaml/',
my $config = {
yaml_dir => './yaml/',
- listen => 'localhost:
2
389',
+ listen => 'localhost:
1
389',
upstream_ldap => 'ldap.ffzg.hr',
upstream_ssl => 1,
overlay_prefix => 'ffzg-',
upstream_ldap => 'ldap.ffzg.hr',
upstream_ssl => 1,
overlay_prefix => 'ffzg-',
@@
-177,7
+177,7
@@
my $listenersock = IO::Socket::INET->new(
Proto => 'tcp',
Reuse => 1,
LocalAddr => $config->{listen},
Proto => 'tcp',
Reuse => 1,
LocalAddr => $config->{listen},
-);
+)
|| die "can't open listen socket: $!"
;
my $targetsock = $config->{upstream_ssl}
my $targetsock = $config->{upstream_ssl}
@@
-187,7
+187,10
@@
my $targetsock = $config->{upstream_ssl}
PeerPort => 389,
)
: IO::Socket::SSL->new( $config->{upstream_ldap} . ':ldaps')
PeerPort => 389,
)
: IO::Socket::SSL->new( $config->{upstream_ldap} . ':ldaps')
- ;
+ || die "can't open upstream socket: $!";
+
+binmode( $listenersock );
+binmode( $targetsock );
run_proxy($listenersock,$targetsock);
run_proxy($listenersock,$targetsock);