mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 05:57:52 +00:00
Use libuv's shared library handling capabilities
While libltdl is a feature-rich library, BIND 9 code only uses its basic capabilities, which are also provided by libuv and which BIND 9 already uses for other purposes. As libuv's cross-platform shared library handling interface is modeled after the POSIX dlopen() interface, converting code using the latter to the former is simple. Replace libltdl function calls with their libuv counterparts, refactoring the code as necessary. Remove all use of libltdl from the BIND 9 source tree.
This commit is contained in:
parent
e2436159ab
commit
37b9511ce1
1
.gitignore
vendored
1
.gitignore
vendored
@ -39,7 +39,6 @@ __pycache__/
|
|||||||
/depcomp
|
/depcomp
|
||||||
/install-sh
|
/install-sh
|
||||||
/isc-config.sh
|
/isc-config.sh
|
||||||
/libltdl/*
|
|
||||||
/libtool
|
/libtool
|
||||||
/ltmain.sh
|
/ltmain.sh
|
||||||
/m4/libtool.m4
|
/m4/libtool.m4
|
||||||
|
@ -1527,9 +1527,9 @@ gcov:
|
|||||||
# Generate XML file in the Cobertura XML format suitable for use by GitLab
|
# Generate XML file in the Cobertura XML format suitable for use by GitLab
|
||||||
# for the purpose of displaying code coverage information in the diff view
|
# for the purpose of displaying code coverage information in the diff view
|
||||||
# of a given merge request.
|
# of a given merge request.
|
||||||
- gcovr --root . --exclude-directories bin/tests --exclude-directories doc --exclude-directories libltdl --exclude-directories lib/samples --exclude 'lib/.*/tests/.*' --xml -o coverage.xml
|
- gcovr --root . --exclude-directories bin/tests --exclude-directories doc --exclude-directories lib/samples --exclude 'lib/.*/tests/.*' --xml -o coverage.xml
|
||||||
- gcovr --root . --exclude-directories bin/tests --exclude-directories doc --exclude-directories libltdl --exclude-directories lib/samples --exclude 'lib/.*/tests/.*' --html-details -o coverage.html
|
- gcovr --root . --exclude-directories bin/tests --exclude-directories doc --exclude-directories lib/samples --exclude 'lib/.*/tests/.*' --html-details -o coverage.html
|
||||||
- gcovr --root . --exclude-directories bin/tests --exclude-directories doc --exclude-directories libltdl --exclude-directories lib/samples --exclude 'lib/.*/tests/.*' -o coverage.txt
|
- gcovr --root . --exclude-directories bin/tests --exclude-directories doc --exclude-directories lib/samples --exclude 'lib/.*/tests/.*' -o coverage.txt
|
||||||
- tail -n 3 coverage.txt
|
- tail -n 3 coverage.txt
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
|
@ -29,7 +29,6 @@ path_classifiers:
|
|||||||
- "**/*.5"
|
- "**/*.5"
|
||||||
- "**/*.8"
|
- "**/*.8"
|
||||||
queries:
|
queries:
|
||||||
- exclude: libltdl/
|
|
||||||
- exclude: fuzz/
|
- exclude: fuzz/
|
||||||
- exclude: "bin/tests/system/*/ans*/*.py"
|
- exclude: "bin/tests/system/*/ans*/*.py"
|
||||||
- exclude: cpp/use-of-goto
|
- exclude: cpp/use-of-goto
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
include $(top_srcdir)/Makefile.top
|
include $(top_srcdir)/Makefile.top
|
||||||
|
|
||||||
SUBDIRS = . libltdl lib doc bin fuzz
|
SUBDIRS = . lib doc bin fuzz
|
||||||
|
|
||||||
BUILT_SOURCES = bind.keys.h
|
BUILT_SOURCES = bind.keys.h
|
||||||
CLEANFILES = bind.keys.h
|
CLEANFILES = bind.keys.h
|
||||||
|
@ -93,9 +93,3 @@ LIBBIND9_CFLAGS = \
|
|||||||
|
|
||||||
LIBBIND9_LIBS = \
|
LIBBIND9_LIBS = \
|
||||||
$(top_builddir)/lib/bind9/libbind9.la
|
$(top_builddir)/lib/bind9/libbind9.la
|
||||||
|
|
||||||
LIBLTDL_CFLAGS = \
|
|
||||||
-I$(top_srcdir)/libltdl
|
|
||||||
|
|
||||||
LIBLTDL_LIBS = \
|
|
||||||
$(top_builddir)/libltdl/libltdlc.la
|
|
||||||
|
@ -201,7 +201,6 @@ installed:
|
|||||||
autoconf (includes autoreconf)
|
autoconf (includes autoreconf)
|
||||||
automake
|
automake
|
||||||
libtool
|
libtool
|
||||||
libltdl-dev (Debian) / libtool-ltdl-dev (Fedora/CentOS) / libltdl (FreeBSD)
|
|
||||||
|
|
||||||
#### <a name="opts"/> Compile-time options
|
#### <a name="opts"/> Compile-time options
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@ AM_CPPFLAGS += \
|
|||||||
$(LIBISCCC_CFLAGS) \
|
$(LIBISCCC_CFLAGS) \
|
||||||
$(LIBISCCFG_CFLAGS) \
|
$(LIBISCCFG_CFLAGS) \
|
||||||
$(LIBBIND9_CFLAGS) \
|
$(LIBBIND9_CFLAGS) \
|
||||||
$(LIBLTDL_CFLAGS) \
|
|
||||||
$(OPENSSL_CFLAGS) \
|
$(OPENSSL_CFLAGS) \
|
||||||
$(LIBCAP_CFLAGS) \
|
$(LIBCAP_CFLAGS) \
|
||||||
$(LMDB_CFLAGS) \
|
$(LMDB_CFLAGS) \
|
||||||
|
@ -10,11 +10,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <ltdl.h>
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <uv.h>
|
||||||
|
|
||||||
#include <isc/mem.h>
|
#include <isc/mem.h>
|
||||||
#include <isc/print.h>
|
#include <isc/print.h>
|
||||||
@ -34,7 +34,7 @@ typedef struct dlopen_data {
|
|||||||
isc_mem_t *mctx;
|
isc_mem_t *mctx;
|
||||||
char *dl_path;
|
char *dl_path;
|
||||||
char *dlzname;
|
char *dlzname;
|
||||||
void *dl_handle;
|
uv_lib_t dl_handle;
|
||||||
void *dbdata;
|
void *dbdata;
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
isc_mutex_t lock;
|
isc_mutex_t lock;
|
||||||
@ -180,9 +180,10 @@ dlopen_dlz_lookup(const char *zone, const char *name, void *driverarg,
|
|||||||
*/
|
*/
|
||||||
static void *
|
static void *
|
||||||
dl_load_symbol(dlopen_data_t *cd, const char *symbol, bool mandatory) {
|
dl_load_symbol(dlopen_data_t *cd, const char *symbol, bool mandatory) {
|
||||||
void *ptr = lt_dlsym((lt_dlhandle)cd->dl_handle, symbol);
|
void *ptr = NULL;
|
||||||
if (ptr == NULL) {
|
int r = uv_dlsym(&cd->dl_handle, symbol, &ptr);
|
||||||
const char *errmsg = lt_dlerror();
|
if (r != 0) {
|
||||||
|
const char *errmsg = uv_dlerror(&cd->dl_handle);
|
||||||
if (errmsg == NULL) {
|
if (errmsg == NULL) {
|
||||||
errmsg = "returned function pointer is NULL";
|
errmsg = "returned function pointer is NULL";
|
||||||
}
|
}
|
||||||
@ -209,6 +210,7 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
|
|||||||
dlopen_data_t *cd;
|
dlopen_data_t *cd;
|
||||||
isc_mem_t *mctx = NULL;
|
isc_mem_t *mctx = NULL;
|
||||||
isc_result_t result = ISC_R_FAILURE;
|
isc_result_t result = ISC_R_FAILURE;
|
||||||
|
int r;
|
||||||
|
|
||||||
UNUSED(driverarg);
|
UNUSED(driverarg);
|
||||||
|
|
||||||
@ -220,10 +222,6 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
|
|||||||
return (ISC_R_FAILURE);
|
return (ISC_R_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lt_dlinit() != 0) {
|
|
||||||
return (ISC_R_FAILURE);
|
|
||||||
}
|
|
||||||
|
|
||||||
isc_mem_create(&mctx);
|
isc_mem_create(&mctx);
|
||||||
cd = isc_mem_get(mctx, sizeof(*cd));
|
cd = isc_mem_get(mctx, sizeof(*cd));
|
||||||
memset(cd, 0, sizeof(*cd));
|
memset(cd, 0, sizeof(*cd));
|
||||||
@ -236,9 +234,9 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
|
|||||||
/* Initialize the lock */
|
/* Initialize the lock */
|
||||||
isc_mutex_init(&cd->lock);
|
isc_mutex_init(&cd->lock);
|
||||||
|
|
||||||
cd->dl_handle = lt_dlopenext(cd->dl_path);
|
r = uv_dlopen(cd->dl_path, &cd->dl_handle);
|
||||||
if (cd->dl_handle == NULL) {
|
if (r != 0) {
|
||||||
const char *errmsg = lt_dlerror();
|
const char *errmsg = uv_dlerror(&cd->dl_handle);
|
||||||
if (errmsg == NULL) {
|
if (errmsg == NULL) {
|
||||||
errmsg = "unknown error";
|
errmsg = "unknown error";
|
||||||
}
|
}
|
||||||
@ -347,9 +345,7 @@ dlopen_dlz_destroy(void *driverarg, void *dbdata) {
|
|||||||
MAYBE_UNLOCK(cd);
|
MAYBE_UNLOCK(cd);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cd->dl_handle) {
|
uv_dlclose(&cd->dl_handle);
|
||||||
lt_dlclose(cd->dl_handle);
|
|
||||||
}
|
|
||||||
isc_mutex_destroy(&cd->lock);
|
isc_mutex_destroy(&cd->lock);
|
||||||
isc_mem_free(cd->mctx, cd->dl_path);
|
isc_mem_free(cd->mctx, cd->dl_path);
|
||||||
isc_mem_free(cd->mctx, cd->dlzname);
|
isc_mem_free(cd->mctx, cd->dlzname);
|
||||||
|
@ -13,11 +13,6 @@
|
|||||||
|
|
||||||
/* aliases for the exported symbols */
|
/* aliases for the exported symbols */
|
||||||
|
|
||||||
#define plugin_destroy filter_aaaa_LTX_plugin_destroy
|
|
||||||
#define plugin_register filter_aaaa_LTX_plugin_register
|
|
||||||
#define plugin_version filter_aaaa_LTX_plugin_version
|
|
||||||
#define plugin_check filter_aaaa_LTX_plugin_check
|
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -32,21 +32,6 @@
|
|||||||
|
|
||||||
/* aliases for exported symbols */
|
/* aliases for exported symbols */
|
||||||
|
|
||||||
#define dlz_version dlzexternal_LTX_dlz_version
|
|
||||||
#define dlz_create dlzexternal_LTX_dlz_create
|
|
||||||
#define dlz_destroy dlzexternal_LTX_dlz_destroy
|
|
||||||
#define dlz_findzonedb dlzexternal_LTX_dlz_findzonedb
|
|
||||||
#define dlz_lookup dlzexternal_LTX_dlz_lookup
|
|
||||||
#define dlz_allowzonexfr dlzexternal_LTX_dlz_allowzonexfr
|
|
||||||
#define dlz_allnodes dlzexternal_LTX_dlz_allnodes
|
|
||||||
#define dlz_newversion dlzexternal_LTX_dlz_newversion
|
|
||||||
#define dlz_closeversion dlzexternal_LTX_dlz_closeversion
|
|
||||||
#define dlz_configure dlzexternal_LTX_dlz_configure
|
|
||||||
#define dlz_ssumatch dlzexternal_LTX_dlz_ssumatch
|
|
||||||
#define dlz_addrdataset dlzexternal_LTX_dlz_addrdataset
|
|
||||||
#define dlz_sbrdataset dlzexternal_LTX_dlz_sbrdataset
|
|
||||||
#define dlz_delrdataset dlzexternal_LTX_dlz_delrdataset
|
|
||||||
|
|
||||||
dlz_dlopen_version_t dlz_version;
|
dlz_dlopen_version_t dlz_version;
|
||||||
dlz_dlopen_create_t dlz_create;
|
dlz_dlopen_create_t dlz_create;
|
||||||
dlz_dlopen_destroy_t dlz_destroy;
|
dlz_dlopen_destroy_t dlz_destroy;
|
||||||
|
@ -35,29 +35,29 @@ controls {
|
|||||||
};
|
};
|
||||||
|
|
||||||
dlz "example one" {
|
dlz "example one" {
|
||||||
database "dlopen ../driver/dlzexternal.la example.nil";
|
database "dlopen ../driver/.libs/dlzexternal.so example.nil";
|
||||||
};
|
};
|
||||||
|
|
||||||
dlz "example two" {
|
dlz "example two" {
|
||||||
database "dlopen ../driver/dlzexternal.la alternate.nil";
|
database "dlopen ../driver/.libs/dlzexternal.so alternate.nil";
|
||||||
};
|
};
|
||||||
|
|
||||||
dlz "example three" {
|
dlz "example three" {
|
||||||
database "dlopen ../driver/dlzexternal.la example.org";
|
database "dlopen ../driver/.libs/dlzexternal.so example.org";
|
||||||
};
|
};
|
||||||
|
|
||||||
dlz "unsearched1" {
|
dlz "unsearched1" {
|
||||||
database "dlopen ../driver/dlzexternal.la other.nil";
|
database "dlopen ../driver/.libs/dlzexternal.so other.nil";
|
||||||
search no;
|
search no;
|
||||||
};
|
};
|
||||||
|
|
||||||
dlz "unsearched2" {
|
dlz "unsearched2" {
|
||||||
database "dlopen ../driver/dlzexternal.la zone.nil";
|
database "dlopen ../driver/.libs/dlzexternal.so zone.nil";
|
||||||
search no;
|
search no;
|
||||||
};
|
};
|
||||||
|
|
||||||
dlz redzone {
|
dlz redzone {
|
||||||
database "dlopen ../driver/dlzexternal.la .";
|
database "dlopen ../driver/.libs/dlzexternal.so .";
|
||||||
search no;
|
search no;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -33,10 +33,6 @@
|
|||||||
|
|
||||||
/* aliases for the exported symbols */
|
/* aliases for the exported symbols */
|
||||||
|
|
||||||
#define dyndb_init sample_LTX_dyndb_init
|
|
||||||
#define dyndb_destroy sample_LTX_dyndb_destroy
|
|
||||||
#define dyndb_version sample_LTX_dyndb_version
|
|
||||||
|
|
||||||
dns_dyndb_destroy_t dyndb_destroy;
|
dns_dyndb_destroy_t dyndb_destroy;
|
||||||
dns_dyndb_register_t dyndb_init;
|
dns_dyndb_register_t dyndb_init;
|
||||||
dns_dyndb_version_t dyndb_version;
|
dns_dyndb_version_t dyndb_version;
|
||||||
|
@ -33,5 +33,5 @@ controls {
|
|||||||
inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
|
inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
|
||||||
};
|
};
|
||||||
|
|
||||||
dyndb sample "../driver/sample.la" { ipv4.example.nil. in-addr.arpa. };
|
dyndb sample "../driver/.libs/sample.so" { ipv4.example.nil. in-addr.arpa. };
|
||||||
dyndb sample2 "../driver/sample.la" { ipv6.example.nil. 8.b.d.0.1.0.0.2.ip6.arpa. };
|
dyndb sample2 "../driver/.libs/sample.so" { ipv6.example.nil. 8.b.d.0.1.0.0.2.ip6.arpa. };
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
* information regarding copyright ownership.
|
* information regarding copyright ownership.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
plugin query "../../../plugins/filter-aaaa.la" {
|
plugin query "../../../plugins/.libs/filter-aaaa.so" {
|
||||||
filter-aaaa-on-v4 yes;
|
filter-aaaa-on-v4 yes;
|
||||||
filter-aaaa { none; };
|
filter-aaaa { none; };
|
||||||
};
|
};
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
* information regarding copyright ownership.
|
* information regarding copyright ownership.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
plugin query "../../../plugins/filter-aaaa.la" {
|
plugin query "../../../plugins/.libs/filter-aaaa.so" {
|
||||||
/*
|
/*
|
||||||
* While this matches the defaults, it is not a good configuration
|
* While this matches the defaults, it is not a good configuration
|
||||||
* to have in named.conf as the two options contradict each other
|
* to have in named.conf as the two options contradict each other
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
view myview {
|
view myview {
|
||||||
plugin query "../../../plugins/filter-aaaa.la" {
|
plugin query "../../../plugins/.libs/filter-aaaa.so" {
|
||||||
filter-aaaa-on-v4 no;
|
filter-aaaa-on-v4 no;
|
||||||
filter-aaaa { any; };
|
filter-aaaa { any; };
|
||||||
};
|
};
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
view myview {
|
view myview {
|
||||||
plugin query "../../../plugins/filter-aaaa.la" {
|
plugin query "../../../plugins/.libs/filter-aaaa.so" {
|
||||||
filter-aaaa-on-v4 yes;
|
filter-aaaa-on-v4 yes;
|
||||||
filter-aaaa { none; };
|
filter-aaaa { none; };
|
||||||
};
|
};
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
* information regarding copyright ownership.
|
* information regarding copyright ownership.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
plugin query "../../../plugins/filter-aaaa.la" {
|
plugin query "../../../plugins/.libs/filter-aaaa.so" {
|
||||||
filter-aaaa-on-v4 yes;
|
filter-aaaa-on-v4 yes;
|
||||||
filter-aaaa { 1.0.0.0/8; };
|
filter-aaaa { 1.0.0.0/8; };
|
||||||
};
|
};
|
||||||
|
@ -9,6 +9,6 @@
|
|||||||
* information regarding copyright ownership.
|
* information regarding copyright ownership.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
plugin query "../../../plugins/filter-aaaa.la" {
|
plugin query "../../../plugins/.libs/filter-aaaa.so" {
|
||||||
filter-aaaa-on-v4 yes;
|
filter-aaaa-on-v4 yes;
|
||||||
};
|
};
|
||||||
|
@ -9,6 +9,6 @@
|
|||||||
* information regarding copyright ownership.
|
* information regarding copyright ownership.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
plugin query "../../../plugins/filter-aaaa.la" {
|
plugin query "../../../plugins/.libs/filter-aaaa.so" {
|
||||||
filter-aaaa-on-v4 break-dnssec;
|
filter-aaaa-on-v4 break-dnssec;
|
||||||
};
|
};
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
* information regarding copyright ownership.
|
* information regarding copyright ownership.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
plugin query "../../../plugins/filter-aaaa.la" {
|
plugin query "../../../plugins/.libs/filter-aaaa.so" {
|
||||||
filter-aaaa-on-v4 break-dnssec;
|
filter-aaaa-on-v4 break-dnssec;
|
||||||
filter-aaaa { 1.0.0.0/8; };
|
filter-aaaa { 1.0.0.0/8; };
|
||||||
};
|
};
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
* information regarding copyright ownership.
|
* information regarding copyright ownership.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
plugin query "../../../plugins/filter-aaaa.la" {
|
plugin query "../../../plugins/.libs/filter-aaaa.so" {
|
||||||
filter-aaaa-on-v4 yes;
|
filter-aaaa-on-v4 yes;
|
||||||
filter-aaaa { 1.0.0.0/8; };
|
filter-aaaa { 1.0.0.0/8; };
|
||||||
};
|
};
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
view myview {
|
view myview {
|
||||||
plugin query "../../../plugins/filter-aaaa.la" {
|
plugin query "../../../plugins/.libs/filter-aaaa.so" {
|
||||||
filter-aaaa-on-v4 yes;
|
filter-aaaa-on-v4 yes;
|
||||||
filter-aaaa { 1.0.0.0/8; };
|
filter-aaaa { 1.0.0.0/8; };
|
||||||
};
|
};
|
||||||
|
@ -25,7 +25,7 @@ options {
|
|||||||
|
|
||||||
acl filterees { 10.53.0.1; };
|
acl filterees { 10.53.0.1; };
|
||||||
|
|
||||||
plugin query "../../../../plugins/filter-aaaa.la" {
|
plugin query "../../../../plugins/.libs/filter-aaaa.so" {
|
||||||
filter-aaaa-on-v4 yes;
|
filter-aaaa-on-v4 yes;
|
||||||
filter-aaaa { filterees; };
|
filter-aaaa { filterees; };
|
||||||
};
|
};
|
||||||
|
@ -23,7 +23,7 @@ options {
|
|||||||
minimal-responses no;
|
minimal-responses no;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin query "../../../../plugins/filter-aaaa.la" {
|
plugin query "../../../../plugins/.libs/filter-aaaa.so" {
|
||||||
filter-aaaa-on-v6 yes;
|
filter-aaaa-on-v6 yes;
|
||||||
filter-aaaa { fd92:7065:b8e:ffff::1; };
|
filter-aaaa { fd92:7065:b8e:ffff::1; };
|
||||||
};
|
};
|
||||||
|
@ -23,7 +23,7 @@ options {
|
|||||||
minimal-responses no;
|
minimal-responses no;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin query "../../../../plugins/filter-aaaa.la" {
|
plugin query "../../../../plugins/.libs/filter-aaaa.so" {
|
||||||
filter-aaaa-on-v4 yes;
|
filter-aaaa-on-v4 yes;
|
||||||
filter-aaaa { 10.53.0.2; };
|
filter-aaaa { 10.53.0.2; };
|
||||||
};
|
};
|
||||||
|
@ -23,7 +23,7 @@ options {
|
|||||||
minimal-responses no;
|
minimal-responses no;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin query "../../../../plugins/filter-aaaa.la" {
|
plugin query "../../../../plugins/.libs/filter-aaaa.so" {
|
||||||
filter-aaaa-on-v6 yes;
|
filter-aaaa-on-v6 yes;
|
||||||
filter-aaaa { fd92:7065:b8e:ffff::2; };
|
filter-aaaa { fd92:7065:b8e:ffff::2; };
|
||||||
};
|
};
|
||||||
|
@ -23,7 +23,7 @@ options {
|
|||||||
minimal-responses no;
|
minimal-responses no;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin query "../../../../plugins/filter-aaaa.la" {
|
plugin query "../../../../plugins/.libs/filter-aaaa.so" {
|
||||||
filter-aaaa-on-v4 break-dnssec;
|
filter-aaaa-on-v4 break-dnssec;
|
||||||
filter-aaaa { 10.53.0.3; };
|
filter-aaaa { 10.53.0.3; };
|
||||||
};
|
};
|
||||||
|
@ -23,7 +23,7 @@ options {
|
|||||||
minimal-responses no;
|
minimal-responses no;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin query "../../../../plugins/filter-aaaa.la" {
|
plugin query "../../../../plugins/.libs/filter-aaaa.so" {
|
||||||
filter-aaaa-on-v6 break-dnssec;
|
filter-aaaa-on-v6 break-dnssec;
|
||||||
filter-aaaa { fd92:7065:b8e:ffff::3; };
|
filter-aaaa { fd92:7065:b8e:ffff::3; };
|
||||||
};
|
};
|
||||||
|
@ -23,7 +23,7 @@ options {
|
|||||||
minimal-responses no;
|
minimal-responses no;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin query "../../../../plugins/filter-aaaa.la" {
|
plugin query "../../../../plugins/.libs/filter-aaaa.so" {
|
||||||
filter-aaaa-on-v4 break-dnssec;
|
filter-aaaa-on-v4 break-dnssec;
|
||||||
filter-aaaa { 10.53.0.4; };
|
filter-aaaa { 10.53.0.4; };
|
||||||
};
|
};
|
||||||
|
@ -23,7 +23,7 @@ options {
|
|||||||
minimal-responses no;
|
minimal-responses no;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin query "../../../../plugins/filter-aaaa.la" {
|
plugin query "../../../../plugins/.libs/filter-aaaa.so" {
|
||||||
filter-aaaa-on-v6 break-dnssec;
|
filter-aaaa-on-v6 break-dnssec;
|
||||||
filter-aaaa { fd92:7065:b8e:ffff::4; };
|
filter-aaaa { fd92:7065:b8e:ffff::4; };
|
||||||
};
|
};
|
||||||
|
@ -28,7 +28,7 @@ options {
|
|||||||
minimal-responses no;
|
minimal-responses no;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin query "../../../../plugins/filter-aaaa.la" {
|
plugin query "../../../../plugins/.libs/filter-aaaa.so" {
|
||||||
filter-aaaa-on-v4 break-dnssec;
|
filter-aaaa-on-v4 break-dnssec;
|
||||||
filter-aaaa { any; };
|
filter-aaaa { any; };
|
||||||
};
|
};
|
||||||
|
@ -124,10 +124,6 @@ LT_INIT([disable-static dlopen pic-only])
|
|||||||
AS_IF([test "$enable_static" != "no" && test "$enable_developer" != "yes"],
|
AS_IF([test "$enable_static" != "no" && test "$enable_developer" != "yes"],
|
||||||
[AC_MSG_ERROR([Static linking is not supported as it disables dlopen() and certain security features (e.g. RELRO, ASLR)])])
|
[AC_MSG_ERROR([Static linking is not supported as it disables dlopen() and certain security features (e.g. RELRO, ASLR)])])
|
||||||
|
|
||||||
LT_CONFIG_LTDL_DIR([libltdl])
|
|
||||||
LTDL_INIT([recursive])
|
|
||||||
AC_CONFIG_FILES([libltdl/Makefile])
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Set the default CFLAGS and CPPFLAGS
|
# Set the default CFLAGS and CPPFLAGS
|
||||||
#
|
#
|
||||||
|
@ -25,7 +25,7 @@ gen_SOURCES = gen.c gen-unix.h
|
|||||||
gen_CPPFLAGS = \
|
gen_CPPFLAGS = \
|
||||||
$(AM_CPPFLAGS)
|
$(AM_CPPFLAGS)
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
api \
|
api \
|
||||||
dnstap.proto \
|
dnstap.proto \
|
||||||
gen-win32.h \
|
gen-win32.h \
|
||||||
@ -277,10 +277,10 @@ endif
|
|||||||
|
|
||||||
libdns_la_CPPFLAGS = \
|
libdns_la_CPPFLAGS = \
|
||||||
$(AM_CPPFLAGS) \
|
$(AM_CPPFLAGS) \
|
||||||
$(LIBISC_CFLAGS) \
|
|
||||||
$(LIBDNS_CFLAGS) \
|
$(LIBDNS_CFLAGS) \
|
||||||
$(OPENSSL_CFLAGS) \
|
$(LIBISC_CFLAGS) \
|
||||||
$(LIBLTDL_CFLAGS)
|
$(LIBUV_CFLAGS) \
|
||||||
|
$(OPENSSL_CFLAGS)
|
||||||
|
|
||||||
libdns_la_LDFLAGS = \
|
libdns_la_LDFLAGS = \
|
||||||
$(AM_LDFLAGS) \
|
$(AM_LDFLAGS) \
|
||||||
@ -288,6 +288,7 @@ libdns_la_LDFLAGS = \
|
|||||||
|
|
||||||
libdns_la_LIBADD = \
|
libdns_la_LIBADD = \
|
||||||
$(LIBISC_LIBS) \
|
$(LIBISC_LIBS) \
|
||||||
|
$(LIBUV_LIBS) \
|
||||||
$(OPENSSL_LIBS)
|
$(OPENSSL_LIBS)
|
||||||
|
|
||||||
if HAVE_JSON_C
|
if HAVE_JSON_C
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
* information regarding copyright ownership.
|
* information regarding copyright ownership.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <ltdl.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <uv.h>
|
||||||
|
|
||||||
#include <isc/buffer.h>
|
#include <isc/buffer.h>
|
||||||
#include <isc/mem.h>
|
#include <isc/mem.h>
|
||||||
@ -38,7 +38,7 @@
|
|||||||
typedef struct dyndb_implementation dyndb_implementation_t;
|
typedef struct dyndb_implementation dyndb_implementation_t;
|
||||||
struct dyndb_implementation {
|
struct dyndb_implementation {
|
||||||
isc_mem_t *mctx;
|
isc_mem_t *mctx;
|
||||||
void *handle;
|
uv_lib_t handle;
|
||||||
dns_dyndb_register_t *register_func;
|
dns_dyndb_register_t *register_func;
|
||||||
dns_dyndb_destroy_t *destroy_func;
|
dns_dyndb_destroy_t *destroy_func;
|
||||||
char *name;
|
char *name;
|
||||||
@ -79,16 +79,17 @@ impfind(const char *name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static isc_result_t
|
static isc_result_t
|
||||||
load_symbol(lt_dlhandle handle, const char *filename, const char *symbol_name,
|
load_symbol(uv_lib_t *handle, const char *filename, const char *symbol_name,
|
||||||
void **symbolp) {
|
void **symbolp) {
|
||||||
void *symbol;
|
void *symbol;
|
||||||
|
int r;
|
||||||
|
|
||||||
REQUIRE(handle != NULL);
|
REQUIRE(handle != NULL);
|
||||||
REQUIRE(symbolp != NULL && *symbolp == NULL);
|
REQUIRE(symbolp != NULL && *symbolp == NULL);
|
||||||
|
|
||||||
symbol = lt_dlsym(handle, symbol_name);
|
r = uv_dlsym(handle, symbol_name, &symbol);
|
||||||
if (symbol == NULL) {
|
if (r != 0) {
|
||||||
const char *errmsg = lt_dlerror();
|
const char *errmsg = uv_dlerror(handle);
|
||||||
if (errmsg == NULL) {
|
if (errmsg == NULL) {
|
||||||
errmsg = "returned function pointer is NULL";
|
errmsg = "returned function pointer is NULL";
|
||||||
}
|
}
|
||||||
@ -115,6 +116,7 @@ load_library(isc_mem_t *mctx, const char *filename, const char *instname,
|
|||||||
dyndb_implementation_t *imp = NULL;
|
dyndb_implementation_t *imp = NULL;
|
||||||
dns_dyndb_version_t *version_func = NULL;
|
dns_dyndb_version_t *version_func = NULL;
|
||||||
int version;
|
int version;
|
||||||
|
int r;
|
||||||
|
|
||||||
REQUIRE(impp != NULL && *impp == NULL);
|
REQUIRE(impp != NULL && *impp == NULL);
|
||||||
|
|
||||||
@ -130,13 +132,9 @@ load_library(isc_mem_t *mctx, const char *filename, const char *instname,
|
|||||||
|
|
||||||
INIT_LINK(imp, link);
|
INIT_LINK(imp, link);
|
||||||
|
|
||||||
if (lt_dlinit() != 0) {
|
r = uv_dlopen(filename, &imp->handle);
|
||||||
CHECK(ISC_R_FAILURE);
|
if (r != 0) {
|
||||||
}
|
const char *errmsg = uv_dlerror(&imp->handle);
|
||||||
|
|
||||||
imp->handle = lt_dlopen(filename);
|
|
||||||
if (imp->handle == NULL) {
|
|
||||||
const char *errmsg = lt_dlerror();
|
|
||||||
if (errmsg == NULL) {
|
if (errmsg == NULL) {
|
||||||
errmsg = "unknown error";
|
errmsg = "unknown error";
|
||||||
}
|
}
|
||||||
@ -148,7 +146,7 @@ load_library(isc_mem_t *mctx, const char *filename, const char *instname,
|
|||||||
CHECK(ISC_R_FAILURE);
|
CHECK(ISC_R_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
CHECK(load_symbol(imp->handle, filename, "dyndb_version",
|
CHECK(load_symbol(&imp->handle, filename, "dyndb_version",
|
||||||
(void **)&version_func));
|
(void **)&version_func));
|
||||||
|
|
||||||
version = version_func(NULL);
|
version = version_func(NULL);
|
||||||
@ -162,9 +160,9 @@ load_library(isc_mem_t *mctx, const char *filename, const char *instname,
|
|||||||
CHECK(ISC_R_FAILURE);
|
CHECK(ISC_R_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
CHECK(load_symbol(imp->handle, filename, "dyndb_init",
|
CHECK(load_symbol(&imp->handle, filename, "dyndb_init",
|
||||||
(void **)&imp->register_func));
|
(void **)&imp->register_func));
|
||||||
CHECK(load_symbol(imp->handle, filename, "dyndb_destroy",
|
CHECK(load_symbol(&imp->handle, filename, "dyndb_destroy",
|
||||||
(void **)&imp->destroy_func));
|
(void **)&imp->destroy_func));
|
||||||
|
|
||||||
*impp = imp;
|
*impp = imp;
|
||||||
@ -196,9 +194,7 @@ unload_library(dyndb_implementation_t **impp) {
|
|||||||
* This is a resource leak, but there is nothing we can currently do
|
* This is a resource leak, but there is nothing we can currently do
|
||||||
* about it due to how configuration loading/reloading is designed.
|
* about it due to how configuration loading/reloading is designed.
|
||||||
*/
|
*/
|
||||||
if (imp->handle != NULL) {
|
/* uv_dlclose(&imp->handle); */
|
||||||
(void)lt_dlclose(imp->handle);
|
|
||||||
}
|
|
||||||
isc_mem_free(imp->mctx, imp->name);
|
isc_mem_free(imp->mctx, imp->name);
|
||||||
isc_mem_putanddetach(&imp->mctx, imp, sizeof(*imp));
|
isc_mem_putanddetach(&imp->mctx, imp, sizeof(*imp));
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<PreprocessorDefinitions>BIND9;WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBDNS_EXPORTS;%(PreprocessorDefinitions);%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>BIND9;WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBDNS_EXPORTS;%(PreprocessorDefinitions);%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
|
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
|
||||||
<AdditionalIncludeDirectories>.\;..\..\..\;include;..\include;..\..\isc;..\..\isc\win32;..\..\isc\win32\include;..\..\isc\include;@LIBXML2_INC@@OPENSSL_INC@@GSSAPI_INC@@GEOIP_INC@%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>.\;..\..\..\;include;..\include;..\..\isc;..\..\isc\win32;..\..\isc\win32\include;..\..\isc\include;@LIBXML2_INC@@LIBUV_INC@@OPENSSL_INC@@GSSAPI_INC@@GEOIP_INC@%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
|
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
|
||||||
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
|
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
|
||||||
@ -75,7 +75,7 @@
|
|||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||||
<AdditionalLibraryDirectories>..\..\isc\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>..\..\isc\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
<AdditionalDependencies>@OPENSSL_LIB@libisc.lib;@LIBXML2_LIB@@GSSAPI_LIB@@KRB5_LIB@@GEOIP_LIB@ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>@LIBUV_LIB@@OPENSSL_LIB@libisc.lib;@LIBXML2_LIB@@GSSAPI_LIB@@KRB5_LIB@@GEOIP_LIB@ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<ModuleDefinitionFile>$(ProjectName).def</ModuleDefinitionFile>
|
<ModuleDefinitionFile>$(ProjectName).def</ModuleDefinitionFile>
|
||||||
<ImportLibrary>.\$(Configuration)\$(ProjectName).lib</ImportLibrary>
|
<ImportLibrary>.\$(Configuration)\$(ProjectName).lib</ImportLibrary>
|
||||||
</Link>
|
</Link>
|
||||||
@ -91,7 +91,7 @@
|
|||||||
<IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
|
<IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>BIND9;WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBDNS_EXPORTS;%(PreprocessorDefinitions);%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>BIND9;WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBDNS_EXPORTS;%(PreprocessorDefinitions);%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
|
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
|
||||||
<AdditionalIncludeDirectories>.\;..\..\..\;include;..\include;..\..\isc;..\..\isc\win32;..\..\isc\win32\include;..\..\isc\include;@LIBXML2_INC@@OPENSSL_INC@@GSSAPI_INC@@GEOIP_INC@%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>.\;..\..\..\;include;..\include;..\..\isc;..\..\isc\win32;..\..\isc\win32\include;..\..\isc\include;@LIBXML2_INC@@LIBUV_INC@@OPENSSL_INC@@GSSAPI_INC@@GEOIP_INC@%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
<StringPooling>true</StringPooling>
|
<StringPooling>true</StringPooling>
|
||||||
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
|
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
|
||||||
@ -108,7 +108,7 @@
|
|||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||||
<AdditionalLibraryDirectories>..\..\isc\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>..\..\isc\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
<AdditionalDependencies>@OPENSSL_LIB@libisc.lib;@LIBXML2_LIB@@GSSAPI_LIB@@KRB5_LIB@@GEOIP_LIB@ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>@LIBUV_LIB@@OPENSSL_LIB@libisc.lib;@LIBXML2_LIB@@GSSAPI_LIB@@KRB5_LIB@@GEOIP_LIB@ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<ModuleDefinitionFile>$(ProjectName).def</ModuleDefinitionFile>
|
<ModuleDefinitionFile>$(ProjectName).def</ModuleDefinitionFile>
|
||||||
<ImportLibrary>.\$(Configuration)\$(ProjectName).lib</ImportLibrary>
|
<ImportLibrary>.\$(Configuration)\$(ProjectName).lib</ImportLibrary>
|
||||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||||
|
@ -230,7 +230,6 @@ libisc_la_LDFLAGS = \
|
|||||||
$(libisc_VERSION_INFO)
|
$(libisc_VERSION_INFO)
|
||||||
|
|
||||||
libisc_la_LIBADD = \
|
libisc_la_LIBADD = \
|
||||||
$(LIBLTDL_LIBS) \
|
|
||||||
$(LIBUV_LIBS) \
|
$(LIBUV_LIBS) \
|
||||||
$(OPENSSL_LIBS) \
|
$(OPENSSL_LIBS) \
|
||||||
$(ZLIB_LIBS)
|
$(ZLIB_LIBS)
|
||||||
|
@ -1,43 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
|
||||||
*
|
|
||||||
* See the COPYRIGHT file distributed with this work for additional
|
|
||||||
* information regarding copyright ownership.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
#define lt_dlhandle HMODULE
|
|
||||||
#define lt_dlinit() ISC_R_SUCCESS
|
|
||||||
#define lt_dlopen(f) LoadLibraryW(f)
|
|
||||||
#define lt_dlsym(h, s) GetProcAddress(h, s)
|
|
||||||
#define lt_dlclose(h) FreeLibrary(h)
|
|
||||||
|
|
||||||
__declspec(thread) LPSTR __dlerror_message[1024] = { 0 };
|
|
||||||
|
|
||||||
static const char *
|
|
||||||
lt_dlerror(void) {
|
|
||||||
DWORD errorMessageID = GetLastError();
|
|
||||||
if (errorMessageID == 0) {
|
|
||||||
return (NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
LPSTR messageBuffer = NULL;
|
|
||||||
size_t size = FormatMessageA(
|
|
||||||
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
|
|
||||||
FORMAT_MESSAGE_IGNORE_INSERTS,
|
|
||||||
NULL, errorMessageID, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
|
||||||
(LPSTR)&messageBuffer, 0, NULL);
|
|
||||||
|
|
||||||
strlcpy(__dlerror_message, messageBuffer, sizeof(__dlerror_message));
|
|
||||||
|
|
||||||
LocalFree(messageBuffer);
|
|
||||||
|
|
||||||
return ((const char *)__dlerror_message);
|
|
||||||
}
|
|
@ -41,14 +41,15 @@ libns_la_SOURCES = \
|
|||||||
|
|
||||||
libns_la_CPPFLAGS = \
|
libns_la_CPPFLAGS = \
|
||||||
$(AM_CPPFLAGS) \
|
$(AM_CPPFLAGS) \
|
||||||
$(LIBISC_CFLAGS) \
|
|
||||||
$(LIBDNS_CFLAGS) \
|
$(LIBDNS_CFLAGS) \
|
||||||
|
$(LIBISC_CFLAGS) \
|
||||||
$(LIBNS_CFLAGS) \
|
$(LIBNS_CFLAGS) \
|
||||||
$(LIBLTDL_CFLAGS)
|
$(LIBUV_CFLAGS)
|
||||||
|
|
||||||
libns_la_LIBADD = \
|
libns_la_LIBADD = \
|
||||||
|
$(LIBDNS_LIBS) \
|
||||||
$(LIBISC_LIBS) \
|
$(LIBISC_LIBS) \
|
||||||
$(LIBDNS_LIBS)
|
$(LIBUV_LIBS)
|
||||||
|
|
||||||
libns_la_LDFLAGS = \
|
libns_la_LDFLAGS = \
|
||||||
$(AM_LDFLAGS) \
|
$(AM_LDFLAGS) \
|
||||||
|
@ -12,9 +12,9 @@
|
|||||||
/*! \file */
|
/*! \file */
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <ltdl.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <uv.h>
|
||||||
|
|
||||||
#include <isc/errno.h>
|
#include <isc/errno.h>
|
||||||
#include <isc/list.h>
|
#include <isc/list.h>
|
||||||
@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
struct ns_plugin {
|
struct ns_plugin {
|
||||||
isc_mem_t *mctx;
|
isc_mem_t *mctx;
|
||||||
void *handle;
|
uv_lib_t handle;
|
||||||
void *inst;
|
void *inst;
|
||||||
char *modpath;
|
char *modpath;
|
||||||
ns_plugin_check_t *check_func;
|
ns_plugin_check_t *check_func;
|
||||||
@ -91,16 +91,17 @@ ns_plugin_expandpath(const char *src, char *dst, size_t dstsize) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static isc_result_t
|
static isc_result_t
|
||||||
load_symbol(void *handle, const char *modpath, const char *symbol_name,
|
load_symbol(uv_lib_t *handle, const char *modpath, const char *symbol_name,
|
||||||
void **symbolp) {
|
void **symbolp) {
|
||||||
void *symbol = NULL;
|
void *symbol = NULL;
|
||||||
|
int r;
|
||||||
|
|
||||||
REQUIRE(handle != NULL);
|
REQUIRE(handle != NULL);
|
||||||
REQUIRE(symbolp != NULL && *symbolp == NULL);
|
REQUIRE(symbolp != NULL && *symbolp == NULL);
|
||||||
|
|
||||||
symbol = lt_dlsym(handle, symbol_name);
|
r = uv_dlsym(handle, symbol_name, &symbol);
|
||||||
if (symbol == NULL) {
|
if (r != 0) {
|
||||||
const char *errmsg = lt_dlerror();
|
const char *errmsg = uv_dlerror(handle);
|
||||||
if (errmsg == NULL) {
|
if (errmsg == NULL) {
|
||||||
errmsg = "returned function pointer is NULL";
|
errmsg = "returned function pointer is NULL";
|
||||||
}
|
}
|
||||||
@ -126,6 +127,7 @@ load_plugin(isc_mem_t *mctx, const char *modpath, ns_plugin_t **pluginp) {
|
|||||||
ns_plugin_t *plugin = NULL;
|
ns_plugin_t *plugin = NULL;
|
||||||
ns_plugin_version_t *version_func = NULL;
|
ns_plugin_version_t *version_func = NULL;
|
||||||
int version;
|
int version;
|
||||||
|
int r;
|
||||||
|
|
||||||
REQUIRE(pluginp != NULL && *pluginp == NULL);
|
REQUIRE(pluginp != NULL && *pluginp == NULL);
|
||||||
|
|
||||||
@ -137,13 +139,9 @@ load_plugin(isc_mem_t *mctx, const char *modpath, ns_plugin_t **pluginp) {
|
|||||||
|
|
||||||
ISC_LINK_INIT(plugin, link);
|
ISC_LINK_INIT(plugin, link);
|
||||||
|
|
||||||
if (lt_dlinit() != 0) {
|
r = uv_dlopen(modpath, &plugin->handle);
|
||||||
CHECK(ISC_R_FAILURE);
|
if (r != 0) {
|
||||||
}
|
const char *errmsg = uv_dlerror(&plugin->handle);
|
||||||
|
|
||||||
plugin->handle = lt_dlopen(modpath);
|
|
||||||
if (plugin->handle == NULL) {
|
|
||||||
const char *errmsg = lt_dlerror();
|
|
||||||
if (errmsg == NULL) {
|
if (errmsg == NULL) {
|
||||||
errmsg = "unknown error";
|
errmsg = "unknown error";
|
||||||
}
|
}
|
||||||
@ -154,7 +152,7 @@ load_plugin(isc_mem_t *mctx, const char *modpath, ns_plugin_t **pluginp) {
|
|||||||
CHECK(ISC_R_FAILURE);
|
CHECK(ISC_R_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
CHECK(load_symbol(plugin->handle, modpath, "plugin_version",
|
CHECK(load_symbol(&plugin->handle, modpath, "plugin_version",
|
||||||
(void **)&version_func));
|
(void **)&version_func));
|
||||||
|
|
||||||
version = version_func();
|
version = version_func();
|
||||||
@ -168,11 +166,11 @@ load_plugin(isc_mem_t *mctx, const char *modpath, ns_plugin_t **pluginp) {
|
|||||||
CHECK(ISC_R_FAILURE);
|
CHECK(ISC_R_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
CHECK(load_symbol(plugin->handle, modpath, "plugin_check",
|
CHECK(load_symbol(&plugin->handle, modpath, "plugin_check",
|
||||||
(void **)&plugin->check_func));
|
(void **)&plugin->check_func));
|
||||||
CHECK(load_symbol(plugin->handle, modpath, "plugin_register",
|
CHECK(load_symbol(&plugin->handle, modpath, "plugin_register",
|
||||||
(void **)&plugin->register_func));
|
(void **)&plugin->register_func));
|
||||||
CHECK(load_symbol(plugin->handle, modpath, "plugin_destroy",
|
CHECK(load_symbol(&plugin->handle, modpath, "plugin_destroy",
|
||||||
(void **)&plugin->destroy_func));
|
(void **)&plugin->destroy_func));
|
||||||
|
|
||||||
*pluginp = plugin;
|
*pluginp = plugin;
|
||||||
@ -207,9 +205,7 @@ unload_plugin(ns_plugin_t **pluginp) {
|
|||||||
plugin->destroy_func(&plugin->inst);
|
plugin->destroy_func(&plugin->inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plugin->handle != NULL) {
|
uv_dlclose(&plugin->handle);
|
||||||
(void)lt_dlclose(plugin->handle);
|
|
||||||
}
|
|
||||||
isc_mem_free(plugin->mctx, plugin->modpath);
|
isc_mem_free(plugin->mctx, plugin->modpath);
|
||||||
isc_mem_putanddetach(&plugin->mctx, plugin, sizeof(*plugin));
|
isc_mem_putanddetach(&plugin->mctx, plugin, sizeof(*plugin));
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;_USRDLL;LIBNS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;_DEBUG;_USRDLL;LIBNS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
|
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
|
||||||
<AdditionalIncludeDirectories>.\;..\..\..\;include;..\include;..\..\isc\win32;..\..\isc\win32\include;..\..\isc\include;..\..\..\lib\dns\include;@LIBXML2_INC@@OPENSSL_INC@@GSSAPI_INC@@GEOIP_INC@%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>.\;..\..\..\;include;..\include;..\..\isc\win32;..\..\isc\win32\include;..\..\isc\include;..\..\..\lib\dns\include;@LIBXML2_INC@@LIBUV_INC@@OPENSSL_INC@@GSSAPI_INC@@GEOIP_INC@%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
|
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
|
||||||
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
|
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
|
||||||
@ -74,7 +74,7 @@
|
|||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||||
<AdditionalLibraryDirectories>..\..\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>..\..\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
<AdditionalDependencies>@OPENSSL_LIB@libisc.lib;libdns.lib;@LIBXML2_LIB@@GSSAPI_LIB@@GEOIP_LIB@ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>@LIBUV_LIB@@OPENSSL_LIB@libisc.lib;libdns.lib;@LIBXML2_LIB@@GSSAPI_LIB@@GEOIP_LIB@ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<ModuleDefinitionFile>$(ProjectName).def</ModuleDefinitionFile>
|
<ModuleDefinitionFile>$(ProjectName).def</ModuleDefinitionFile>
|
||||||
<ImportLibrary>.\$(Configuration)\$(ProjectName).lib</ImportLibrary>
|
<ImportLibrary>.\$(Configuration)\$(ProjectName).lib</ImportLibrary>
|
||||||
</Link>
|
</Link>
|
||||||
@ -90,7 +90,7 @@
|
|||||||
<IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
|
<IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;_USRDLL;LIBNS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;NDEBUG;_USRDLL;LIBNS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
|
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
|
||||||
<AdditionalIncludeDirectories>.\;..\..\..\;include;..\include;..\..\isc\win32;..\..\isc\win32\include;..\..\isc\include;..\..\..\lib\dns\include;@LIBXML2_INC@@OPENSSL_INC@@GSSAPI_INC@@GEOIP_INC@%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>.\;..\..\..\;include;..\include;..\..\isc\win32;..\..\isc\win32\include;..\..\isc\include;..\..\..\lib\dns\include;@LIBXML2_INC@@LIBUV_INC@@OPENSSL_INC@@GSSAPI_INC@@GEOIP_INC@%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
<StringPooling>true</StringPooling>
|
<StringPooling>true</StringPooling>
|
||||||
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
|
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
|
||||||
@ -107,7 +107,7 @@
|
|||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||||
<AdditionalLibraryDirectories>..\..\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>..\..\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
<AdditionalDependencies>@OPENSSL_LIB@libisc.lib;libdns.lib;@LIBXML2_LIB@@GSSAPI_LIB@@GEOIP_LIB@ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>@LIBUV_LIB@@OPENSSL_LIB@libisc.lib;libdns.lib;@LIBXML2_LIB@@GSSAPI_LIB@@GEOIP_LIB@ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<ModuleDefinitionFile>$(ProjectName).def</ModuleDefinitionFile>
|
<ModuleDefinitionFile>$(ProjectName).def</ModuleDefinitionFile>
|
||||||
<ImportLibrary>.\$(Configuration)\$(ProjectName).lib</ImportLibrary>
|
<ImportLibrary>.\$(Configuration)\$(ProjectName).lib</ImportLibrary>
|
||||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||||
|
@ -2023,7 +2023,6 @@
|
|||||||
./lib/isc/win32/libisc.vcxproj.filters.in X 2013,2014,2015,2016,2018,2019,2020
|
./lib/isc/win32/libisc.vcxproj.filters.in X 2013,2014,2015,2016,2018,2019,2020
|
||||||
./lib/isc/win32/libisc.vcxproj.in X 2013,2014,2015,2016,2017,2018,2019,2020
|
./lib/isc/win32/libisc.vcxproj.in X 2013,2014,2015,2016,2017,2018,2019,2020
|
||||||
./lib/isc/win32/libisc.vcxproj.user X 2013,2018,2019,2020
|
./lib/isc/win32/libisc.vcxproj.user X 2013,2018,2019,2020
|
||||||
./lib/isc/win32/ltdl.h C 2020
|
|
||||||
./lib/isc/win32/meminfo.c C 2015,2016,2018,2019,2020
|
./lib/isc/win32/meminfo.c C 2015,2016,2018,2019,2020
|
||||||
./lib/isc/win32/net.c C 1999,2000,2001,2002,2003,2004,2005,2007,2008,2009,2011,2012,2013,2014,2015,2016,2018,2019,2020
|
./lib/isc/win32/net.c C 1999,2000,2001,2002,2003,2004,2005,2007,2008,2009,2011,2012,2013,2014,2015,2016,2018,2019,2020
|
||||||
./lib/isc/win32/netdb.h C 2000,2001,2004,2006,2007,2009,2013,2016,2018,2019,2020
|
./lib/isc/win32/netdb.h C 2000,2001,2004,2006,2007,2009,2013,2016,2018,2019,2020
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
unmatchedSuppression:*
|
unmatchedSuppression:*
|
||||||
preprocessorErrorDirective:*
|
preprocessorErrorDirective:*
|
||||||
unknownMacro:*
|
unknownMacro:*
|
||||||
uselessAssignmentPtrArg:libltdl/loaders/preopen.c:201
|
|
||||||
deallocret:libltdl/lt__alloc.c:78
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user