summaryrefslogtreecommitdiffstats
path: root/bind-9.3.2b2-sdbsrc.patch
blob: bd0ed32837e5e84170b46938092f05455b54f60a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
--- bind-9.3.2b2/contrib/sdb/ldap/zone2ldap.c.sdbsrc	2005-08-16 00:43:03.000000000 -0400
+++ bind-9.3.2b2/contrib/sdb/ldap/zone2ldap.c	2005-11-15 12:57:44.000000000 -0500
@@ -59,16 +59,16 @@
 ldap_info;
 
 /* usage Info */
-void usage ();
+void usage (void);
 
 /* Add to the ldap dit */
 void add_ldap_values (ldap_info * ldinfo);
 
 /* Init an ldap connection */
-void init_ldap_conn ();
+void init_ldap_conn (void);
 
 /* Ldap error checking */
-void ldap_result_check (char *msg, char *dn, int err);
+void ldap_result_check (const char *msg, char *dn, int err);
 
 /* Put a hostname into a char ** array */
 char **hostname_to_dn_list (char *hostname, char *zone, unsigned int flags);
@@ -84,7 +84,7 @@
 		     unsigned int ttl, unsigned int flags);
 
 /* Error checking */
-void isc_result_check (isc_result_t res, char *errorstr);
+void isc_result_check (isc_result_t res, const char *errorstr);
 
 /* Generate LDIF Format files */
 void generate_ldap (dns_name_t * dnsname, dns_rdata_t * rdata,
@@ -93,11 +93,17 @@
 /* head pointer to the list */
 ldap_info *ldap_info_base = NULL;
 
+ldap_info *
+locate_by_dn (char *dn);
+void
+init_ldap_conn ();
+void usage();
+
 char *argzone, *ldapbase, *binddn, *bindpw = NULL;
-char *ldapsystem = "localhost";
-static char *objectClasses[] =
+const char *ldapsystem = "localhost";
+static const char *objectClasses[] =
   { "top", "dNSZone", NULL };
-static char *topObjectClasses[] = { "top", NULL };
+static const char *topObjectClasses[] = { "top", NULL };
 LDAP *conn;
 unsigned int debug = 0;
 
@@ -106,7 +112,7 @@
 #endif
 
 int
-main (int *argc, char **argv)
+main (int argc, char **argv)
 {
   isc_mem_t *mctx = NULL;
   isc_entropy_t *ectx = NULL;
@@ -116,7 +122,7 @@
   LDAPMod *base_attrs[2];
   LDAPMod base;
   isc_buffer_t buff;
-  char *zonefile;
+  char *zonefile=0L;
   char fullbasedn[1024];
   char *ctmp;
   dns_fixedname_t fixedzone, fixedname;
@@ -280,9 +286,9 @@
 	  if ((*ctmp == ',') || (ctmp == &basedn[0]))
 	    {
 	      base.mod_op = LDAP_MOD_ADD;
-	      base.mod_type = "objectClass";
-	      base.mod_values = topObjectClasses;
-	      base_attrs[0] = &base;
+	      base.mod_type = (char*)"objectClass";
+	      base.mod_values = (char**)topObjectClasses;
+	      base_attrs[0] = (void*)&base;
 	      base_attrs[1] = NULL;
 
 	      if (ldapbase)
@@ -337,7 +343,7 @@
  * I should probably rename this function, as not to cause any
  * confusion with the isc* routines. Will exit on error. */
 void
-isc_result_check (isc_result_t res, char *errorstr)
+isc_result_check (isc_result_t res, const char *errorstr)
 {
   if (res != ISC_R_SUCCESS)
     {
@@ -449,7 +455,7 @@
 	  exit (-1);
 	}
 
-      for (i = 0; i < flags; i++)
+      for (i = 0; i < (int)flags; i++)
 	{
 	  tmp->attrs[i] = (LDAPMod *) malloc (sizeof (LDAPMod));
 	  if (tmp->attrs[i] == (LDAPMod *) NULL)
@@ -459,13 +465,13 @@
 	    }
 	}
       tmp->attrs[0]->mod_op = LDAP_MOD_ADD;
-      tmp->attrs[0]->mod_type = "objectClass";
+      tmp->attrs[0]->mod_type = (char*)"objectClass";
 
       if (flags == DNS_OBJECT)
-	tmp->attrs[0]->mod_values = objectClasses;
+	tmp->attrs[0]->mod_values = (char**)objectClasses;
       else
 	{
-	  tmp->attrs[0]->mod_values = topObjectClasses;
+	  tmp->attrs[0]->mod_values = (char**)topObjectClasses;
 	  tmp->attrs[1] = NULL;
 	  tmp->attrcnt = 2;
 	  tmp->next = ldap_info_base;
@@ -474,7 +480,7 @@
 	}
 
       tmp->attrs[1]->mod_op = LDAP_MOD_ADD;
-      tmp->attrs[1]->mod_type = "relativeDomainName";
+      tmp->attrs[1]->mod_type = (char*)"relativeDomainName";
       tmp->attrs[1]->mod_values = (char **) calloc (sizeof (char *), 2);
 
       if (tmp->attrs[1]->mod_values == (char **)NULL)
@@ -496,7 +502,7 @@
       tmp->attrs[2]->mod_values[1] = NULL;
 
       tmp->attrs[3]->mod_op = LDAP_MOD_ADD;
-      tmp->attrs[3]->mod_type = "dNSTTL";
+      tmp->attrs[3]->mod_type = (char*)"dNSTTL";
       tmp->attrs[3]->mod_values = (char **) calloc (sizeof (char *), 2);
 
       if (tmp->attrs[3]->mod_values == (char **)NULL)
@@ -507,7 +513,7 @@
       tmp->attrs[3]->mod_values[1] = NULL;
 
       tmp->attrs[4]->mod_op = LDAP_MOD_ADD;
-      tmp->attrs[4]->mod_type = "zoneName";
+      tmp->attrs[4]->mod_type = (char*)"zoneName";
       tmp->attrs[4]->mod_values = (char **)calloc(sizeof(char *), 2);
       tmp->attrs[4]->mod_values[0] = gbl_zone;
       tmp->attrs[4]->mod_values[1] = NULL;
@@ -607,7 +613,7 @@
 	  zname = ++tmp;
 	}
       else
-	hnamebuff = "@";
+	hnamebuff = (char*)"@";
     }
   else
     {
@@ -686,12 +692,12 @@
     }
 
   result = ldap_simple_bind_s (conn, binddn, bindpw);
-  ldap_result_check ("ldap_simple_bind_s", "LDAP Bind", result);
+  ldap_result_check ("ldap_simple_bind_s", (char*)"LDAP Bind", result);
 }
 
 /* Like isc_result_check, only for LDAP */
 void
-ldap_result_check (char *msg, char *dn, int err)
+ldap_result_check (const char *msg, char *dn, int err)
 {
   if ((err != LDAP_SUCCESS) && (err != LDAP_ALREADY_EXISTS))
     {
@@ -730,5 +736,8 @@
 usage ()
 {
   fprintf (stderr,
-	   "zone2ldap -D [BIND DN] -w [BIND PASSWORD] -b [BASE DN] -z [ZONE] -f [ZONE FILE] -h [LDAP HOST]
-	   [-c Create LDAP Base structure][-d Debug Output (lots !)] \n ");}
+	   "zone2ldap -D [BIND DN] -w [BIND PASSWORD] -b [BASE DN] -z [ZONE] -f [ZONE FILE] -h [LDAP HOST]\n"
+	   "\t[-c Create LDAP Base structure][-d Debug Output (lots !)]\n "
+          );
+}
+
--- bind-9.3.2b2/contrib/sdb/bdb/bdb.c.sdbsrc	2002-07-02 00:45:34.000000000 -0400
+++ bind-9.3.2b2/contrib/sdb/bdb/bdb.c	2005-11-15 12:57:44.000000000 -0500
@@ -43,7 +43,7 @@
 #include <dns/lib.h>
 #include <dns/ttl.h>
 
-#include <named/bdb.h>
+#include "bdb.h"
 #include <named/globals.h>
 #include <named/config.h>
 
--- bind-9.3.2b2/contrib/sdb/pgsql/pgsqldb.c.sdbsrc	2004-03-08 04:04:22.000000000 -0500
+++ bind-9.3.2b2/contrib/sdb/pgsql/pgsqldb.c	2005-11-15 12:57:44.000000000 -0500
@@ -23,7 +23,7 @@
 #include <string.h>
 #include <stdlib.h>
 
-#include <pgsql/libpq-fe.h>
+#include <libpq-fe.h>
 
 #include <isc/mem.h>
 #include <isc/print.h>
--- bind-9.3.2b2/contrib/sdb/pgsql/zonetodb.c.sdbsrc	2005-09-05 22:12:40.000000000 -0400
+++ bind-9.3.2b2/contrib/sdb/pgsql/zonetodb.c	2005-11-15 12:58:12.000000000 -0500
@@ -37,7 +37,7 @@
 #include <dns/rdatatype.h>
 #include <dns/result.h>
 
-#include <pgsql/libpq-fe.h>
+#include <libpq-fe.h>
 
 /*
  * Generate a PostgreSQL table from a zone.
@@ -54,6 +54,9 @@
 char str[10240];
 
 void
+closeandexit(int status);
+
+void
 closeandexit(int status) {
 	if (conn != NULL)
 		PQfinish(conn);
@@ -61,6 +64,9 @@
 }
 
 void
+check_result(isc_result_t result, const char *message);
+
+void
 check_result(isc_result_t result, const char *message) {
 	if (result != ISC_R_SUCCESS) {
 		fprintf(stderr, "%s: %s\n", message,
@@ -84,7 +90,8 @@
 	}
 	*dest++ = 0;
 }
-
+void
+addrdata(dns_name_t *name, dns_ttl_t ttl, dns_rdata_t *rdata);
 void
 addrdata(dns_name_t *name, dns_ttl_t ttl, dns_rdata_t *rdata) {
 	unsigned char namearray[DNS_NAME_MAXTEXT + 1];