|
|
a2a915 |
diff --git a/contrib/sdb/bdb/bdb.c b/contrib/sdb/bdb/bdb.c
|
|
|
a2a915 |
index 23594bb..b3c6619 100644
|
|
|
a2a915 |
--- a/contrib/sdb/bdb/bdb.c
|
|
|
a2a915 |
+++ b/contrib/sdb/bdb/bdb.c
|
|
|
a2a915 |
@@ -43,7 +43,7 @@
|
|
|
a2a915 |
#include <dns/lib.h>
|
|
|
a2a915 |
#include <dns/ttl.h>
|
|
|
a2a915 |
|
|
|
a2a915 |
-#include <named/bdb.h>
|
|
|
a2a915 |
+#include "bdb.h"
|
|
|
a2a915 |
#include <named/globals.h>
|
|
|
a2a915 |
#include <named/config.h>
|
|
|
a2a915 |
|
|
|
a2a915 |
diff --git a/contrib/sdb/ldap/zone2ldap.c b/contrib/sdb/ldap/zone2ldap.c
|
|
|
a2a915 |
index 07c89bc..23dd873 100644
|
|
|
a2a915 |
--- a/contrib/sdb/ldap/zone2ldap.c
|
|
|
a2a915 |
+++ b/contrib/sdb/ldap/zone2ldap.c
|
|
|
a2a915 |
@@ -63,16 +63,16 @@ typedef struct LDAP_INFO
|
|
|
a2a915 |
ldap_info;
|
|
|
a2a915 |
|
|
|
a2a915 |
/* usage Info */
|
|
|
a2a915 |
-void usage ();
|
|
|
a2a915 |
+void usage (void);
|
|
|
a2a915 |
|
|
|
a2a915 |
/* Add to the ldap dit */
|
|
|
a2a915 |
void add_ldap_values (ldap_info * ldinfo);
|
|
|
a2a915 |
|
|
|
a2a915 |
/* Init an ldap connection */
|
|
|
a2a915 |
-void init_ldap_conn ();
|
|
|
a2a915 |
+void init_ldap_conn (void);
|
|
|
a2a915 |
|
|
|
a2a915 |
/* Ldap error checking */
|
|
|
a2a915 |
-void ldap_result_check (char *msg, char *dn, int err);
|
|
|
a2a915 |
+void ldap_result_check (const char *msg, char *dn, int err);
|
|
|
a2a915 |
|
|
|
a2a915 |
/* Put a hostname into a char ** array */
|
|
|
a2a915 |
char **hostname_to_dn_list (char *hostname, char *zone, unsigned int flags);
|
|
|
a2a915 |
@@ -88,7 +88,7 @@ void add_to_rr_list (char *dn, char *name, char *type, char *data,
|
|
|
a2a915 |
unsigned int ttl, unsigned int flags);
|
|
|
a2a915 |
|
|
|
a2a915 |
/* Error checking */
|
|
|
a2a915 |
-void isc_result_check (isc_result_t res, char *errorstr);
|
|
|
a2a915 |
+void isc_result_check (isc_result_t res, const char *errorstr);
|
|
|
a2a915 |
|
|
|
a2a915 |
/* Generate LDIF Format files */
|
|
|
a2a915 |
void generate_ldap (dns_name_t * dnsname, dns_rdata_t * rdata,
|
|
|
a2a915 |
@@ -97,11 +97,17 @@ void generate_ldap (dns_name_t * dnsname, dns_rdata_t * rdata,
|
|
|
a2a915 |
/* head pointer to the list */
|
|
|
a2a915 |
ldap_info *ldap_info_base = NULL;
|
|
|
a2a915 |
|
|
|
a2a915 |
+ldap_info *
|
|
|
a2a915 |
+locate_by_dn (char *dn);
|
|
|
a2a915 |
+void
|
|
|
a2a915 |
+init_ldap_conn ();
|
|
|
a2a915 |
+void usage();
|
|
|
a2a915 |
+
|
|
|
a2a915 |
char *argzone, *ldapbase, *binddn, *bindpw = NULL;
|
|
|
a2a915 |
-char *ldapsystem = "localhost";
|
|
|
a2a915 |
-static char *objectClasses[] =
|
|
|
a2a915 |
+const char *ldapsystem = "localhost";
|
|
|
a2a915 |
+static const char *objectClasses[] =
|
|
|
a2a915 |
{ "top", "dNSZone", NULL };
|
|
|
a2a915 |
-static char *topObjectClasses[] = { "top", NULL };
|
|
|
a2a915 |
+static const char *topObjectClasses[] = { "top", NULL };
|
|
|
a2a915 |
LDAP *conn;
|
|
|
a2a915 |
unsigned int debug = 0;
|
|
|
a2a915 |
|
|
|
a2a915 |
@@ -128,7 +134,7 @@ main (int argc, char **argv)
|
|
|
a2a915 |
LDAPMod *base_attrs[2];
|
|
|
a2a915 |
LDAPMod base;
|
|
|
a2a915 |
isc_buffer_t buff;
|
|
|
a2a915 |
- char *zonefile;
|
|
|
a2a915 |
+ char *zonefile=0L;
|
|
|
a2a915 |
char fullbasedn[1024];
|
|
|
a2a915 |
char *ctmp;
|
|
|
a2a915 |
dns_fixedname_t fixedzone, fixedname;
|
|
|
a2a915 |
@@ -304,9 +310,9 @@ main (int argc, char **argv)
|
|
|
a2a915 |
if ((*ctmp == ',') || (ctmp == &basedn[0]))
|
|
|
a2a915 |
{
|
|
|
a2a915 |
base.mod_op = LDAP_MOD_ADD;
|
|
|
a2a915 |
- base.mod_type = "objectClass";
|
|
|
a2a915 |
- base.mod_values = topObjectClasses;
|
|
|
a2a915 |
- base_attrs[0] = &bas;;
|
|
|
a2a915 |
+ base.mod_type = (char*)"objectClass";
|
|
|
a2a915 |
+ base.mod_values = (char**)topObjectClasses;
|
|
|
a2a915 |
+ base_attrs[0] = (void*)&bas;;
|
|
|
a2a915 |
base_attrs[1] = NULL;
|
|
|
a2a915 |
|
|
|
a2a915 |
if (ldapbase)
|
|
|
a2a915 |
@@ -363,7 +369,7 @@ main (int argc, char **argv)
|
|
|
a2a915 |
* I should probably rename this function, as not to cause any
|
|
|
a2a915 |
* confusion with the isc* routines. Will exit on error. */
|
|
|
a2a915 |
void
|
|
|
a2a915 |
-isc_result_check (isc_result_t res, char *errorstr)
|
|
|
a2a915 |
+isc_result_check (isc_result_t res, const char *errorstr)
|
|
|
a2a915 |
{
|
|
|
a2a915 |
if (res != ISC_R_SUCCESS)
|
|
|
a2a915 |
{
|
|
|
a2a915 |
@@ -470,20 +476,20 @@ add_to_rr_list (char *dn, char *name, char *type,
|
|
|
a2a915 |
if (tmp->attrs == (LDAPMod **) NULL)
|
|
|
a2a915 |
fatal("calloc");
|
|
|
a2a915 |
|
|
|
a2a915 |
- for (i = 0; i < flags; i++)
|
|
|
a2a915 |
+ for (i = 0; i < (int)flags; i++)
|
|
|
a2a915 |
{
|
|
|
a2a915 |
tmp->attrs[i] = (LDAPMod *) malloc (sizeof (LDAPMod));
|
|
|
a2a915 |
if (tmp->attrs[i] == (LDAPMod *) NULL)
|
|
|
a2a915 |
fatal("malloc");
|
|
|
a2a915 |
}
|
|
|
a2a915 |
tmp->attrs[0]->mod_op = LDAP_MOD_ADD;
|
|
|
a2a915 |
- tmp->attrs[0]->mod_type = "objectClass";
|
|
|
a2a915 |
+ tmp->attrs[0]->mod_type = (char*)"objectClass";
|
|
|
a2a915 |
|
|
|
a2a915 |
if (flags == DNS_OBJECT)
|
|
|
a2a915 |
- tmp->attrs[0]->mod_values = objectClasses;
|
|
|
a2a915 |
+ tmp->attrs[0]->mod_values = (char**)objectClasses;
|
|
|
a2a915 |
else
|
|
|
a2a915 |
{
|
|
|
a2a915 |
- tmp->attrs[0]->mod_values = topObjectClasses;
|
|
|
a2a915 |
+ tmp->attrs[0]->mod_values = (char**)topObjectClasses;
|
|
|
a2a915 |
tmp->attrs[1] = NULL;
|
|
|
a2a915 |
tmp->attrcnt = 2;
|
|
|
a2a915 |
tmp->next = ldap_info_base;
|
|
|
a2a915 |
@@ -492,7 +498,7 @@ add_to_rr_list (char *dn, char *name, char *type,
|
|
|
a2a915 |
}
|
|
|
a2a915 |
|
|
|
a2a915 |
tmp->attrs[1]->mod_op = LDAP_MOD_ADD;
|
|
|
a2a915 |
- tmp->attrs[1]->mod_type = "relativeDomainName";
|
|
|
a2a915 |
+ tmp->attrs[1]->mod_type = (char*)"relativeDomainName";
|
|
|
a2a915 |
tmp->attrs[1]->mod_values = (char **) calloc (sizeof (char *), 2);
|
|
|
a2a915 |
|
|
|
a2a915 |
if (tmp->attrs[1]->mod_values == (char **)NULL)
|
|
|
a2a915 |
@@ -521,7 +527,7 @@ add_to_rr_list (char *dn, char *name, char *type,
|
|
|
a2a915 |
fatal("strdup");
|
|
|
a2a915 |
|
|
|
a2a915 |
tmp->attrs[3]->mod_op = LDAP_MOD_ADD;
|
|
|
a2a915 |
- tmp->attrs[3]->mod_type = "dNSTTL";
|
|
|
a2a915 |
+ tmp->attrs[3]->mod_type = (char*)"dNSTTL";
|
|
|
a2a915 |
tmp->attrs[3]->mod_values = (char **) calloc (sizeof (char *), 2);
|
|
|
a2a915 |
|
|
|
a2a915 |
if (tmp->attrs[3]->mod_values == (char **)NULL)
|
|
|
a2a915 |
@@ -535,7 +541,7 @@ add_to_rr_list (char *dn, char *name, char *type,
|
|
|
a2a915 |
fatal("strdup");
|
|
|
a2a915 |
|
|
|
a2a915 |
tmp->attrs[4]->mod_op = LDAP_MOD_ADD;
|
|
|
a2a915 |
- tmp->attrs[4]->mod_type = "zoneName";
|
|
|
a2a915 |
+ tmp->attrs[4]->mod_type = (char*)"zoneName";
|
|
|
a2a915 |
tmp->attrs[4]->mod_values = (char **)calloc(sizeof(char *), 2);
|
|
|
a2a915 |
|
|
|
a2a915 |
if (tmp->attrs[4]->mod_values == (char **)NULL)
|
|
|
a2a915 |
@@ -648,7 +654,7 @@ hostname_to_dn_list (char *hostname, char *zone, unsigned int flags)
|
|
|
a2a915 |
zname = ++tmp;
|
|
|
a2a915 |
}
|
|
|
a2a915 |
else
|
|
|
a2a915 |
- hnamebuff = "@";
|
|
|
a2a915 |
+ hnamebuff = (char*)"@";
|
|
|
a2a915 |
}
|
|
|
a2a915 |
else
|
|
|
a2a915 |
{
|
|
|
a2a915 |
@@ -727,12 +733,12 @@ init_ldap_conn ()
|
|
|
a2a915 |
}
|
|
|
a2a915 |
|
|
|
a2a915 |
result = ldap_simple_bind_s (conn, binddn, bindpw);
|
|
|
a2a915 |
- ldap_result_check ("ldap_simple_bind_s", "LDAP Bind", result);
|
|
|
a2a915 |
+ ldap_result_check ("ldap_simple_bind_s", (char*)"LDAP Bind", result);
|
|
|
a2a915 |
}
|
|
|
a2a915 |
|
|
|
a2a915 |
/* Like isc_result_check, only for LDAP */
|
|
|
a2a915 |
void
|
|
|
a2a915 |
-ldap_result_check (char *msg, char *dn, int err)
|
|
|
a2a915 |
+ldap_result_check (const char *msg, char *dn, int err)
|
|
|
a2a915 |
{
|
|
|
a2a915 |
if ((err != LDAP_SUCCESS) && (err != LDAP_ALREADY_EXISTS))
|
|
|
a2a915 |
{
|
|
|
a2a915 |
diff --git a/contrib/sdb/pgsql/pgsqldb.c b/contrib/sdb/pgsql/pgsqldb.c
|
|
|
a2a915 |
index 50d3cba..516eb9f 100644
|
|
|
a2a915 |
--- a/contrib/sdb/pgsql/pgsqldb.c
|
|
|
a2a915 |
+++ b/contrib/sdb/pgsql/pgsqldb.c
|
|
|
a2a915 |
@@ -23,7 +23,7 @@
|
|
|
a2a915 |
#include <string.h>
|
|
|
a2a915 |
#include <stdlib.h>
|
|
|
a2a915 |
|
|
|
a2a915 |
-#include <pgsql/libpq-fe.h>
|
|
|
a2a915 |
+#include <libpq-fe.h>
|
|
|
a2a915 |
|
|
|
a2a915 |
#include <isc/mem.h>
|
|
|
a2a915 |
#include <isc/print.h>
|
|
|
a2a915 |
diff --git a/contrib/sdb/pgsql/zonetodb.c b/contrib/sdb/pgsql/zonetodb.c
|
|
|
a2a915 |
index b8f5912..ff2d135 100644
|
|
|
a2a915 |
--- a/contrib/sdb/pgsql/zonetodb.c
|
|
|
a2a915 |
+++ b/contrib/sdb/pgsql/zonetodb.c
|
|
|
a2a915 |
@@ -37,7 +37,7 @@
|
|
|
a2a915 |
#include <dns/rdatatype.h>
|
|
|
a2a915 |
#include <dns/result.h>
|
|
|
a2a915 |
|
|
|
a2a915 |
-#include <pgsql/libpq-fe.h>
|
|
|
a2a915 |
+#include <libpq-fe.h>
|
|
|
a2a915 |
|
|
|
a2a915 |
/*
|
|
|
a2a915 |
* Generate a PostgreSQL table from a zone.
|
|
|
a2a915 |
@@ -54,6 +54,9 @@ char *dbname, *dbtable;
|
|
|
a2a915 |
char str[10240];
|
|
|
a2a915 |
|
|
|
a2a915 |
void
|
|
|
a2a915 |
+closeandexit(int status);
|
|
|
a2a915 |
+
|
|
|
a2a915 |
+void
|
|
|
a2a915 |
closeandexit(int status) {
|
|
|
a2a915 |
if (conn != NULL)
|
|
|
a2a915 |
PQfinish(conn);
|
|
|
a2a915 |
@@ -61,6 +64,9 @@ closeandexit(int status) {
|
|
|
a2a915 |
}
|
|
|
a2a915 |
|
|
|
a2a915 |
void
|
|
|
a2a915 |
+check_result(isc_result_t result, const char *message);
|
|
|
a2a915 |
+
|
|
|
a2a915 |
+void
|
|
|
a2a915 |
check_result(isc_result_t result, const char *message) {
|
|
|
a2a915 |
if (result != ISC_R_SUCCESS) {
|
|
|
a2a915 |
fprintf(stderr, "%s: %s\n", message,
|
|
|
a2a915 |
@@ -84,7 +90,8 @@ quotestring(const unsigned char *source, unsigned char *dest) {
|
|
|
a2a915 |
}
|
|
|
a2a915 |
*dest++ = 0;
|
|
|
a2a915 |
}
|
|
|
a2a915 |
-
|
|
|
a2a915 |
+void
|
|
|
a2a915 |
+addrdata(dns_name_t *name, dns_ttl_t ttl, dns_rdata_t *rdata);
|
|
|
a2a915 |
void
|
|
|
a2a915 |
addrdata(dns_name_t *name, dns_ttl_t ttl, dns_rdata_t *rdata) {
|
|
|
a2a915 |
unsigned char namearray[DNS_NAME_MAXTEXT + 1];
|