[master] revert dlzexternal changes for portability

This commit is contained in:
Evan Hunt
2017-09-14 11:33:24 -07:00
parent c59bf663e8
commit 364cabf431
2 changed files with 10 additions and 18 deletions

View File

@@ -33,13 +33,8 @@ OBJS =
CFLAGS = @CFLAGS@ @SO_CFLAGS@ CFLAGS = @CFLAGS@ @SO_CFLAGS@
SO_LDFLAGS = @LDFLAGS@ @SO_LDFLAGS@ SO_LDFLAGS = @LDFLAGS@ @SO_LDFLAGS@
ISCLIBS = ../../../../lib/isc/libisc.@A@ driver.@SO@: ${SO_OBJS}
SO_STRIP = @SO_STRIP@ ${LIBTOOL_MODE_LINK} @SO_LD@ ${SO_LDFLAGS} -o $@ driver.@O@
driver.@SO@: ${SO_OBJS} ${ISCLIBS}
CLEANED=`echo "${ISCLIBS} ${LIBS}" | ${SO_STRIP}`; \
${LIBTOOL_MODE_LINK} @SO_LD@ ${SO_LDFLAGS} -o $@ ${SO_OBJS} \
$${CLEANED}
clean distclean:: clean distclean::
rm -f ${TARGETS} rm -f ${TARGETS}

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2011-2017 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2011-2016 Internet Systems Consortium, Inc. ("ISC")
* *
* This Source Code Form is subject to the terms of the Mozilla Public * This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -231,7 +231,6 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[],
char soa_data[1024]; char soa_data[1024];
const char *extra; const char *extra;
isc_result_t result; isc_result_t result;
size_t znsize;
int n; int n;
UNUSED(dlzname); UNUSED(dlzname);
@@ -256,17 +255,15 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[],
} }
/* Ensure zone name is absolute */ /* Ensure zone name is absolute */
znsize = strlen(argv[1]) + 2; state->zone_name = malloc(strlen(argv[1]) + 2);
state->zone_name = malloc(znsize);
if (state->zone_name == NULL) { if (state->zone_name == NULL) {
free(state); free(state);
return (ISC_R_NOMEMORY); return (ISC_R_NOMEMORY);
} }
if (argv[1][strlen(argv[1]) - 1] == '.') { if (argv[1][strlen(argv[1]) - 1] == '.')
strlcpy(state->zone_name, argv[1], znsize); strcpy(state->zone_name, argv[1]);
} else { else
snprintf(state->zone_name, znsize, "%s.", argv[1]); sprintf(state->zone_name, "%s.", argv[1]);
}
if (strcmp(state->zone_name, ".") == 0) if (strcmp(state->zone_name, ".") == 0)
extra = ".root"; extra = ".root";
@@ -329,7 +326,7 @@ dlz_findzonedb(void *dbdata, const char *name,
char addrbuf[100]; char addrbuf[100];
char absolute[1024]; char absolute[1024];
strlcpy(addrbuf, "unknown", sizeof(addrbuf)); strcpy(addrbuf, "unknown");
if (methods != NULL && if (methods != NULL &&
methods->sourceip != NULL && methods->sourceip != NULL &&
methods->version - methods->age <= DNS_CLIENTINFOMETHODS_VERSION && methods->version - methods->age <= DNS_CLIENTINFOMETHODS_VERSION &&
@@ -458,7 +455,7 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
} }
if (strcmp(name, "source-addr") == 0) { if (strcmp(name, "source-addr") == 0) {
strlcpy(buf, "unknown", sizeof(buf)); strcpy(buf, "unknown");
if (methods != NULL && if (methods != NULL &&
methods->sourceip != NULL && methods->sourceip != NULL &&
(methods->version - methods->age <= (methods->version - methods->age <=