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