~ubuntu-branches/ubuntu/saucy/maradns/saucy

« back to all changes in this revision

Viewing changes to update/1.2.12.03/maradns-1.2.12.02-bad_query.patch

  • Committer: Bazaar Package Importer
  • Author(s): Kai Hendry
  • Date: 2006-10-09 17:44:21 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20061009174421-yb151elg3m4t5shl
Tags: 1.2.12.03-1
* New upstream release with many new doc tweaks. Though most of the changes
  are with the webpages which I have chosen not to distribute as you can
  read them all rather online at http://maradns.org/
* The diffs in the Makefiles are due to upstream's configure script
* Added bind2csv2.py as an example from upstream's tools/
  There is a lot of little scripts in tools/ which can probably join this

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
diff -ur maradns-1.2.12.03.orig/server/MaraDNS.c maradns-1.2.12.03/server/MaraDNS.c
 
2
--- maradns-1.2.12.03.orig/server/MaraDNS.c     2006-10-07 10:35:32.000000000 -0500
 
3
+++ maradns-1.2.12.03/server/MaraDNS.c  2006-10-07 10:42:06.000000000 -0500
 
4
@@ -414,13 +414,13 @@
 
5
 
 
6
 int udperror(int sock,js_string *raw, struct sockaddr_in *from,
 
7
              js_string *question, int error,
 
8
-             char *why,int min_log_level, int rd_val, conn *ect) {
 
9
+             char *why,int min_log_level, int rd_val, conn *ect,int log_msg) {
 
10
 
 
11
     q_header header;
 
12
     js_string *reply;
 
13
     int len_inet = sizeof(struct sockaddr);
 
14
 
 
15
-    if(log_level >= min_log_level) {
 
16
+    if(log_level >= min_log_level && log_msg == 1) {
 
17
         show_timestamp();
 
18
         zjlog(L_BAD_QUERY,raw); /* "Bad query received: " */
 
19
         if(ect != 0 && ect->type == 4) {
 
20
@@ -1022,7 +1022,7 @@
 
21
     giveerror:
 
22
         js_destroy(ar);
 
23
         udperror(sock,most,client,0,SERVER_FAIL,"giveerror in udpsuccess",2,
 
24
-                       rd_value,ect);
 
25
+                       rd_value,ect,1);
 
26
         js_destroy(most);
 
27
 
 
28
         /* Clean up the seenlist_where list */
 
29
@@ -1721,7 +1721,7 @@
 
30
         js_destroy(ar);
 
31
         js_destroy(ns);
 
32
         udperror(sock,most,client,0,SERVER_FAIL,"compression failure",2,
 
33
-                       rd_value,ect);
 
34
+                       rd_value,ect,1);
 
35
         js_destroy(most);
 
36
         return JS_ERROR;
 
37
         }
 
38
@@ -1761,7 +1761,7 @@
 
39
         js_destroy(ar);
 
40
         js_destroy(ns);
 
41
         udperror(sock,most,client,0,SERVER_FAIL,"giveerror in udpany",2,
 
42
-                       rd_value,ect);
 
43
+                       rd_value,ect,1);
 
44
         js_destroy(most);
 
45
 
 
46
         /* Clean up the seenlist_where list
 
47
@@ -2192,7 +2192,7 @@
 
48
     if(compress_data(most,ar) == JS_ERROR) {
 
49
         js_destroy(ar);
 
50
         udperror(sock,most,client,0,SERVER_FAIL,"compression failure",2,
 
51
-                       rd_value,ect);
 
52
+                       rd_value,ect,1);
 
53
         js_destroy(most);
 
54
         if(synth_ns_record != 0) { js_destroy(synth_ns_record); }
 
55
         return JS_ERROR;
 
56
@@ -2226,7 +2226,7 @@
 
57
         if(synth_ns_record != 0) { js_destroy(synth_ns_record); }
 
58
         js_destroy(ar);
 
59
         udperror(sock,most,client,0,SERVER_FAIL,"giveerror in udpstar",2,
 
60
-                       rd_value,ect);
 
61
+                       rd_value,ect,1);
 
62
         js_destroy(most);
 
63
         return JS_ERROR;
 
64
 
 
65
@@ -2443,7 +2443,7 @@
 
66
     if(compress_data(most,compressed) == JS_ERROR) {
 
67
         js_destroy(compressed);
 
68
         udperror(sock,most,client,0,SERVER_FAIL,"Compression failure",2,
 
69
-                       rd_value,ect);
 
70
+                       rd_value,ect,1);
 
71
         js_destroy(most);
 
72
         return JS_ERROR;
 
73
         }
 
74
@@ -2474,7 +2474,7 @@
 
75
     giveerror:
 
76
         js_destroy(compressed);
 
77
         udperror(sock,most,client,0,SERVER_FAIL,"giveerror in udpnotfound",2,
 
78
-                       rd_value,ect);
 
79
+                       rd_value,ect,1);
 
80
         js_destroy(most);
 
81
         return JS_ERROR;
 
82
 
 
83
@@ -2992,7 +2992,7 @@
 
84
     /* Get the header */
 
85
     if(read_hdr(raw,&header) == JS_ERROR) { /* Something went wrong,
 
86
                                                return error "Format error" */
 
87
-        udperror(sock,raw,0,0,FORMAT_ERROR,"Couldn't get header",2,0,ect);
 
88
+        udperror(sock,raw,0,0,FORMAT_ERROR,"Couldn't get header",2,0,ect,1);
 
89
         return JS_SUCCESS;
 
90
         }
 
91
 
 
92
@@ -3009,7 +3009,7 @@
 
93
     if(header.qdcount != 1) {
 
94
         if(no_fingerprint != 1)
 
95
             udperror(sock,raw,0,0,NOT_IMPLEMENTED,"Qdcount not 1",2,
 
96
-                           desires_recursion,ect);
 
97
+                           desires_recursion,ect,1);
 
98
         return JS_SUCCESS;
 
99
         }
 
100
 
 
101
@@ -3017,7 +3017,7 @@
 
102
     if(raw->unit_count < 14) {
 
103
         if(no_fingerprint != 1)
 
104
             udperror(sock,raw,0,0,FORMAT_ERROR,"bad question hdr",2,
 
105
-                           desires_recursion,ect);
 
106
+                           desires_recursion,ect,1);
 
107
         return JS_SUCCESS;
 
108
         }
 
109
 
 
110
@@ -3026,7 +3026,7 @@
 
111
     if(length < 0 || length > 255) {
 
112
         if(no_fingerprint != 1)
 
113
             udperror(sock,raw,0,0,FORMAT_ERROR,"bad question length",2,
 
114
-                           desires_recursion,ect);
 
115
+                           desires_recursion,ect,1);
 
116
         return JS_SUCCESS;
 
117
         }
 
118
 
 
119
@@ -3034,7 +3034,7 @@
 
120
                                            and 4 for the type and class */
 
121
         if(no_fingerprint != 1)
 
122
             udperror(sock,raw,0,0,FORMAT_ERROR,"question doesn't fit",2,
 
123
-                           desires_recursion,ect);
 
124
+                           desires_recursion,ect,1);
 
125
         return JS_SUCCESS;
 
126
         }
 
127
 
 
128
@@ -3042,13 +3042,13 @@
 
129
     if((lookfor = js_create(256,1)) == 0) {
 
130
         if(no_fingerprint != 1)
 
131
             udperror(sock,raw,0,0,SERVER_FAIL,
 
132
-                     "can't create lookfor string",2,desires_recursion,ect);
 
133
+                     "can't create lookfor string",2,desires_recursion,ect,1);
 
134
         return JS_ERROR;
 
135
         }
 
136
     if((origq = js_create(256,1)) == 0) {
 
137
         js_destroy(lookfor);
 
138
         udperror(sock,raw,0,0,SERVER_FAIL,"can't create origq string",2,
 
139
-                       desires_recursion,ect);
 
140
+                       desires_recursion,ect,1);
 
141
         return JS_ERROR;
 
142
         }
 
143
 
 
144
@@ -3063,7 +3063,7 @@
 
145
         /* Since TinyDNS also returns NOT_IMPLEMENTED here, no need for
 
146
            a fingerprint check. */
 
147
         udperror(sock,raw,0,lookfor,NOT_IMPLEMENTED,"non-0 opcode",2,
 
148
-                       desires_recursion,ect);
 
149
+                       desires_recursion,ect,1);
 
150
         return JS_SUCCESS;
 
151
         }
 
152
 
 
153
@@ -3073,7 +3073,7 @@
 
154
        *(raw->string + length + 15) != 1) {
 
155
         if(no_fingerprint != 1)
 
156
             udperror(sock,raw,0,lookfor,NOT_IMPLEMENTED,"Class not 1",2,
 
157
-                           desires_recursion,ect);
 
158
+                           desires_recursion,ect,1);
 
159
         return JS_ERROR;
 
160
         }
 
161
 
 
162
@@ -3538,7 +3538,7 @@
 
163
         else
 
164
 #endif
 
165
             udperror(sock,raw,0,0,REFUSED,
 
166
-            "I'm sorry Dave (recurse attempt)",3,desires_recursion,ect);
 
167
+            "I'm sorry Dave (recurse attempt)",3,desires_recursion,ect,1);
 
168
         js_destroy(lookfor); 
 
169
        js_destroy(origq); 
 
170
        js_destroy(lc);
 
171
@@ -3760,7 +3760,7 @@
 
172
         js_destroy(lc);
 
173
         if(no_fingerprint != 1)
 
174
             udperror(sock,raw,0,lookfor,SERVER_FAIL,
 
175
-                     "serv_fail in proc_query",2,desires_recursion,ect);
 
176
+                     "serv_fail in proc_query",2,desires_recursion,ect,1);
 
177
         js_destroy(lookfor);
 
178
         return JS_ERROR;
 
179
 
 
180
@@ -3769,7 +3769,7 @@
 
181
         js_destroy(lc);
 
182
         if(no_fingerprint != 1)
 
183
             udperror(sock,raw,0,lookfor,NOT_IMPLEMENTED,
 
184
-                     "not_impl in proc_query",2,desires_recursion,ect);
 
185
+                     "not_impl in proc_query",2,desires_recursion,ect,1);
 
186
         js_destroy(lookfor);
 
187
         return JS_ERROR;
 
188
 
 
189
diff -ur maradns-1.2.12.03.orig/server/recursive.c maradns-1.2.12.03/server/recursive.c
 
190
--- maradns-1.2.12.03.orig/server/recursive.c   2006-08-14 15:02:07.000000000 -0500
 
191
+++ maradns-1.2.12.03/server/recursive.c        2006-10-07 10:42:54.000000000 -0500
 
192
@@ -128,7 +128,7 @@
 
193
 extern int udperror(int sock,js_string *raw, struct sockaddr_in *from, 
 
194
                     js_string *question,
 
195
                    int error,char *why, int min_log_level, int rd_val, 
 
196
-                   conn *ect);
 
197
+                   conn *ect,int log_msg);
 
198
 extern int udpnotfound(rr *where, int id, int sock, 
 
199
                       struct sockaddr_in *client,js_string *query, 
 
200
                       int qtype, int rd_val, conn *ect, 
 
201
@@ -3202,7 +3202,7 @@
 
202
                         return JS_ERROR;
 
203
                         }
 
204
                     udperror(sock,synthesized_header,&client,query,SERVER_FAIL,
 
205
-                             "No reply from remote servers",2,1,0);
 
206
+                             "No reply from remote servers",2,1,0,0);
 
207
                     js_destroy(synthesized_header);
 
208
                     }
 
209
                }
 
210
@@ -3236,7 +3236,7 @@
 
211
                 return JS_ERROR;
 
212
                 }
 
213
             udperror(sock,synthesized_header,&client,query,SERVER_FAIL,
 
214
-                 "No reply from remote servers",2,1,0);
 
215
+                 "No reply from remote servers",2,1,0,0);
 
216
             js_destroy(synthesized_header);
 
217
             }
 
218
         }
 
219
@@ -3503,7 +3503,7 @@
 
220
             return JS_ERROR;
 
221
             }
 
222
         udperror(sock,synthesized_header,&client,query,FORMAT_ERROR,
 
223
-                 "Didn't spawn thread",2,1,0);
 
224
+                 "Didn't spawn thread",2,1,0,0);
 
225
         js_destroy(synthesized_header);
 
226
         return JS_ERROR;
 
227
         }