From 73ff8288a1b3119bb3acbb5c3a9a02eb6620c229 Mon Sep 17 00:00:00 2001 From: salo Date: Wed, 13 Apr 2005 17:00:14 +0000 Subject: Put the correct content into patch-ab.. *sigh* --- mail/gld/patches/patch-ab | 63 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 49 insertions(+), 14 deletions(-) (limited to 'mail/gld/patches') diff --git a/mail/gld/patches/patch-ab b/mail/gld/patches/patch-ab index 7714c0cb496..0aa167728aa 100644 --- a/mail/gld/patches/patch-ab +++ b/mail/gld/patches/patch-ab @@ -1,19 +1,54 @@ -$NetBSD: patch-ab,v 1.2 2005/04/13 16:36:07 salo Exp $ +$NetBSD: patch-ab,v 1.3 2005/04/13 17:00:14 salo Exp $ ---- sockets.h.orig 2005-04-13 12:13:23.000000000 -0400 -+++ sockets.h 2005-04-13 12:06:34.000000000 -0400 -@@ -118,10 +118,10 @@ +--- greylist.c.orig 2005-04-13 05:26:10.000000000 -0400 ++++ greylist.c 2005-04-13 12:03:39.000000000 -0400 +@@ -21,8 +21,11 @@ - /* DNS functions */ + ts=time(0); + strncpy(oip,ip,sizeof(oip)-1); ++oip[sizeof(oip)-1] = '\0'; + strncpy(osender,sender,sizeof(osender)-1); ++osender[sizeof(osender)-1] = '\0'; + strncpy(orecipient,recipient,sizeof(orecipient)-1); ++orecipient[sizeof(orecipient)-1] = '\0'; --int DnsIp(char *host,char *ip); --int DnsFQDN(char *host,char *fqdn); --int DnsName(char *ip,char *fqdn); --void GetPeerIp(int sock,char *ip,char *fqdn); -+int DnsIp(char *host,char *ip,size_t); -+int DnsFQDN(char *host,char *fqdn,size_t); -+int DnsName(char *ip,char *fqdn,size_t); -+void GetPeerIp(int sock,char *ip,size_t,char *fqdn,size_t); + if(conf->debug==1) printf("%d: Starting the greylist algo\n",pid); - /* Special Functions */ +@@ -68,10 +71,18 @@ + if(conf->debug==1) printf("%d: lightgrey on domain is on, let's keep the domain only on recipient and sender\n",pid); + domain=(char *)strstr(osender,"@"); +- if(domain!=NULL) strncpy(sender,domain,BLEN-1); ++ if(domain!=NULL) ++ { ++ strncpy(sender,domain,BLEN-1); ++ sender[BLEN-1] = '\0'; ++ } + + domain=(char *)strstr(orecipient,"@"); +- if(domain!=NULL) strncpy(recipient,domain,BLEN-1); ++ if(domain!=NULL) ++ { ++ strncpy(recipient,domain,BLEN-1); ++ recipient[BLEN-1] = '\0'; ++ } + } + + // +@@ -119,6 +130,7 @@ + if(domain==NULL) domain=osender; + + strncpy(netw,oip,sizeof(netw)-1); ++ netw[sizeof(netw)-1] = '\0'; + l=strlen(netw); + for(i=l-1;i>=0;i--) + if(netw[i]=='.') +@@ -148,7 +160,7 @@ + if(x==4) + { + snprintf(query,sizeof(query)-1,"%d.%d.%d.%d.%s",d,c,b,a,conf->dnswl); +- n=DnsIp(query,NULL); ++ n=DnsIp(query,NULL, 0); + if(conf->debug==1) printf("%d: DNSQuery=(%s) result=%ld\n",pid,query,n); + if(n==0) + { -- cgit v1.2.3