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

« back to all changes in this revision

Viewing changes to update/1.2.12.01/maradns-1.2.11-origin_vs_zone.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
 
diff -ur maradns-orig/doc/en/source/csv2.ej maradns-1.2.12.01/doc/en/source/csv2.ej
2
 
--- maradns-orig/doc/en/source/csv2.ej  2006-07-25 07:51:32.000000000 -0500
3
 
+++ maradns-1.2.12.01/doc/en/source/csv2.ej     2006-07-25 08:30:10.000000000 -0500
4
 
@@ -499,6 +499,8 @@
5
 
 percent in a csv2 zone file.  This suffix is called, for historical and 
6
 
 compatibility reasons, "origin".  This is done as the slash command
7
 
 '/origin', taking the new origin as the one argument to this function.
8
 
+Note that changing the origin does <i>not</i> change the domain suffix
9
 
+used to determine whether a given domain name is authoritative.
10
 
 
11
 
 <p>
12
 
 
13
 
diff -ur maradns-orig/parse/Csv2_database.c maradns-1.2.12.01/parse/Csv2_database.c
14
 
--- maradns-orig/parse/Csv2_database.c  2006-07-25 07:51:32.000000000 -0500
15
 
+++ maradns-1.2.12.01/parse/Csv2_database.c     2006-07-25 08:11:46.000000000 -0500
16
 
@@ -63,7 +63,7 @@
17
 
  */
18
 
 
19
 
 csv2_add_state *csv2_init_add_state(js_string *zone) {
20
 
-       js_string *nzone;
21
 
+       js_string *nzone, *norigin;
22
 
        csv2_add_state *new;
23
 
        if(zone->unit_size != 1) {
24
 
                return 0;
25
 
@@ -75,13 +75,23 @@
26
 
                js_dealloc(new);
27
 
                return 0;
28
 
        }
29
 
+       if((norigin = js_create(zone->unit_count + 1,1)) == 0) {
30
 
+               js_dealloc(new);
31
 
+               return 0;
32
 
+       }
33
 
        if(js_copy(zone,nzone) == JS_ERROR) {
34
 
                js_destroy(nzone);
35
 
                js_dealloc(new);
36
 
                return 0;
37
 
        }
38
 
+       if(js_copy(zone,norigin) == JS_ERROR) {
39
 
+               js_destroy(nzone);
40
 
+               js_dealloc(new);
41
 
+               return 0;
42
 
+       }
43
 
        new->buffer = 0;
44
 
        new->zone = nzone; /* This is the "origin" */
45
 
+       new->origin = norigin; /* This is the "origin" */
46
 
        new->ostack = 0; /* A pointer to a "stack" or origin values we can
47
 
                           * push or pop */
48
 
        new->ostack_height = 0;
49
 
@@ -128,6 +138,11 @@
50
 
                js_destroy(x->zone);
51
 
                x->zone = 0;
52
 
        }
53
 
+       /* ...the origin string */
54
 
+       if(x->origin != 0) {
55
 
+               js_destroy(x->origin);
56
 
+               x->origin = 0;
57
 
+       }
58
 
 
59
 
        /* And now, finally, get rid of this object, I mean structure */
60
 
        js_dealloc(x);
61
 
@@ -278,6 +293,9 @@
62
 
        if(state->zone == 0) {
63
 
                return JS_ERROR;
64
 
        }
65
 
+       if(state->origin == 0) {
66
 
+               return JS_ERROR;
67
 
+       }
68
 
        if(js_has_sanity(query) == JS_ERROR) {
69
 
                return JS_ERROR;
70
 
        }
71
 
diff -ur maradns-orig/parse/Csv2_database.h maradns-1.2.12.01/parse/Csv2_database.h
72
 
--- maradns-orig/parse/Csv2_database.h  2006-07-25 07:51:32.000000000 -0500
73
 
+++ maradns-1.2.12.01/parse/Csv2_database.h     2006-07-25 07:59:13.000000000 -0500
74
 
@@ -39,8 +39,11 @@
75
 
 
76
 
 typedef struct csv2_add_state {
77
 
        csv2_rr *buffer;
78
 
-       js_string *zone; /* This is the "origin", in ASCII "name.com." 
79
 
-                          * format */
80
 
+       js_string *zone; /* This is the zone that is used for determining
81
 
+                          * whether a given name is authoritative or not,
82
 
+                          * in ASCII "name.com." format */
83
 
+       js_string *origin; /* This is what is used to substitute '%', also
84
 
+                            * in ASCII "name.com." format */
85
 
        csv2_origin *ostack;
86
 
        int ostack_height;
87
 
        int rrnum;
88
 
diff -ur maradns-orig/parse/Csv2_parse.c maradns-1.2.12.01/parse/Csv2_parse.c
89
 
--- maradns-orig/parse/Csv2_parse.c     2006-07-25 07:51:32.000000000 -0500
90
 
+++ maradns-1.2.12.01/parse/Csv2_parse.c        2006-07-25 08:07:58.000000000 -0500
91
 
@@ -1197,8 +1197,11 @@
92
 
        if(state->zone == 0) {
93
 
                return JS_ERROR;
94
 
        }
95
 
+       if(state->origin == 0) {
96
 
+               return JS_ERROR;
97
 
+       }
98
 
 
99
 
-       zone = state->zone;
100
 
+       zone = state->origin;
101
 
 
102
 
        /* We read look for the beginning of the host name; this is made
103
 
          * more complicated that the "host name" may actually be a
104
 
@@ -1295,7 +1298,8 @@
105
 
                                        return -1;
106
 
                                }
107
 
                                n = js_append_dname(n, stream, 3);
108
 
-                               if(csv2_convert_percent(n,state->zone) == 0) {
109
 
+                               if(csv2_convert_percent(n,state->origin) 
110
 
+                                   == 0) {
111
 
                                        csv2_error(stream,
112
 
                                        "Problem running convert_percent");
113
 
                                        return -1;
114
 
@@ -1305,8 +1309,8 @@
115
 
                                        "Invalid argument for /origin");
116
 
                                        return -1;
117
 
                                }
118
 
-                               js_destroy(state->zone);
119
 
-                               state->zone = n;
120
 
+                               js_destroy(state->origin);
121
 
+                               state->origin = n;
122
 
                                zone = n;
123
 
                        } else if(cmd == 3 && look == 's') {
124
 
                                js_string *n;
125
 
@@ -1336,7 +1340,8 @@
126
 
                                        return -1;
127
 
                                }
128
 
                                n = js_append_dname(n, stream, 3);
129
 
-                               if(csv2_convert_percent(n,state->zone) == 0) {
130
 
+                               if(csv2_convert_percent(n,state->origin) 
131
 
+                                   == 0) {
132
 
                                        csv2_error(stream,
133
 
                                        "Problem running convert_percent");
134
 
                                        return -1;
135
 
@@ -1364,11 +1369,11 @@
136
 
                                        "js_alloc error");
137
 
                                        return -1;
138
 
                                }
139
 
-                               c->origin = state->zone;
140
 
+                               c->origin = state->origin;
141
 
                                c->next = o;
142
 
                                state->ostack = c;
143
 
-                               state->zone = n;
144
 
-                               zone = state->zone;
145
 
+                               state->origin = n;
146
 
+                               zone = state->origin;
147
 
                        } else if(cmd == 4 && look == 'p') {
148
 
                                csv2_origin *o;
149
 
                                look = csv2_read_unicode(stream);
150
 
@@ -1391,10 +1396,10 @@
151
 
                                /* OK, pop the top value from the origin
152
 
                                 * stack and make it the origin value */
153
 
                                o = state->ostack;
154
 
-                               js_destroy(state->zone);
155
 
+                               js_destroy(state->origin);
156
 
                                state->ostack = o->next;
157
 
-                               state->zone = o->origin;
158
 
-                               zone = state->zone;
159
 
+                               state->origin = o->origin;
160
 
+                               zone = state->origin;
161
 
                                js_dealloc(o);
162
 
                        } else {
163
 
                                csv2_error(stream,"Invalid slash command");