Lines 1-6
Link Here
|
1 |
--- rblcheck.c.orig Thu Nov 8 14:05:27 2001 |
1 |
--- rblcheck.c 2002-11-16 21:32:39 UTC |
2 |
+++ rblcheck.c Wed May 1 08:19:16 2002 |
2 |
+++ rblcheck.c 2020-03-19 11:45:01 EST |
3 |
@@ -28,8 +28,10 @@ |
3 |
@@ -21,15 +21,15 @@ |
|
|
4 |
** |
5 |
*/ |
6 |
|
7 |
-#include "config.h" |
8 |
- |
9 |
#include <stdio.h> |
10 |
#include <string.h> |
4 |
#include <sys/types.h> |
11 |
#include <sys/types.h> |
5 |
#include <netinet/in.h> |
12 |
#include <netinet/in.h> |
6 |
#include <arpa/nameser.h> |
13 |
#include <arpa/nameser.h> |
Lines 11-17
Link Here
|
11 |
|
18 |
|
12 |
/*-- PORTABILITY ------------------------------------------------------------*/ |
19 |
/*-- PORTABILITY ------------------------------------------------------------*/ |
13 |
|
20 |
|
14 |
@@ -184,7 +186,7 @@ |
21 |
@@ -184,23 +184,26 @@ struct rbl * togglesite( char * sitename |
15 |
* domain. If "txt" is non-zero, we perform a TXT record lookup. We |
22 |
* domain. If "txt" is non-zero, we perform a TXT record lookup. We |
16 |
* return the text returned from a TXT match, or an empty string, on |
23 |
* return the text returned from a TXT match, or an empty string, on |
17 |
* a successful match, or NULL on an unsuccessful match. */ |
24 |
* a successful match, or NULL on an unsuccessful match. */ |
Lines 20-28
Link Here
|
20 |
{ |
27 |
{ |
21 |
char * domain; |
28 |
char * domain; |
22 |
char * result = NULL; |
29 |
char * result = NULL; |
23 |
@@ -195,12 +197,15 @@ |
30 |
u_char fixedans[ PACKETSZ ]; |
24 |
const u_char * cend; |
31 |
u_char * answer; |
25 |
const u_char * rend; |
32 |
- const u_char * cp; |
|
|
33 |
- u_char * rp; |
34 |
- const u_char * cend; |
35 |
- const u_char * rend; |
36 |
+ const char * cp; |
37 |
+ char * rp; |
38 |
+ const char * cend; |
39 |
+ const char * rend; |
26 |
int len; |
40 |
int len; |
27 |
+ u_char *p; |
41 |
+ u_char *p; |
28 |
+ int i, j; |
42 |
+ int i, j; |
Lines 37-44
Link Here
|
37 |
|
51 |
|
38 |
/* Make our DNS query. */ |
52 |
/* Make our DNS query. */ |
39 |
res_init(); |
53 |
res_init(); |
40 |
@@ -242,8 +247,8 @@ |
54 |
@@ -239,11 +242,11 @@ char * rblcheck( int a, int b, int c, in |
41 |
cp = answer + sizeof( HEADER ); |
55 |
} |
|
|
56 |
|
57 |
/* Skip the header and the address we queried. */ |
58 |
- cp = answer + sizeof( HEADER ); |
59 |
+ cp = (const char *)answer + sizeof(HEADER); |
42 |
while( *cp != '\0' ) |
60 |
while( *cp != '\0' ) |
43 |
{ |
61 |
{ |
44 |
- a = *cp++; |
62 |
- a = *cp++; |
Lines 48-54
Link Here
|
48 |
cp++; |
66 |
cp++; |
49 |
} |
67 |
} |
50 |
|
68 |
|
51 |
@@ -258,8 +263,8 @@ |
69 |
@@ -258,8 +261,8 @@ char * rblcheck( int a, int b, int c, in |
52 |
cp += ( NS_INT16SZ * 2 ) + NS_INT32SZ; |
70 |
cp += ( NS_INT16SZ * 2 ) + NS_INT32SZ; |
53 |
|
71 |
|
54 |
/* Get the length and end of the buffer. */ |
72 |
/* Get the length and end of the buffer. */ |
Lines 59-65
Link Here
|
59 |
|
77 |
|
60 |
/* Iterate over any multiple answers we might have. In |
78 |
/* Iterate over any multiple answers we might have. In |
61 |
this context, it's unlikely, but anyway. */ |
79 |
this context, it's unlikely, but anyway. */ |
62 |
@@ -267,10 +272,10 @@ |
80 |
@@ -267,10 +270,10 @@ char * rblcheck( int a, int b, int c, in |
63 |
rend = result + RESULT_SIZE - 1; |
81 |
rend = result + RESULT_SIZE - 1; |
64 |
while( cp < cend && rp < rend ) |
82 |
while( cp < cend && rp < rend ) |
65 |
{ |
83 |
{ |
Lines 74-80
Link Here
|
74 |
{ |
92 |
{ |
75 |
if( *cp == '\n' || *cp == '"' || |
93 |
if( *cp == '\n' || *cp == '"' || |
76 |
*cp == '\\' ) |
94 |
*cp == '\\' ) |
77 |
@@ -289,22 +294,39 @@ |
95 |
@@ -289,22 +292,38 @@ char * rblcheck( int a, int b, int c, in |
78 |
* RBL listing, handling output of results if necessary. */ |
96 |
* RBL listing, handling output of results if necessary. */ |
79 |
int full_rblcheck( char * addr ) |
97 |
int full_rblcheck( char * addr ) |
80 |
{ |
98 |
{ |
Lines 86-92
Link Here
|
86 |
char * response; |
104 |
char * response; |
87 |
struct rbl * ptr; |
105 |
struct rbl * ptr; |
88 |
+ int fail; |
106 |
+ int fail; |
89 |
+ int c; |
|
|
90 |
|
107 |
|
91 |
for( ptr = rblsites; ptr != NULL; ptr = ptr->next ) |
108 |
for( ptr = rblsites; ptr != NULL; ptr = ptr->next ) |
92 |
{ |
109 |
{ |