source: npl/commonservers/ucspi-tcp/ucspi-tcp-0.88.a_record.patch @ c5c522c

gcc484ntopperl-5.22
Last change on this file since c5c522c was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100644
File size: 1.8 KB
  • ucspi-tcp-0.88

    diff -ruN --exclude conf-* ucspi-tcp-0.88/rblsmtpd.c ucspi-tcp-0.88.fix/rblsmtpd.c
    old new  
    6060
    6161void rbl(char *base)
    6262{
     63  int i;
     64  char *altreply = 0;
    6365  if (decision) return;
    6466  if (!stralloc_copy(&tmp,&ip_reverse)) nomem();
     67  i = str_chr(base, ':');
     68  if (base[i]) {
     69    base[i] = 0;
     70    altreply = base+i+1;
     71  }
    6572  if (!stralloc_cats(&tmp,base)) nomem();
    66   if (dns_txt(&text,&tmp) == -1) {
    67     flagmustnotbounce = 1;
    68     if (flagfailclosed) {
    69       if (!stralloc_copys(&text,"temporary RBL lookup error")) nomem();
    70       decision = 2;
     73  if (altreply) {
     74    if (dns_ip4(&text,&tmp) == -1) {
     75      flagmustnotbounce = 1;
     76      if (flagfailclosed) {
     77        if (!stralloc_copys(&text,"temporary RBL lookup error")) nomem();
     78        decision = 2;
     79      }
     80      return;
     81    }
     82    if (text.len) {
     83      if(!stralloc_copys(&text, "")) nomem();
     84      while(*altreply) {
     85        char *x;
     86        i = str_chr(altreply, '%');
     87        if(!stralloc_catb(&text, altreply, i)) nomem();
     88        if(altreply[i] &&
     89           altreply[i+1]=='I' &&
     90           altreply[i+2]=='P' &&
     91           altreply[i+3]=='%') {
     92          if(!stralloc_catb(&text, ip_env, str_len(ip_env))) nomem();
     93          altreply+=i+4;
     94        } else if(altreply[i]) {
     95          if(!stralloc_cats(&text, "%")) nomem();
     96          altreply+=i+1;
     97        } else {
     98          altreply+=i;
     99        }
     100      }
     101    }
     102  } else {
     103    if (dns_txt(&text,&tmp) == -1) {
     104      flagmustnotbounce = 1;
     105      if (flagfailclosed) {
     106        if (!stralloc_copys(&text,"temporary RBL lookup error")) nomem();
     107        decision = 2;
     108      }
     109      return;
    71110    }
    72     return;
    73111  }
    74112  if (text.len)
    75113    if (flagrblbounce)
Note: See TracBrowser for help on using the repository browser.