Subject: [alpine-devel] New aport: ucspi-tcp

From: Francesco <[email-masked]>
Date: Sun, 15 Nov 2009 22:32:07 +0100

New aport, please review and commit.

:: Francesco Colista ::
diff -ruN --exclude conf-* ucspi-tcp-0.88/rblsmtpd.c ucspi-tcp-0.88.fix/rblsmtpd.c
--- ucspi-tcp-0.88/rblsmtpd.c	Sat Mar 18 10:18:42 2000
+++ ucspi-tcp-0.88.fix/rblsmtpd.c	Wed Aug  9 16:42:33 2000
@@ -60,16 +60,54 @@
 
 void rbl(char *base)
 {
+  int i;
+  char *altreply = 0;
   if (decision) return;
   if (!stralloc_copy(&tmp,&ip_reverse)) nomem();
+  i = str_chr(base, ':');
+  if (base[i]) {
+    base[i] = 0;
+    altreply = base+i+1;
+  }
   if (!stralloc_cats(&tmp,base)) nomem();
-  if (dns_txt(&text,&tmp) == -1) {
-    flagmustnotbounce = 1;
-    if (flagfailclosed) {
-      if (!stralloc_copys(&text,"temporary RBL lookup error")) nomem();
-      decision = 2;
+  if (altreply) {
+    if (dns_ip4(&text,&tmp) == -1) {
+      flagmustnotbounce = 1;
+      if (flagfailclosed) {
+        if (!stralloc_copys(&text,"temporary RBL lookup error")) nomem();
+        decision = 2;
+      }
+      return;
+    }
+    if (text.len) {
+      if(!stralloc_copys(&text, "")) nomem();
+      while(*altreply) {
+        char *x;
+        i = str_chr(altreply, '%');
+        if(!stralloc_catb(&text, altreply, i)) nomem();
+        if(altreply[i] &&
+           altreply[i+1]=='I' &&
+           altreply[i+2]=='P' &&
+           altreply[i+3]=='%') {
+          if(!stralloc_catb(&text, ip_env, str_len(ip_env))) nomem();
+          altreply+=i+4;
+        } else if(altreply[i]) {
+          if(!stralloc_cats(&text, "%")) nomem();
+          altreply+=i+1;
+        } else {
+          altreply+=i;
+        }
+      }
+    }
+  } else {
+    if (dns_txt(&text,&tmp) == -1) {
+      flagmustnotbounce = 1;
+      if (flagfailclosed) {
+        if (!stralloc_copys(&text,"temporary RBL lookup error")) nomem();
+        decision = 2;
+      }
+      return;
     }
-    return;
   }
   if (text.len)
     if (flagrblbounce)
diff -u ucspi-tcp-0.88.old/error.h ucspi-tcp-0.88/error.h
--- ucspi-tcp-0.88.old/error.h	2000-03-18 09:18:20.000000000 -0600
+++ ucspi-tcp-0.88/error.h	2003-01-08 13:39:12.000000000 -0600
@@ -1,7 +1,7 @@
 #ifndef ERROR_H
 #define ERROR_H
 
-extern int errno;
+#include <errno.h>

 extern int error_intr;
 extern int error_nomem;

---

From: Natanael Copa <[email-masked]>
Date: Tue, 17 Nov 2009 09:01:12 +0100

> New aport, please review and commit.

Thanks!

What does ucspi-tcp provide that busybox inetd does not?

Do we need an init.d script for it?

Do we want the makefile in /etc/tcprules.d that existed in alpine 1.8?
Its a makefile to generate .cdb files from rules files.

I added it to testing dir with minor modifications.

-nc

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---