/[virtual-ldap]/bin/ldap-rewrite.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /bin/ldap-rewrite.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 29 by dpavlin, Tue Mar 17 09:39:05 2009 UTC revision 37 by dpavlin, Wed Mar 25 21:24:33 2009 UTC
# Line 20  use YAML qw/LoadFile/; Line 20  use YAML qw/LoadFile/;
20    
21  my $config = {  my $config = {
22          yaml_dir => './yaml/',          yaml_dir => './yaml/',
23          listen => 'localhost:1389',          listen => shift @ARGV || 'localhost:1389',
24          upstream_ldap => 'ldap.ffzg.hr',          upstream_ldap => 'ldap.ffzg.hr',
25          upstream_ssl => 1,          upstream_ssl => 1,
26          overlay_prefix => 'ffzg-',          overlay_prefix => 'ffzg-',
# Line 99  sub log_response { Line 99  sub log_response {
99    
100          if ( defined $response->{protocolOp}->{searchResEntry} ) {          if ( defined $response->{protocolOp}->{searchResEntry} ) {
101                  my $uid = $response->{protocolOp}->{searchResEntry}->{objectName};                  my $uid = $response->{protocolOp}->{searchResEntry}->{objectName};
102                  warn "## SEARCH $uid";                  warn "## objectName $uid";
103    
104                  my @attrs;                  my @attrs;
105    
# Line 170  sub run_proxy { Line 170  sub run_proxy {
170  }  }
171    
172    
 $ENV{LANG} = 'C'; # so we don't double-encode utf-8 if LANG is utf-8  
   
173  my $listenersock = IO::Socket::INET->new(  my $listenersock = IO::Socket::INET->new(
174          Listen => 5,          Listen => 5,
175          Proto => 'tcp',          Proto => 'tcp',
# Line 189  my $targetsock = $config->{upstream_ssl} Line 187  my $targetsock = $config->{upstream_ssl}
187          : IO::Socket::SSL->new( $config->{upstream_ldap} . ':ldaps')          : IO::Socket::SSL->new( $config->{upstream_ldap} . ':ldaps')
188          || die "can't open upstream socket: $!";          || die "can't open upstream socket: $!";
189    
 binmode( $listenersock );  
 binmode( $targetsock );  
   
190  run_proxy($listenersock,$targetsock);  run_proxy($listenersock,$targetsock);
191    
192  1;  1;

Legend:
Removed from v.29  
changed lines
  Added in v.37

  ViewVC Help
Powered by ViewVC 1.1.26