~ubuntu-branches/ubuntu/raring/maradns/raring

« back to all changes in this revision

Viewing changes to update/1.3.07.07/maradns-1.3.07.06-rd_val.patch

  • Committer: Bazaar Package Importer
  • Author(s): Kai Hendry
  • Date: 2010-01-24 12:17:40 UTC
  • mfrom: (1.1.13 upstream) (10.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20100124121740-a4e1fjobwaouz443
Tags: 1.4.02-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
--- maradns-1.3.07.06/server/udpsuccess.c       2007-10-19 08:52:20.000000000 -0500
2
 
+++ maradns-1.3.07.07/server/udpsuccess.c       2007-10-25 07:49:33.000000000 -0500
3
 
@@ -38,7 +38,6 @@
4
 
 extern int max_total;
5
 
 extern rr *seenlist[256];
6
 
 extern int seenlist_where;
7
 
-extern int rd_value;
8
 
 extern ipv4pair long_packet[512];
9
 
 
10
 
 /* If we successfully found a record, spit out that record on the
11
 
@@ -471,7 +470,7 @@
12
 
     header.qr = 1;
13
 
     header.opcode = 0;
14
 
     header.tc = 0;
15
 
-    header.rd = 0;
16
 
+    header.rd = rd_val; /* RDBUG udpsuccess */
17
 
     header.ra = 0;
18
 
     header.z = 0;
19
 
     header.rcode = 0; /* No error */
20
 
@@ -571,7 +570,7 @@
21
 
     giveerror:
22
 
         js_destroy(ar);
23
 
         udperror(sock,most,client,0,SERVER_FAIL,"giveerror in udpsuccess",2,
24
 
-                        rd_value,ect,1);
25
 
+                        rd_val,ect,1);
26
 
         js_destroy(most);
27
 
 
28
 
         /* Clean up the seenlist_where list */
29
 
--- maradns-1.3.07.06/server/MaraDNS.c  2007-10-19 08:52:20.000000000 -0500
30
 
+++ maradns-1.3.07.07/server/MaraDNS.c  2007-10-25 07:53:01.000000000 -0500
31
 
@@ -118,8 +118,10 @@
32
 
 
33
 
 rr *ra_data = 0; /* Bogus SOA to give out whenever a SOA request is sent */
34
 
 
35
 
-int rd_value = 0; /* Whether RD is set to 0 or 1 in replies to
36
 
-                     authoritative queries */
37
 
+/*int rd_value = 0;*/ /* Whether RD is set to 0 or 1 in replies to
38
 
+                         authoritative queries; disabled because you
39
 
+                         shouldn't use global variables in threaded
40
 
+                         code */
41
 
 
42
 
 int dos_protection_level = 0; /* How many features of MaraDNS we're willing
43
 
                                  to give up to make her more immune to
44
 
@@ -470,7 +472,7 @@
45
 
     header.aa = 0; /* Errors are never authoritative (unless they are
46
 
                       NXDOMAINS, which this is not) */
47
 
     header.tc = 0;
48
 
-    header.rd = rd_val;
49
 
+    header.rd = rd_val; /* RDBUG udperror */
50
 
     header.ra = 0;
51
 
     header.z = 0;
52
 
     header.rcode = error;
53
 
@@ -809,7 +811,7 @@
54
 
 
55
 
     /* Make the header a placeholder for now */
56
 
     header.id = id;
57
 
-    header.rd = rd_val;
58
 
+    header.rd = rd_val; /* RDBUG udpany */
59
 
     if(make_hdr(&header,most) == JS_ERROR)
60
 
         goto giveerror;
61
 
 
62
 
@@ -1178,7 +1180,7 @@
63
 
     header.qr = 1;
64
 
     header.opcode = 0;
65
 
     header.tc = 0;
66
 
-    header.rd = 0;
67
 
+    header.rd = rd_val; /* RDBUG udpany */
68
 
     header.ra = 0;
69
 
     header.aa = authoritative; /* Currently always 1 */
70
 
     header.z = 0;
71
 
@@ -1204,7 +1206,7 @@
72
 
         js_destroy(ar);
73
 
         js_destroy(ns);
74
 
         udperror(sock,most,client,0,SERVER_FAIL,"compression failure",2,
75
 
-                        rd_value,ect,1);
76
 
+                        rd_val,ect,1);
77
 
         js_destroy(most);
78
 
         return JS_ERROR;
79
 
         }
80
 
@@ -1244,7 +1246,7 @@
81
 
         js_destroy(ar);
82
 
         js_destroy(ns);
83
 
         udperror(sock,most,client,0,SERVER_FAIL,"giveerror in udpany",2,
84
 
-                        rd_value,ect,1);
85
 
+                        rd_val,ect,1);
86
 
         js_destroy(most);
87
 
 
88
 
         /* Clean up the seenlist_where list
89
 
@@ -1356,7 +1358,7 @@
90
 
     header.opcode = 0; /* Normal DNS */
91
 
     header.aa = 0; /* DDIP to A translations are never authoritative */
92
 
     header.tc = 0; /* A labels are too short to be truncated */
93
 
-    header.rd = 0; /* Recursion not desired */
94
 
+    header.rd = 0; /* Recursion not desired */ /* RDBUG easter egg */
95
 
     header.ra = 0; /* Recursion not available */
96
 
     header.z = 0; /* This must be 0 unless we are EDNS aware (we aren't) */
97
 
     header.rcode = 0; /* Success! */
98
 
@@ -1512,7 +1514,7 @@
99
 
     /* Make the header a placeholder for now */
100
 
     init_header(&header);
101
 
     header.id = id;
102
 
-    header.rd = rd_val;
103
 
+    header.rd = rd_val; /* RDBUG udpstar */
104
 
     if(make_hdr(&header,most) == JS_ERROR)
105
 
         goto giveerror;
106
 
 
107
 
@@ -1654,7 +1656,7 @@
108
 
     header.qr = 1;
109
 
     header.opcode = 0;
110
 
     header.tc = 0; /* To do: truncation handling */
111
 
-    header.rd = 0;
112
 
+    header.rd = 0; /* RDBUG udpstar */
113
 
     header.ra = 0;
114
 
     header.z = 0;
115
 
     header.rcode = 0; /* No error */
116
 
@@ -1675,7 +1677,7 @@
117
 
     if(compress_data(most,ar) == JS_ERROR) {
118
 
         js_destroy(ar);
119
 
         udperror(sock,most,client,0,SERVER_FAIL,"compression failure",2,
120
 
-                        rd_value,ect,1);
121
 
+                        rd_val,ect,1);
122
 
         js_destroy(most);
123
 
         if(synth_ns_record != 0) { js_destroy(synth_ns_record); }
124
 
         return JS_ERROR;
125
 
@@ -1709,7 +1711,7 @@
126
 
         if(synth_ns_record != 0) { js_destroy(synth_ns_record); }
127
 
         js_destroy(ar);
128
 
         udperror(sock,most,client,0,SERVER_FAIL,"giveerror in udpstar",2,
129
 
-                        rd_value,ect,1);
130
 
+                        rd_val,ect,1);
131
 
         js_destroy(most);
132
 
         return JS_ERROR;
133
 
 
134
 
@@ -1779,7 +1781,7 @@
135
 
 
136
 
     /* Make the header a placeholder for now */
137
 
     init_header(&header);
138
 
-    header.rd = rd_val;
139
 
+    header.rd = rd_val; /* RDBUG udpnotfound */
140
 
     header.id = id;
141
 
     if(make_hdr(&header,most) == JS_ERROR) {
142
 
         js_destroy(most); js_destroy(compressed);
143
 
@@ -1890,7 +1892,7 @@
144
 
     header.qr = 1;
145
 
     header.opcode = 0;
146
 
     header.tc = 0; /* To do: truncation handling */
147
 
-    header.rd = 0;
148
 
+    header.rd = 0; /* RDBUG udpnotfound */
149
 
     header.ra = 0;
150
 
     header.z = 0;
151
 
     /* Code that verifies that this host does not exist in
152
 
@@ -1936,7 +1938,7 @@
153
 
     if(compress_data(most,compressed) == JS_ERROR) {
154
 
         js_destroy(compressed);
155
 
         udperror(sock,most,client,0,SERVER_FAIL,"Compression failure",2,
156
 
-                        rd_value,ect,1);
157
 
+                        rd_val,ect,1);
158
 
         js_destroy(most);
159
 
         return JS_ERROR;
160
 
         }
161
 
@@ -1967,7 +1969,7 @@
162
 
     giveerror:
163
 
         js_destroy(compressed);
164
 
         udperror(sock,most,client,0,SERVER_FAIL,"giveerror in udpnotfound",2,
165
 
-                        rd_value,ect,1);
166
 
+                        rd_val,ect,1);
167
 
         js_destroy(most);
168
 
         return JS_ERROR;
169
 
 
170
 
@@ -2319,7 +2321,7 @@
171
 
     header.opcode = 0; /* Normal DNS */
172
 
     header.aa = 0; /* DDIP to A translations are never authoritative */
173
 
     header.tc = 0; /* A labels are too short to be truncated */
174
 
-    header.rd = 0; /* Recursion not desired */
175
 
+    header.rd = 0; /* Recursion not desired */ /* RDBUG ddip_check */
176
 
     header.ra = 0; /* Recursion not available */
177
 
     header.z = 0; /* This must be 0 unless we are EDNS aware (we aren't) */
178
 
     header.rcode = 0; /* Success! */
179
 
@@ -2414,7 +2416,7 @@
180
 
  */
181
 
 
182
 
 int hunt_single_query(js_string *query, int id, int sock,
183
 
-                      conn *ect, js_string *question) {
184
 
+                      conn *ect, js_string *question, int rd_val) {
185
 
     mhash_e spot_data;
186
 
     int qtype_o, qtype_q;
187
 
     /* js_string *lower; */
188
 
@@ -2432,11 +2434,11 @@
189
 
     if(spot_data.value != 0 && spot_data.datatype == MARA_DNSRR) {
190
 
         if(qtype_o == RR_A || qtype_q == RR_CNAME) {
191
 
             udpsuccess(spot_data.value,id,sock,0,question,
192
 
-                       spot_data.point,1,rd_value,ect,force_auth);
193
 
+                       spot_data.point,1,rd_val,ect,force_auth);
194
 
             }
195
 
         else {
196
 
             udpsuccess(spot_data.value,id,sock,0,question,
197
 
-                       spot_data.point,0,rd_value,ect,force_auth);
198
 
+                       spot_data.point,0,rd_val,ect,force_auth);
199
 
              }
200
 
         return JS_SUCCESS;
201
 
         }
202
 
@@ -2517,6 +2519,7 @@
203
 
                                allocated */
204
 
     struct sockaddr_in *z; /* Makes certain ugly declarations readable */
205
 
     int always_not_there = 0;
206
 
+    int rd_val = 0;
207
 
 
208
 
 
209
 
     /* Sanity checks */
210
 
@@ -2533,7 +2536,7 @@
211
 
         }
212
 
 
213
 
     /* See if they desire recursion or not */
214
 
-    desires_recursion = rd_value = header.rd;
215
 
+    desires_recursion = rd_val = header.rd;
216
 
 
217
 
     /* We only answer questions (Thanks to Roy Arends for pointing out this
218
 
        security flaw) */
219
 
@@ -2705,7 +2708,7 @@
220
 
     /* OK, start the complicated domain look up routine */
221
 
     /* Look for upper and lower case versions of the query as
222
 
        they asked it */
223
 
-    if(hunt_single_query(lookfor,header.id,sock,ect,origq) != 0) {
224
 
+    if(hunt_single_query(lookfor,header.id,sock,ect,origq,rd_val) != 0) {
225
 
         js_destroy(lookfor); js_destroy(origq); js_destroy(lc);
226
 
         return JS_SUCCESS;
227
 
         }
228
 
@@ -2720,7 +2723,7 @@
229
 
     if(change_rtype(lookfor,RR_CNAME) == JS_ERROR) {
230
 
         goto serv_fail;
231
 
         }
232
 
-    if(hunt_single_query(lookfor,header.id,sock,ect,origq) != 0) {
233
 
+    if(hunt_single_query(lookfor,header.id,sock,ect,origq,rd_val) != 0) {
234
 
         js_destroy(lookfor); js_destroy(origq); js_destroy(lc);
235
 
         return JS_SUCCESS;
236
 
         }
237
 
--- maradns-1.3.07.06/sqa/regressions/do.tests  2007-10-19 08:52:19.000000000 -0500
238
 
+++ maradns-1.3.07.07/sqa/regressions/do.tests  2007-10-25 07:49:32.000000000 -0500
239
 
@@ -53,7 +53,7 @@
240
 
 TESTS=$TESTS"long.chunk noat_parse_bug noise percent_parse_bug "
241
 
 TESTS=$TESTS"predator1 predator2 ptr_leak recurse_delegation "
242
 
 TESTS=$TESTS"star_handling_1 star_handling_2 star_handling_leak "
243
 
-TESTS=$TESTS"truncation zoneserver_doc improper_rotation "
244
 
+TESTS=$TESTS"truncation zoneserver_doc improper_rotation rd_val "
245
 
 
246
 
 # Test to make sure synthetic ips in csv2 zone files correctly handle 
247
 
 # MaraDNS bound to private and public IPs
248
 
--- maradns-1.3.07.06/sqa/regressions/mararc_n_ipv6_bind_address/do.test        2007-10-04 15:11:10.000000000 -0500
249
 
+++ maradns-1.3.07.07/sqa/regressions/mararc_n_ipv6_bind_address/do.test        2007-10-25 09:29:06.000000000 -0500
250
 
@@ -25,7 +25,7 @@
251
 
 sleep 1
252
 
 #../../../tools/askmara Awww.example.com.
253
 
 dig @fecf:aff0::1 www.example.com | grep -v DiG | grep -v WHEN | grep -v time \
254
 
-       | grep -v HEADER
255
 
+       | grep -v HEADER | grep -v flags
256
 
 echo done
257
 
 sleep 1
258
 
 killall maradns
259
 
--- maradns-1.3.07.06/sqa/regressions/mararc_n_ipv6_bind_address/output.success 2007-10-04 15:11:19.000000000 -0500
260
 
+++ maradns-1.3.07.07/sqa/regressions/mararc_n_ipv6_bind_address/output.success 2007-10-25 09:29:23.000000000 -0500
261
 
@@ -2,7 +2,6 @@
262
 
 ; (1 server found)
263
 
 ;; global options:  printcmd
264
 
 ;; Got answer:
265
 
-;; flags: qr aa; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
266
 
 
267
 
 ;; QUESTION SECTION:
268
 
 ;www.example.com.              IN      A