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

« back to all changes in this revision

Viewing changes to update/1.3.03/maradns-1.3.02-restrict_hash_pipe.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.02/parse/Csv2_rr_txt.c  2006-07-17 20:50:44.000000000 -0700
2
 
+++ maradns-1.3.03/parse/Csv2_rr_txt.c  2007-01-26 21:27:39.000000000 -0800
3
 
@@ -1,4 +1,4 @@
4
 
-/* Copyright (c) 2004-2006 Sam Trenholme
5
 
+/* Copyright (c) 2004-2007 Sam Trenholme
6
 
  *
7
 
  * TERMS
8
 
  *
9
 
@@ -409,8 +409,31 @@
10
 
                         * quoted text; this should be fixed */
11
 
                        if(csv2_is_quote(look)) {
12
 
                                state = TXT_GET_STATE;
13
 
-                       }
14
 
-                       else {
15
 
+                       } else if(stream->tilde_handling == 103) {
16
 
+                               if(look == '#') {
17
 
+                                       csv2_error(stream,
18
 
+                           "The # character is not allowed in TXT records\n"
19
 
+                           "Please use the '\\x23' escape sequence instead.");
20
 
+                                       return 0;
21
 
+                               } else if(look == '|') {
22
 
+                                       csv2_error(stream,
23
 
+                           "The | character is not allowed in TXT records\n"
24
 
+                           "Please use the '\\x7c' escape sequence instead.");
25
 
+                                       return 0;
26
 
+                               } else if(look == 127) {
27
 
+                                       csv2_error(stream,
28
 
+                           "The DEL character is not allowed in TXT records\n"
29
 
+                           "Please use the '\\x7f' escape sequence instead.");
30
 
+                               } else if(look < ' ') {
31
 
+                                       csv2_error(stream,
32
 
+   "Control characters (including newlines) are not allowed in TXT records\n"
33
 
+                        "Please use the appropriate escape sequence instead.");
34
 
+                                       return 0;
35
 
+                               } else if(csv2_txt_append(out, look, &txt_len) 
36
 
+                                       != 1) {
37
 
+                                       return 0;
38
 
+                               }
39
 
+                       } else {
40
 
                                if(csv2_txt_append(out, look, &txt_len) != 1) {
41
 
                                        return 0;
42
 
                                }
43
 
--- maradns-1.3.03/doc/en/source/update.ej.orig 2007-01-26 18:54:21.000000000 -0800
44
 
+++ maradns-1.3.03/doc/en/source/update.ej      2007-01-26 21:25:35.000000000 -0800
45
 
@@ -245,6 +245,23 @@
46
 
 in TXT records.
47
 
 
48
 
 <p>
49
 
+Note that, if tildes are used to separate records, the following restrictions
50
 
+are added to TXT records:
51
 
+
52
 
+<ul>
53
 
+<li>The pipe (|) character is not allowed in TXT records.  Use the '\x7c' 
54
 
+    escape sequence instead.  For example, change a TXT record that looks
55
 
+    like 'ls | more' to become 'ls '\x7c' more'
56
 
+
57
 
+<li>The pipe (#) character is not allowed in TXT records.  Use the '\x23' 
58
 
+    escape sequence instead.  For example, change a TXT record that looks
59
 
+    like 'press the # key' to become 'press the '\x23' key'
60
 
+
61
 
+<li>Control characters, including the newline character, are not allowed.
62
 
+    The escape sequence used depends on the desired control character.
63
 
+    For example, use \x0a for a UNIX linefeed.
64
 
+</ul>
65
 
+<p>
66
 
 Another MaraDNS 1.3 change only affects the unusual case when one has
67
 
 delegation NS records.  Let us suppose we have a zone file with the
68
 
 following records:
69
 
--- maradns-1.3.02/doc/en/source/csv2.ej        2007-01-09 12:16:34.000000000 -0800
70
 
+++ maradns-1.3.03/doc/en/source/csv2.ej        2007-01-26 21:48:27.000000000 -0800
71
 
@@ -1,5 +1,5 @@
72
 
 <HEAD>
73
 
-<TH>CSV2 5 "December 2006" MARADNS "MaraDNS reference"</TH>
74
 
+<TH>CSV2 5 "January 2007" MARADNS "MaraDNS reference"</TH>
75
 
 <DTWIDTH>3</DTWIDTH>
76
 
 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=utf-8">
77
 
 </HEAD>
78
 
@@ -9,7 +9,7 @@
79
 
 <h1>DESCRIPTION</h1>
80
 
 The csv2 zone file format is the zone file format introduced in MaraDNS 1.2.
81
 
 This zone file format uses any kind of whitespace (space, tab, and carriage
82
 
-return), or the '|' character, to deliminate fields.  i
83
 
+return), or the '|' character, to deliminate fields.  
84
 
 
85
 
 <h2>Tilde delimination</h2>
86
 
 
87
 
@@ -17,7 +17,7 @@
88
 
 in csv2 zone files; in order to maintain maximum compatibility with
89
 
 MaraDNS 1.2 zone files, this feature is only enabled if a tilde is
90
 
 placed between the first and second record.  Otherwise, tildes are
91
 
-not allowed in zone files at all.
92
 
+not allowed in zone files.
93
 
 
94
 
 <p>
95
 
 
96
 
@@ -186,7 +186,13 @@
97
 
 </pre>
98
 
 
99
 
 Any binary data can be specified; see the <b>csv2_txt(5)</b> manual page
100
 
-for full details.
101
 
+for full details.  
102
 
+<p>
103
 
+
104
 
+If tildes are used to separate records, a TXT record can not contain a
105
 
+'|' (pipe) character, a '#' character, nor any ASCII control character;
106
 
+these characters can be added to a TXT record via the use of escape
107
 
+sequences; read the csv2_txt man page for details.
108
 
 
109
 
 <h2>SPF</h2>
110
 
 
111
 
--- maradns-1.3.02/doc/en/source/csv2_txt.ej    2006-12-21 00:34:46.000000000 -0800
112
 
+++ maradns-1.3.03/doc/en/source/csv2_txt.ej    2007-01-26 21:46:07.000000000 -0800
113
 
@@ -1,5 +1,5 @@
114
 
 <HEAD>
115
 
-<TH>CSV2_TXT 5 "February 2005" MARADNS "MaraDNS reference"</TH>
116
 
+<TH>CSV2_TXT 5 "January 2007" MARADNS "MaraDNS reference"</TH>
117
 
 <DTWIDTH>3</DTWIDTH>
118
 
 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=utf-8">
119
 
 </HEAD>
120
 
@@ -28,8 +28,11 @@
121
 
 a.example.com. TXT 'This is some text' ~
122
 
 </pre>
123
 
 
124
 
-It is also possible, to place almost any byte with
125
 
-a value less than 0x80 (128) between quotes.  If there are any bytes
126
 
+It is also possible, to place almost any printable ASCII characters 
127
 
+between quotes.  The '~' (tilde) character is not allowed unless 
128
 
+csv2_tilde_handling has a value of 0; the '|' (pipe), '#' (hash) and
129
 
+non-printable ASCII control characters are not allowed in TXT data
130
 
+if the ~ is used to separate records.  If there are any bytes
131
 
 with a value of 0x80 or more, the data must be UTF-8 encoded Unicode.
132
 
 <hibit>
133
 
 For example:
134
 
@@ -43,9 +46,9 @@
135
 
 
136
 
 <p>
137
 
 
138
 
-The ASCII characters not allowed in quotes are the ' character, the
139
 
-'|' character, the '~' (tilde) character, and the '#' character.  See 
140
 
-BACKSLASH ESCAPE SEQUENCES below for information on adding these 
141
 
+The printable ASCII characters not allowed in quotes are the ' character,
142
 
+the '|' character, the '~' (tilde) character, and the '#' character.
143
 
+See BACKSLASH ESCAPE SEQUENCES below for information on adding these
144
 
 characters to TXT or RAW fields.
145
 
 
146
 
 <h2>UNQUOTED DATA</h2>
147
 
@@ -77,13 +80,12 @@
148
 
 <h2>BACKSLASH ESCAPE SEQUENCES</h2>
149
 
 
150
 
 In order to accommodate storing non-UTF-8 high bit characters, the
151
 
-single quote character, the '|', '~', and '#' characters, and to permit 
152
 
-multi-line
153
 
-TXT/RAW records (with comments allowed mid-record), the TXT/RAW RR allows
154
 
-backslashes.  These backslashes only have significance <i>outside</i>
155
 
-of quoted text; if they are placed inside single quotes, they are not
156
 
-interpreted and result in a literal backslash being added to the resource
157
 
-record data.
158
 
+single quote character, non-printable ASCII control codes, the '|',
159
 
+'~', and '#' characters, and to permit multi-line TXT/RAW records
160
 
+(with comments allowed mid-record), the TXT/RAW RR allows backslashes.
161
 
+These backslashes only have significance <i>outside</i> of quoted text;
162
 
+if they are placed inside single quotes, they are not interpreted and
163
 
+result in a literal backslash being added to the resource record data.
164
 
 
165
 
 <p>
166
 
 
167
 
@@ -135,38 +137,38 @@
168
 
 hi-bit data:
169
 
 
170
 
 <pre>
171
 
-e.example.com. TXT \x80\x81\x82\x83
172
 
+e.example.com. TXT \x80\x81\x82\x83 ~
173
 
 </pre>
174
 
 
175
 
 This same data can also be created as follows:
176
 
 
177
 
 <pre>
178
 
-f.example.com. TXT \200\201\202\203
179
 
+f.example.com. TXT \200\201\202\203 ~
180
 
 </pre>
181
 
 
182
 
 Octal and hex information can be mixed:
183
 
 
184
 
 <pre>
185
 
-g.example.com. TXT \200\x81\202\x83
186
 
+g.example.com. TXT \200\x81\202\x83 ~
187
 
 </pre>
188
 
 
189
 
 Literal single quotes can be placed in resource records:
190
 
 
191
 
 <pre>
192
 
-h.example.com. TXT 'perl -e '\''print "A Perl of a TXT record!\n"'\'
193
 
+h.example.com. TXT 'perl -e '\''print "A Perl of a TXT record!\n"'\' ~
194
 
 </pre>
195
 
 
196
 
 The above example produces this record:
197
 
 
198
 
 <pre>
199
 
-perl -e 'print "A Perl of a TXT record!\n"'
200
 
+perl -e 'print "A Perl of a TXT record!\n"' ~
201
 
 </pre>
202
 
 
203
 
 To render the '~' character, use the escape sequence \x7e (outside of
204
 
 quotes).  For example:
205
 
 
206
 
 <pre>
207
 
-h1.example.com. TXT 'http://ocf.berkeley.edu/'\x7e'set'
208
 
+h1.example.com. TXT 'http://ocf.berkeley.edu/'\x7e'set' ~
209
 
 </pre>
210
 
 
211
 
 Produces this record:
212
 
@@ -178,7 +180,7 @@
213
 
 To render the '|' character, use the escape sequence \x7c:
214
 
 
215
 
 <pre>
216
 
-h2.example.com. TXT 'ls '\x7c' more'
217
 
+h2.example.com. TXT 'ls '\x7c' more' ~
218
 
 </pre>
219
 
 
220
 
 Produces this record:
221
 
@@ -190,7 +192,7 @@
222
 
 To render the '#' character, use the escape sequence \x23:
223
 
 
224
 
 <pre>
225
 
-h3.example.com. TXT 'Press '\x23' for customer service'
226
 
+h3.example.com. TXT 'Press '\x23' for customer service' ~
227
 
 </pre>
228
 
 
229
 
 Produces this record:
230
 
@@ -206,7 +208,7 @@
231
 
 record will span more than one line on an 80-column display:
232
 
 
233
 
 <pre>
234
 
-i.example.com. TXT 'Not only did the quick brown fox jump over the lazy dog, but the lazy dog jumped over the cat.'
235
 
+i.example.com. TXT 'Not only did the quick brown fox jump over the lazy dog, but the lazy dog jumped over the cat.' ~
236
 
 </pre>
237
 
 
238
 
 Without affecting this resource record, the same data can be split over 
239
 
@@ -215,7 +217,7 @@
240
 
 <pre>
241
 
 j.example.com. TXT 'Not only did the quick brown fox jump '\
242
 
                    'over the lazy dog, but the lazy dog'\
243
 
-                   ' jumped over the cat.'
244
 
+                   ' jumped over the cat.' ~
245
 
 </pre>
246
 
 
247
 
 Some points:
248
 
@@ -235,7 +237,7 @@
249
 
 <pre>
250
 
 k.example.com. TXT 'Not only did the quick brown fox jump '\ # The fox
251
 
                    'over the lazy dog, but the lazy dog'\    # The dog
252
 
-                   ' jumped over the cat.'                   # The cat
253
 
+                   ' jumped over the cat.' ~                 # The cat
254
 
 </pre>
255
 
 
256
 
 Note that, since the third comment is not preceeded by a backslash, this
257
 
@@ -253,7 +255,7 @@
258
 
 
259
 
 # Now we have some more comments, 
260
 
 # followed by the rest of the data
261
 
-    'and this is the rest of the data'
262
 
+    'and this is the rest of the data' ~
263
 
 </pre>
264
 
 
265
 
 <p>
266
 
@@ -265,22 +267,22 @@
267
 
 bytes long.  The default is to have one chunk, as follows:
268
 
 
269
 
 <pre>
270
 
-o.example.com. TXT 'TXT record with only one chunk'
271
 
+o.example.com. TXT 'TXT record with only one chunk' ~
272
 
 </pre>
273
 
 
274
 
 It is also possible to have a record with multiple chunks.  Chunks
275
 
 are delimited by an unquoted ';' character:
276
 
 
277
 
 <pre>
278
 
-p.example.com. TXT 'This is chunk one';'This is chunk two'
279
 
+p.example.com. TXT 'This is chunk one';'This is chunk two' ~
280
 
 </pre>
281
 
 
282
 
 Or:
283
 
 
284
 
 <pre>
285
 
-q.example.com. TXT 'This is chunk one';\ # Our first chunk
286
 
-                    This_is_chunk_two;\  # Our second chunk
287
 
-                   'This is chunk three' # Our final chunk
288
 
+q.example.com. TXT 'This is chunk one';\   # Our first chunk
289
 
+                    This_is_chunk_two;\    # Our second chunk
290
 
+                   'This is chunk three' ~ # Our final chunk
291
 
 </pre>
292
 
 
293
 
 Quoted ; characters simply add a ; to the record data.
294
 
@@ -300,14 +302,14 @@
295
 
 It is possible to have zero length chunks:
296
 
 
297
 
 <pre>
298
 
-r.example.com. TXT 'chunk one';;'chunk three' # Chunk two zero-length
299
 
+r.example.com. TXT 'chunk one';;'chunk three' ~ # Chunk two zero-length
300
 
 </pre>
301
 
 
302
 
 In particular, is is possible to have zero length chunks at the
303
 
 beginning and end of a TXT record:
304
 
 
305
 
 <pre>
306
 
-s.example.com. TXT ;'chunk two'; # Chunks one and three zero-length
307
 
+s.example.com. TXT ;'chunk two'; ~ # Chunks one and three zero-length
308
 
 </pre>
309
 
 
310
 
 Do not place semicolons at the beginning nor end of TXT records unless
311
 
@@ -328,27 +330,27 @@
312
 
 following manners:
313
 
 
314
 
 <pre>
315
 
-t1.example.com. RAW 40 \x10\x01\x02'Kitchen sink'\x2b' data'
316
 
+t1.example.com. RAW 40 \x10\x01\x02'Kitchen sink'\x2b' data' ~
317
 
 </pre>
318
 
 
319
 
 <pre>
320
 
-t.example.com. RAW 40 \020\001\002Kitchen' sink+ data'
321
 
+t.example.com. RAW 40 \020\001\002Kitchen' sink+ data' ~
322
 
 </pre>
323
 
 
324
 
 <pre>
325
 
-u.example.com. RAW 40 \x10\x01\x02Kitchen\x20sink+\x20data
326
 
+u.example.com. RAW 40 \x10\x01\x02Kitchen\x20sink+\x20data ~
327
 
 </pre>
328
 
 
329
 
 <pre>
330
 
 v.example.com. RAW 40 \x10\001\x02\
331
 
-                      'Kitchen sink+ data'
332
 
+                      'Kitchen sink+ data' ~
333
 
 </pre>
334
 
 
335
 
 <pre>
336
 
 w.example.com. RAW 40 \x10\ # Meaning: 16
337
 
                       \x01\ # Coding: 1
338
 
                       \x02\ # Sub-coding: 2
339
 
-                      'Kitchen sink+ data' # Data: 'Kitchen sink+ data'
340
 
+                      'Kitchen sink+ data' ~ # Data: 'Kitchen sink+ data'
341
 
 </pre>
342
 
 
343
 
 <h1>LEGAL DISCLAIMER</h1>