From 41fd0bc5df25fa4ad7dc908efda223a28379302e 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/distinfo | 4 +-- mail/gld/patches/patch-ab | 63 ++++++++++++++++++++++++++++++++++++----------- 2 files changed, 51 insertions(+), 16 deletions(-) (limited to 'mail') diff --git a/mail/gld/distinfo b/mail/gld/distinfo index 5ed1ca39ae4..887f77d8cda 100644 --- a/mail/gld/distinfo +++ b/mail/gld/distinfo @@ -1,10 +1,10 @@ -$NetBSD: distinfo,v 1.4 2005/04/13 16:36:07 salo Exp $ +$NetBSD: distinfo,v 1.5 2005/04/13 17:00:14 salo Exp $ SHA1 (gld-1.5.tgz) = febc398be2e68bf7b4bc6e3015da2f225760204d RMD160 (gld-1.5.tgz) = dab09c1776fb014effdd3d87d4a6808274bbfdd9 Size (gld-1.4.tgz) = 39030 bytes SHA1 (patch-aa) = ef415ff661dfe07d02158f5684b1cf182e76f757 -SHA1 (patch-ab) = bde3756d6d8180f13c87a36b69264de5ff385c7c +SHA1 (patch-ab) = 629b99be25d536ceb646d47f079455a4b092fe24 SHA1 (patch-ac) = 8d484c0d6a5cbc88f2c4c66143e6aa9a91131bf1 SHA1 (patch-ad) = 1083bdc0040696a5ac014204c1a4a8e35fdeda53 SHA1 (patch-ae) = d27cefd2784223792942bd0b5b95fb810972d308 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