jvdias 207484
--- bind-9.3.2b2/contrib/sdb/ldap/zone2ldap.c.sdbsrc	2005-08-16 00:43:03.000000000 -0400
jvdias 207484
+++ bind-9.3.2b2/contrib/sdb/ldap/zone2ldap.c	2005-11-15 12:57:44.000000000 -0500
jvdias 207484
@@ -59,16 +59,16 @@
jvdias 207484
 ldap_info;
jvdias 207484
 
jvdias 207484
 /* usage Info */
jvdias 207484
-void usage ();
jvdias 207484
+void usage (void);
jvdias 207484
 
jvdias 207484
 /* Add to the ldap dit */
jvdias 207484
 void add_ldap_values (ldap_info * ldinfo);
jvdias 207484
 
jvdias 207484
 /* Init an ldap connection */
jvdias 207484
-void init_ldap_conn ();
jvdias 207484
+void init_ldap_conn (void);
jvdias 207484
 
jvdias 207484
 /* Ldap error checking */
jvdias 207484
-void ldap_result_check (char *msg, char *dn, int err);
jvdias 207484
+void ldap_result_check (const char *msg, char *dn, int err);
jvdias 207484
 
jvdias 207484
 /* Put a hostname into a char ** array */
jvdias 207484
 char **hostname_to_dn_list (char *hostname, char *zone, unsigned int flags);
jvdias 207484
@@ -84,7 +84,7 @@
jvdias 207484
 		     unsigned int ttl, unsigned int flags);
jvdias 207484
 
jvdias 207484
 /* Error checking */
jvdias 207484
-void isc_result_check (isc_result_t res, char *errorstr);
jvdias 207484
+void isc_result_check (isc_result_t res, const char *errorstr);
jvdias 207484
 
jvdias 207484
 /* Generate LDIF Format files */
jvdias 207484
 void generate_ldap (dns_name_t * dnsname, dns_rdata_t * rdata,
jvdias 207484
@@ -93,11 +93,17 @@
jvdias 207484
 /* head pointer to the list */
jvdias 207484
 ldap_info *ldap_info_base = NULL;
jvdias 207484
 
jvdias 207484
+ldap_info *
jvdias 207484
+locate_by_dn (char *dn);
jvdias 207484
+void
jvdias 207484
+init_ldap_conn ();
jvdias 207484
+void usage();
jvdias 207484
+
jvdias 207484
 char *argzone, *ldapbase, *binddn, *bindpw = NULL;
jvdias 207484
-char *ldapsystem = "localhost";
jvdias 207484
-static char *objectClasses[] =
jvdias 207484
+const char *ldapsystem = "localhost";
jvdias 207484
+static const char *objectClasses[] =
jvdias 207484
   { "top", "dNSZone", NULL };
jvdias 207484
-static char *topObjectClasses[] = { "top", NULL };
jvdias 207484
+static const char *topObjectClasses[] = { "top", NULL };
jvdias 207484
 LDAP *conn;
jvdias 207484
 unsigned int debug = 0;
jvdias 207484
 
jvdias 207484
@@ -106,7 +112,7 @@
jvdias 207484
 #endif
jvdias 207484
 
jvdias 207484
 int
jvdias 207484
-main (int *argc, char **argv)
jvdias 207484
+main (int argc, char **argv)
jvdias 207484
 {
jvdias 207484
   isc_mem_t *mctx = NULL;
jvdias 207484
   isc_entropy_t *ectx = NULL;
jvdias 207484
@@ -116,7 +122,7 @@
jvdias 207484
   LDAPMod *base_attrs[2];
jvdias 207484
   LDAPMod base;
jvdias 207484
   isc_buffer_t buff;
jvdias 207484
-  char *zonefile;
jvdias 207484
+  char *zonefile=0L;
jvdias 207484
   char fullbasedn[1024];
jvdias 207484
   char *ctmp;
jvdias 207484
   dns_fixedname_t fixedzone, fixedname;
jvdias 207484
@@ -280,9 +286,9 @@
jvdias 207484
 	  if ((*ctmp == ',') || (ctmp == &basedn[0]))
jvdias 207484
 	    {
jvdias 207484
 	      base.mod_op = LDAP_MOD_ADD;
jvdias 207484
-	      base.mod_type = "objectClass";
jvdias 207484
-	      base.mod_values = topObjectClasses;
jvdias 207484
-	      base_attrs[0] = &bas;;
jvdias 207484
+	      base.mod_type = (char*)"objectClass";
jvdias 207484
+	      base.mod_values = (char**)topObjectClasses;
jvdias 207484
+	      base_attrs[0] = (void*)&bas;;
jvdias 207484
 	      base_attrs[1] = NULL;
jvdias 207484
 
jvdias 207484
 	      if (ldapbase)
jvdias 207484
@@ -337,7 +343,7 @@
jvdias 207484
  * I should probably rename this function, as not to cause any
jvdias 207484
  * confusion with the isc* routines. Will exit on error. */
jvdias 207484
 void
jvdias 207484
-isc_result_check (isc_result_t res, char *errorstr)
jvdias 207484
+isc_result_check (isc_result_t res, const char *errorstr)
jvdias 207484
 {
jvdias 207484
   if (res != ISC_R_SUCCESS)
jvdias 207484
     {
jvdias 207484
@@ -449,7 +455,7 @@
jvdias 207484
 	  exit (-1);
jvdias 207484
 	}
jvdias 207484
 
jvdias 207484
-      for (i = 0; i < flags; i++)
jvdias 207484
+      for (i = 0; i < (int)flags; i++)
jvdias 207484
 	{
jvdias 207484
 	  tmp->attrs[i] = (LDAPMod *) malloc (sizeof (LDAPMod));
jvdias 207484
 	  if (tmp->attrs[i] == (LDAPMod *) NULL)
jvdias 207484
@@ -459,13 +465,13 @@
jvdias 207484
 	    }
jvdias 207484
 	}
jvdias 207484
       tmp->attrs[0]->mod_op = LDAP_MOD_ADD;
jvdias 207484
-      tmp->attrs[0]->mod_type = "objectClass";
jvdias 207484
+      tmp->attrs[0]->mod_type = (char*)"objectClass";
jvdias 207484
 
jvdias 207484
       if (flags == DNS_OBJECT)
jvdias 207484
-	tmp->attrs[0]->mod_values = objectClasses;
jvdias 207484
+	tmp->attrs[0]->mod_values = (char**)objectClasses;
jvdias 207484
       else
jvdias 207484
 	{
jvdias 207484
-	  tmp->attrs[0]->mod_values = topObjectClasses;
jvdias 207484
+	  tmp->attrs[0]->mod_values = (char**)topObjectClasses;
jvdias 207484
 	  tmp->attrs[1] = NULL;
jvdias 207484
 	  tmp->attrcnt = 2;
jvdias 207484
 	  tmp->next = ldap_info_base;
jvdias 207484
@@ -474,7 +480,7 @@
jvdias 207484
 	}
jvdias 207484
 
jvdias 207484
       tmp->attrs[1]->mod_op = LDAP_MOD_ADD;
jvdias 207484
-      tmp->attrs[1]->mod_type = "relativeDomainName";
jvdias 207484
+      tmp->attrs[1]->mod_type = (char*)"relativeDomainName";
jvdias 207484
       tmp->attrs[1]->mod_values = (char **) calloc (sizeof (char *), 2);
jvdias 207484
 
jvdias 207484
       if (tmp->attrs[1]->mod_values == (char **)NULL)
jvdias 207484
@@ -496,7 +502,7 @@
jvdias 207484
       tmp->attrs[2]->mod_values[1] = NULL;
jvdias 207484
 
jvdias 207484
       tmp->attrs[3]->mod_op = LDAP_MOD_ADD;
jvdias 207484
-      tmp->attrs[3]->mod_type = "dNSTTL";
jvdias 207484
+      tmp->attrs[3]->mod_type = (char*)"dNSTTL";
jvdias 207484
       tmp->attrs[3]->mod_values = (char **) calloc (sizeof (char *), 2);
jvdias 207484
 
jvdias 207484
       if (tmp->attrs[3]->mod_values == (char **)NULL)
jvdias 207484
@@ -507,7 +513,7 @@
jvdias 207484
       tmp->attrs[3]->mod_values[1] = NULL;
jvdias 207484
 
jvdias 207484
       tmp->attrs[4]->mod_op = LDAP_MOD_ADD;
jvdias 207484
-      tmp->attrs[4]->mod_type = "zoneName";
jvdias 207484
+      tmp->attrs[4]->mod_type = (char*)"zoneName";
jvdias 207484
       tmp->attrs[4]->mod_values = (char **)calloc(sizeof(char *), 2);
jvdias 207484
       tmp->attrs[4]->mod_values[0] = gbl_zone;
jvdias 207484
       tmp->attrs[4]->mod_values[1] = NULL;
jvdias 207484
@@ -607,7 +613,7 @@
jvdias 207484
 	  zname = ++tmp;
jvdias 207484
 	}
jvdias 207484
       else
jvdias 207484
-	hnamebuff = "@";
jvdias 207484
+	hnamebuff = (char*)"@";
jvdias 207484
     }
jvdias 207484
   else
jvdias 207484
     {
jvdias 207484
@@ -686,12 +692,12 @@
jvdias 207484
     }
jvdias 207484
 
jvdias 207484
   result = ldap_simple_bind_s (conn, binddn, bindpw);
jvdias 207484
-  ldap_result_check ("ldap_simple_bind_s", "LDAP Bind", result);
jvdias 207484
+  ldap_result_check ("ldap_simple_bind_s", (char*)"LDAP Bind", result);
jvdias 207484
 }
jvdias 207484
 
jvdias 207484
 /* Like isc_result_check, only for LDAP */
jvdias 207484
 void
jvdias 207484
-ldap_result_check (char *msg, char *dn, int err)
jvdias 207484
+ldap_result_check (const char *msg, char *dn, int err)
jvdias 207484
 {
jvdias 207484
   if ((err != LDAP_SUCCESS) && (err != LDAP_ALREADY_EXISTS))
jvdias 207484
     {
jvdias 207484
@@ -730,5 +736,8 @@
jvdias 207484
 usage ()
jvdias 207484
 {
jvdias 207484
   fprintf (stderr,
jvdias 207484
-	   "zone2ldap -D [BIND DN] -w [BIND PASSWORD] -b [BASE DN] -z [ZONE] -f [ZONE FILE] -h [LDAP HOST]
jvdias 207484
-	   [-c Create LDAP Base structure][-d Debug Output (lots !)] \n ");}
jvdias 207484
+	   "zone2ldap -D [BIND DN] -w [BIND PASSWORD] -b [BASE DN] -z [ZONE] -f [ZONE FILE] -h [LDAP HOST]\n"
jvdias 207484
+	   "\t[-c Create LDAP Base structure][-d Debug Output (lots !)]\n "
jvdias 207484
+          );
jvdias 207484
+}
jvdias 207484
+
jvdias 207484
--- bind-9.3.2b2/contrib/sdb/bdb/bdb.c.sdbsrc	2002-07-02 00:45:34.000000000 -0400
jvdias 207484
+++ bind-9.3.2b2/contrib/sdb/bdb/bdb.c	2005-11-15 12:57:44.000000000 -0500
jvdias 207484
@@ -43,7 +43,7 @@
jvdias 207484
 #include <dns/lib.h>
jvdias 207484
 #include <dns/ttl.h>
jvdias 207484
 
jvdias 207484
-#include <named/bdb.h>
jvdias 207484
+#include "bdb.h"
jvdias 207484
 #include <named/globals.h>
jvdias 207484
 #include <named/config.h>
jvdias 207484
 
jvdias 207484
--- bind-9.3.2b2/contrib/sdb/pgsql/pgsqldb.c.sdbsrc	2004-03-08 04:04:22.000000000 -0500
jvdias 207484
+++ bind-9.3.2b2/contrib/sdb/pgsql/pgsqldb.c	2005-11-15 12:57:44.000000000 -0500
jvdias 207484
@@ -23,7 +23,7 @@
jvdias 207484
 #include <string.h>
jvdias 207484
 #include <stdlib.h>
jvdias 207484
 
jvdias 207484
-#include <pgsql/libpq-fe.h>
jvdias 207484
+#include <libpq-fe.h>
jvdias 207484
 
jvdias 207484
 #include <isc/mem.h>
jvdias 207484
 #include <isc/print.h>
jvdias 207484
--- bind-9.3.2b2/contrib/sdb/pgsql/zonetodb.c.sdbsrc	2005-09-05 22:12:40.000000000 -0400
jvdias 207484
+++ bind-9.3.2b2/contrib/sdb/pgsql/zonetodb.c	2005-11-15 12:58:12.000000000 -0500
jvdias 207484
@@ -37,7 +37,7 @@
jvdias 207484
 #include <dns/rdatatype.h>
jvdias 207484
 #include <dns/result.h>
jvdias 207484
 
jvdias 207484
-#include <pgsql/libpq-fe.h>
jvdias 207484
+#include <libpq-fe.h>
jvdias 207484
 
jvdias 207484
 /*
jvdias 207484
  * Generate a PostgreSQL table from a zone.
jvdias 207484
@@ -54,6 +54,9 @@
jvdias 207484
 char str[10240];
jvdias 207484
 
jvdias 207484
 void
jvdias 207484
+closeandexit(int status);
jvdias 207484
+
jvdias 207484
+void
jvdias 207484
 closeandexit(int status) {
jvdias 207484
 	if (conn != NULL)
jvdias 207484
 		PQfinish(conn);
jvdias 207484
@@ -61,6 +64,9 @@
jvdias 207484
 }
jvdias 207484
 
jvdias 207484
 void
jvdias 207484
+check_result(isc_result_t result, const char *message);
jvdias 207484
+
jvdias 207484
+void
jvdias 207484
 check_result(isc_result_t result, const char *message) {
jvdias 207484
 	if (result != ISC_R_SUCCESS) {
jvdias 207484
 		fprintf(stderr, "%s: %s\n", message,
jvdias 207484
@@ -84,7 +90,8 @@
jvdias 207484
 	}
jvdias 207484
 	*dest++ = 0;
jvdias 207484
 }
jvdias 207484
-
jvdias 207484
+void
jvdias 207484
+addrdata(dns_name_t *name, dns_ttl_t ttl, dns_rdata_t *rdata);
jvdias 207484
 void
jvdias 207484
 addrdata(dns_name_t *name, dns_ttl_t ttl, dns_rdata_t *rdata) {
jvdias 207484
 	unsigned char namearray[DNS_NAME_MAXTEXT + 1];