diff options
author | Sergei Kolobov <sergei@FreeBSD.org> | 2003-12-16 14:23:34 +0000 |
---|---|---|
committer | Sergei Kolobov <sergei@FreeBSD.org> | 2003-12-16 14:23:34 +0000 |
commit | 25c4ecbe6b2842cdeee08243ad287a628a6fd189 (patch) | |
tree | eaaa761cfecbb1fb515dbe45b9a9b2fee9d476f8 /mail/relaydb | |
parent | 3598fff7c6b37d7e5c08069a2e697c570ec60396 (diff) | |
download | ports-25c4ecbe6b2842cdeee08243ad287a628a6fd189.tar.gz ports-25c4ecbe6b2842cdeee08243ad287a628a6fd189.zip |
Notes
Diffstat (limited to 'mail/relaydb')
-rw-r--r-- | mail/relaydb/Makefile | 1 | ||||
-rw-r--r-- | mail/relaydb/files/patch-Makefile | 10 | ||||
-rw-r--r-- | mail/relaydb/files/patch-relaydb.8 | 9 | ||||
-rw-r--r-- | mail/relaydb/files/patch-relaydb.c | 66 |
4 files changed, 56 insertions, 30 deletions
diff --git a/mail/relaydb/Makefile b/mail/relaydb/Makefile index b21edf21c231..0fb399da8db4 100644 --- a/mail/relaydb/Makefile +++ b/mail/relaydb/Makefile @@ -7,6 +7,7 @@ PORTNAME= relaydb PORTVERSION= 1.6 +PORTREVISION= 1 CATEGORIES= mail MASTER_SITES= http://www.benzedrine.cx/ diff --git a/mail/relaydb/files/patch-Makefile b/mail/relaydb/files/patch-Makefile deleted file mode 100644 index 7b6f4b59f675..000000000000 --- a/mail/relaydb/files/patch-Makefile +++ /dev/null @@ -1,10 +0,0 @@ ---- Makefile.orig Sun Dec 14 17:39:34 2003 -+++ Makefile Sun Dec 14 17:39:41 2003 -@@ -4,6 +4,6 @@ PROG= relaydb - SRCS= relaydb.c - MAN= relaydb.8 - --CFLAGS+= -Wall -Werror -Wstrict-prototypes -ansi -+CFLAGS+= -Wall -Wstrict-prototypes -ansi - - .include <bsd.prog.mk> diff --git a/mail/relaydb/files/patch-relaydb.8 b/mail/relaydb/files/patch-relaydb.8 index 3db2378c40a9..44af4c6e33cc 100644 --- a/mail/relaydb/files/patch-relaydb.8 +++ b/mail/relaydb/files/patch-relaydb.8 @@ -1,5 +1,5 @@ --- relaydb.8.orig Fri Nov 21 00:41:34 2003 -+++ relaydb.8 Sun Dec 14 17:13:01 2003 ++++ relaydb.8 Sun Dec 14 21:21:35 2003 @@ -30,7 +30,7 @@ .Nd spam relay database .Sh SYNOPSIS @@ -9,7 +9,7 @@ .Op Fl B Ar [+-]num .Op Fl W Ar [+-]num .Op Fl m Ar [+-]days -@@ -118,6 +118,12 @@ +@@ -118,6 +118,15 @@ establish a new whitelist entry for a new host, then send spam from the same address, faking further Received: headers, to cause relaydb to blacklist those addresses, causing a denial of service for these addresses. @@ -18,7 +18,10 @@ +.Fl l +does) the IP addresses of a database in pre-1.5 format, necessary +for upgrading from earlier versions of -+.Nm . ++.Nm . Incompatible with ++.Fl l ++and ++.Fl d . .It Fl r Revert a previously made decision. For instance, if a mail has been run through diff --git a/mail/relaydb/files/patch-relaydb.c b/mail/relaydb/files/patch-relaydb.c index 02918d1669ed..348d8fa33bfe 100644 --- a/mail/relaydb/files/patch-relaydb.c +++ b/mail/relaydb/files/patch-relaydb.c @@ -1,5 +1,5 @@ --- relaydb.c.orig Sun Dec 14 15:59:30 2003 -+++ relaydb.c Sun Dec 14 17:22:40 2003 ++++ relaydb.c Tue Dec 16 18:58:52 2003 @@ -47,6 +47,11 @@ time_t mtime; }; @@ -12,34 +12,56 @@ extern char *__progname; const int bufsiz = 1024; const int factor = 3; -@@ -318,7 +323,7 @@ +@@ -318,7 +323,8 @@ if (d.mtime >= mtime) continue; if (debug) - printf("touching %u %s\n", mtime, address); -+ printf("touching %lu %s\n", mtime, address); ++ printf("touching %lu %s\n", ++ (unsigned long)mtime, address); d.mtime = mtime; memset(&dbk, 0, sizeof(dbk)); dbk.size = strlen(address); -@@ -364,7 +369,7 @@ +@@ -349,6 +355,7 @@ + int pos = 0, r; + struct data d; + unsigned count = 0; ++ unsigned long time_read; + + if (debug) + printf("importing %s\n", filename); +@@ -364,8 +371,8 @@ buf[pos] = 0; pos = 0; - r = sscanf(buf, "%127s %d %d %u", address, +- &d.white, &d.black, &d.mtime); + r = sscanf(buf, "%127s %d %d %lu", address, - &d.white, &d.black, &d.mtime); ++ &d.white, &d.black, &time_read); if (r == 3) d.mtime = time(NULL); -@@ -379,7 +384,7 @@ + else if (r != 4) { +@@ -373,14 +380,16 @@ + buf); + fclose(f); + return; +- } ++ } else ++ d.mtime = time_read; + if (!((use_v4 && address_valid_v4(address)) || + (use_v6 && address_valid_v6(address))) || address_private(address)) continue; if (debug) - printf("adding %s %d %d %u\n", +- address, d.white, d.black, d.mtime); + printf("adding %s %d %d %lu\n", - address, d.white, d.black, d.mtime); ++ address, d.white, d.black, ++ (unsigned long)d.mtime); memset(&dbk, 0, sizeof(dbk)); dbk.size = strlen(address); -@@ -405,7 +410,7 @@ + dbk.data = address; +@@ -405,7 +414,7 @@ void usage() { @@ -48,7 +70,7 @@ "[-BW [+-]num] [-m [+-]days]\n\t[-f filename] " "[-i filename] [-t filename]\n", __progname); exit(1); -@@ -414,7 +419,7 @@ +@@ -414,7 +423,7 @@ int main(int argc, char *argv[]) { @@ -57,7 +79,7 @@ const char *filename = NULL, *import = NULL, *syslog = NULL; time_t mtime = 0; int mtime_op = 0; -@@ -423,7 +428,7 @@ +@@ -423,7 +432,7 @@ int ch; unsigned count = 0; @@ -66,7 +88,7 @@ switch (ch) { case '4': use_v4 = 1; -@@ -482,6 +487,9 @@ +@@ -482,6 +491,9 @@ case 'n': traverse = 0; break; @@ -76,7 +98,7 @@ case 'r': reverse = 1; break; -@@ -496,7 +504,7 @@ +@@ -496,9 +508,14 @@ } } @@ -84,17 +106,27 @@ + if (!old_list && !list && !delete && !action && import == NULL && syslog == NULL) usage(); ++ if (old_list && (list || delete)) { ++ fprintf(stderr, "-O is incompatible with -l and -d\n"); ++ return (1); ++ } ++ if (delete && !action && !mtime && black == -1 && white == -1) { -@@ -583,7 +591,7 @@ + fprintf(stderr, "to delete all entries, delete the file\n"); + return (1); +@@ -583,8 +600,9 @@ continue; if (list) { if (debug) - printf("%s %d %d %u\n", +- a, d.white, d.black, d.mtime); + printf("%s %d %d %lu\n", - a, d.white, d.black, d.mtime); ++ a, d.white, d.black, ++ (unsigned long)d.mtime); else printf("%s\n", a); -@@ -600,6 +608,40 @@ + } else { +@@ -600,6 +618,40 @@ count++; } } @@ -135,12 +167,12 @@ } else { if (debug) printf("reading mail headers, considering the mail " -@@ -609,7 +651,7 @@ +@@ -609,7 +661,7 @@ if (delete && !list) printf("%u entries deleted\n", count); - if (!list && db->sync(db, 0)) -+ if (!list && !old_list && db->sync(db, 0)) ++ if (!old_list && !list && db->sync(db, 0)) fprintf(stderr, "db->sync() %s\n", strerror(errno)); if (db->close(db)) fprintf(stderr, "db->close() %s\n", strerror(errno)); |