Skip to content

Commit

Permalink
Update to version 1.4.
Browse files Browse the repository at this point in the history
  • Loading branch information
logic committed Apr 21, 2000
1 parent a90dae9 commit 9275454
Show file tree
Hide file tree
Showing 15 changed files with 93 additions and 34 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
# $Id$
#
# $Log$
# Revision 1.3 2000/04/21 15:22:48 logic
# Update to version 1.3.
# Revision 1.4 2000/04/21 15:22:51 logic
# Update to version 1.4.
#
# Revision 1.7 1998/08/20 05:47:03 emarshal
# Some final cleanups. Bumped version to 1.4.
#
# Revision 1.6 1998/08/15 22:27:27 emarshal
# Fixed some formatting issues with combinations of -q and -t.
Expand Down Expand Up @@ -35,7 +38,7 @@ PREFIX=/usr/local/bin
# need this. Alternatively, it might be called "libbind" on your
# system.
#LDLIBS=-lresolv
LDLIBS=-lbind
#LDLIBS=-lbind

# Generic GCC. This is probably your best bet on most systems, but see
# below for an entry for your system.
Expand Down
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rblcheck 1.3 - Command-line interface to Paul Vixie's RBL filter.
rblcheck 1.4 - Command-line interface to Paul Vixie's RBL filter.
Copyright (C) 1997, Edward S. Marshall <[email protected]>

This program is free software; you can redistribute it and/or modify
Expand Down
17 changes: 17 additions & 0 deletions docs/CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
Changes since 1.3:

- Fixed output bug with some odd combinations of -q and -t.

- Added T_TXT and PACKETSZ definitions in the event that some systems
might not define them.

- Fixed error with return values not matching the advertised values.

- Fixed bug with rbl.dorkslayers.com's tendancy to use CNAMEs for
everything.

- Added support to dynamically grow the buffer used by res_query(), so
that we can always support whatever the RBLs send back to us.

- Minor documentation fixes.

Changes since 1.2:

- New feature: the ability to query multiple RBL-alike services in
Expand Down
5 changes: 4 additions & 1 deletion docs/CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The MAPS project <URL:http://maps.vix.com/>: A great gathering point for
given a pat on the back for the thankless hours they put into
maintaining an excellent resource for everyone.

Dorkslayers.com <URL:http://www.dorkslayer.com>: Another good RBL-alike
Dorkslayers.com <URL:http://www.dorkslayers.com/>: Another good RBL-alike
system, which focuses singularly on open email relays.

Stephen R. van den Berg <[email protected]>: For writing Procmail, a nifty
Expand Down Expand Up @@ -54,3 +54,6 @@ William Yang <[email protected]>: supplied early patches for

Timothy J Luoma <[email protected]>
Adam Shand <[email protected]>
Andrew Kelley <[email protected]>
Thomas Meyer <[email protected]>
Jonathan Bradshaw <[email protected]>
2 changes: 1 addition & 1 deletion docs/INSTALL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rblcheck 1.3 - Command-line interface to Paul Vixie's RBL filter.
rblcheck 1.4 - Command-line interface to Paul Vixie's RBL filter.
Copyright (C) 1997, Edward S. Marshall <[email protected]>

This program is free software; you can redistribute it and/or modify
Expand Down
5 changes: 5 additions & 0 deletions docs/TODO
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
- convert to using autoconf to help with portability issues, and redo the
Makefile to take full advantage of it.

- global config file for rblcheck, that contains all known RBL�alike
DNS schemes. Will this invoke more overhead than this program should
require, especially since the lists of sites will be static for the
most part? Comments welcome.

Send ideas to "[email protected]".
55 changes: 43 additions & 12 deletions rblcheck.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** rblcheck 1.3 - Command-line interface to Paul Vixie's RBL filter.
** rblcheck 1.4 - Command-line interface to Paul Vixie's RBL filter.
** Copyright (C) 1997, Edward S. Marshall <[email protected]>
**
** This program is free software; you can redistribute it and/or modify
Expand All @@ -21,8 +21,23 @@
** Revision history:
**
** $Log$
** Revision 1.3 2000/04/21 15:22:48 logic
** Update to version 1.3.
** Revision 1.4 2000/04/21 15:22:51 logic
** Update to version 1.4.
**
** Revision 1.13 1998/08/20 05:47:03 emarshal
** Some final cleanups. Bumped version to 1.4.
**
** Revision 1.12 1998/08/20 05:32:07 emarshal
** Dynamically allocate the res_query() buffer, to ensure we get all we
** asked for. This makes the assumption that res_query() returns the real
** size of the packet; Paul Vixie and other BIND maintainers have confirmed
** this, so it should be safe (even if it's undocumented).
**
** Revision 1.11 1998/08/20 05:10:28 emarshal
** Fixed error with rblcheck return values, pointed out by Thomas Meyer.
**
** Revision 1.10 1998/08/20 04:58:31 emarshal
** Added a fix for systems where T_TXT isn't defined (like SunOS 4.x).
**
** Revision 1.9 1998/08/15 22:27:27 emarshal
** Fixed some formatting issues with combinations of -q and -t.
Expand Down Expand Up @@ -70,13 +85,12 @@
#include <resolv.h>
#include <netdb.h>

#define VERSION "1.3"
#define VERSION "1.4"

#define RESULT_SIZE 4096 /* What is the longest result text we support? */

/* Simple linked list to hold the sites we support. See below to see how
to change the default list of servers. By default, we only support
the original Paul Vixie RBL. */
to change the default list of servers. */
struct rbl
{
char * site;
Expand Down Expand Up @@ -110,6 +124,14 @@ struct rbl
}
#endif

#ifndef T_TXT
#define T_TXT 16
#endif

#ifndef PACKETSZ
#define PACKETSZ 512
#endif

/* This might actually be needed on other platforms. */
#if defined(linux)
#include <getopt.h>
Expand Down Expand Up @@ -188,11 +210,13 @@ char * rblcheck( int a, int b, int c, int d, char * rbldomain, int txt )
{
char * domain;
char * result = NULL;
u_char answer[ PACKETSZ ];
u_char fixedans[ PACKETSZ ];
u_char * answer;
const u_char * cp;
u_char * rp;
const u_char * cend;
const u_char * rend;
int len;

/* 16 characters max in a dotted-quad address, plus 1 for null */
domain = ( char * )malloc( 17 + strlen( rbldomain ) );
Expand All @@ -202,12 +226,19 @@ char * rblcheck( int a, int b, int c, int d, char * rbldomain, int txt )

/* Make our DNS query. */
res_init();
res_query( domain, C_IN, T_A, answer, PACKETSZ );
answer = fixedans;
len = res_query( domain, C_IN, T_A, answer, PACKETSZ );

/* Was there a problem? If so, the domain doesn't exist. */
if( h_errno != 0 )
{
if( len == -1 )
return result;

if( len > PACKETSZ )
{
answer = malloc( len );
len = res_query( domain, C_IN, T_A, answer, len );
if( len == -1 )
return result;
}

result = ( char * )malloc( RESULT_SIZE );
Expand Down Expand Up @@ -289,7 +320,7 @@ int main( argc, argv )
struct rbl * ptr;

/* Add more sites you want in the default list of RBL-alike
systems here. */
systems here. ### An easier way to change this is needed. ### */
rblsites = togglesite( "rbl.maps.vix.com", rblsites );
rblsites = togglesite( "rbl.dorkslayers.com", rblsites );

Expand Down Expand Up @@ -361,7 +392,7 @@ int main( argc, argv )
txt && response && strlen( response ) && !quiet ? ": " : "",
txt && response ? response : "",
quiet && ( !txt || !strlen( response ) ) ? "" : "\n" );
if( !quiet && !response )
if( response )
rblfiltered++;
free( response );
}
Expand Down
4 changes: 2 additions & 2 deletions utils/dns/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# $Id$
#
# $Log$
# Revision 1.3 2000/04/21 15:22:48 logic
# Update to version 1.3.
# Revision 1.4 2000/04/21 15:22:51 logic
# Update to version 1.4.
#
# Revision 1.1 1998/01/27 02:10:33 emarshal
# Added dump.c, a quick utility for dumping an RR (sort of);
Expand Down
4 changes: 2 additions & 2 deletions utils/dns/dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
** $Id$
**
** $Log$
** Revision 1.3 2000/04/21 15:22:48 logic
** Update to version 1.3.
** Revision 1.4 2000/04/21 15:22:51 logic
** Update to version 1.4.
**
** Revision 1.1 1998/01/27 02:10:34 emarshal
** Added dump.c, a quick utility for dumping an RR (sort of);
Expand Down
4 changes: 2 additions & 2 deletions utils/qmail/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# $Id$
#
# $Log$
# Revision 1.3 2000/04/21 15:22:48 logic
# Update to version 1.3.
# Revision 1.4 2000/04/21 15:22:51 logic
# Update to version 1.4.
#
# Revision 1.1.1.1 1998/01/09 20:42:50 emarshal
# Initial import into CVS.
Expand Down
4 changes: 2 additions & 2 deletions utils/qmail/origip.awk
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
# $Id$
#
# $Log$
# Revision 1.3 2000/04/21 15:22:48 logic
# Update to version 1.3.
# Revision 1.4 2000/04/21 15:22:51 logic
# Update to version 1.4.
#
# Revision 1.1.1.1 1998/01/09 20:42:50 emarshal
# Initial import into CVS.
Expand Down
4 changes: 2 additions & 2 deletions utils/qmail/origip.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
** $Id$
**
** $Log$
** Revision 1.3 2000/04/21 15:22:48 logic
** Update to version 1.3.
** Revision 1.4 2000/04/21 15:22:51 logic
** Update to version 1.4.
**
** Revision 1.1.1.1 1998/01/09 20:42:50 emarshal
** Initial import into CVS.
Expand Down
4 changes: 2 additions & 2 deletions utils/sendmail/origip.pl
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# $Id$
#
# $Log$
# Revision 1.3 2000/04/21 15:22:48 logic
# Update to version 1.3.
# Revision 1.4 2000/04/21 15:22:51 logic
# Update to version 1.4.
#
# Revision 1.1.1.1 1998/01/09 20:42:50 emarshal
# Initial import into CVS.
Expand Down
4 changes: 2 additions & 2 deletions utils/test_origip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# $Id$
#
# $Log$
# Revision 1.3 2000/04/21 15:22:48 logic
# Update to version 1.3.
# Revision 1.4 2000/04/21 15:22:51 logic
# Update to version 1.4.
#
# Revision 1.1.1.1 1998/01/09 20:42:50 emarshal
# Initial import into CVS.
Expand Down
4 changes: 2 additions & 2 deletions utils/test_rblcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# $Id$
#
# $Log$
# Revision 1.3 2000/04/21 15:22:48 logic
# Update to version 1.3.
# Revision 1.4 2000/04/21 15:22:51 logic
# Update to version 1.4.
#
# Revision 1.1.1.1 1998/01/09 20:42:50 emarshal
# Initial import into CVS.
Expand Down

0 comments on commit 9275454

Please sign in to comment.