/[mdap]/mdap-server.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 /mdap-server.pl

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

revision 24 by dpavlin, Mon Apr 23 23:11:30 2007 UTC revision 25 by dpavlin, Mon Apr 23 23:32:49 2007 UTC
# Line 116  sub ant_credentials { Line 116  sub ant_credentials {
116  my $ant_unknown_password;  my $ant_unknown_password;
117  my $ant_ok_password;  my $ant_ok_password;
118    
119    sub ant_unknown_password {
120            my $ant = shift || die "no ant?";
121            if ( $ant_unknown_password->{$ant} ) {
122                    $ant_unknown_password->{$ant}--;
123            }
124            return $ant_unknown_password->{$ant};
125    }
126    
127  sub ant_another_passwd {  sub ant_another_passwd {
128          my $ant = shift || die "no ant?";          my $ant = shift || die "no ant?";
129          return 0 if ( $ant_unknown_password->{$ant} );  
130            return 0 if ant_unknown_password( $ant );
131    
132          $ant_passwd->{$ant}++;          $ant_passwd->{$ant}++;
133    
134          if ( $ant_passwd->{$ant} > $#try_accounts ) {          if ( $ant_passwd->{$ant} > $#try_accounts ) {
135                  print "$ant ant with unknown password\n";                  print "$ant ant with unknown password\n";
136                  $ant_unknown_password->{$ant}++;                  $ant_unknown_password->{$ant} = 60;
137                  $ant_passwd->{$ant} = 0;                  $ant_passwd->{$ant} = 0;
138                  return 0;                  return 0;
139          }          }
# Line 176  while (1) { Line 185  while (1) {
185                  my ($user_id,$user_pwd) = ant_credentials( $ant );                  my ($user_id,$user_pwd) = ant_credentials( $ant );
186    
187                  if ($type eq 'REPLY-ANT-SEARCH') {                  if ($type eq 'REPLY-ANT-SEARCH') {
188                          mdap_send("INFO MDAP/$mdap_ver\r\nSEQ-NR:1\r\nTO-ANT:$ant\r\nUSER-ID:$user_id\r\nUSER-PWD:$user_pwd\r\n") unless ( $ant_unknown_password->{$ant} );                          mdap_send("INFO MDAP/$mdap_ver\r\nSEQ-NR:1\r\nTO-ANT:$ant\r\nUSER-ID:$user_id\r\nUSER-PWD:$user_pwd\r\n") unless ant_unknown_password( $ant );
189                  } elsif ($type eq 'REPLY-INFO') {                  } elsif ($type eq 'REPLY-INFO') {
190    
191                          if ( $seq_nr < 0 ) {                          if ( $seq_nr < 0 ) {

Legend:
Removed from v.24  
changed lines
  Added in v.25

  ViewVC Help
Powered by ViewVC 1.1.26