diff --git a/bin/named/server.c b/bin/named/server.c index 435be1ee0c..48c5aab8b9 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -3655,9 +3655,21 @@ register_one_plugin(const cfg_obj_t *config, const cfg_obj_t *obj, void *callback_data) { dns_view_t *view = callback_data; + char full_path[PATH_MAX]; isc_result_t result; - result = ns_plugin_register(plugin_path, parameters, config, + result = ns_plugin_expandpath(plugin_path, + full_path, sizeof(full_path)); + if (result != ISC_R_SUCCESS) { + isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, + NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR, + "%s: plugin configuration failed: " + "unable to get full plugin path: %s", + plugin_path, isc_result_totext(result)); + return (result); + } + + result = ns_plugin_register(full_path, parameters, config, cfg_obj_file(obj), cfg_obj_line(obj), named_g_mctx, named_g_lctx, named_g_aclconfctx, view); @@ -3665,7 +3677,7 @@ register_one_plugin(const cfg_obj_t *config, const cfg_obj_t *obj, isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR, "%s: plugin configuration failed: %s", - plugin_path, isc_result_totext(result)); + full_path, isc_result_totext(result)); } return (result); diff --git a/lib/bind9/check.c b/lib/bind9/check.c index 6f5f768484..215e767de0 100644 --- a/lib/bind9/check.c +++ b/lib/bind9/check.c @@ -3409,15 +3409,26 @@ check_one_plugin(const cfg_obj_t *config, const cfg_obj_t *obj, void *callback_data) { struct check_one_plugin_data *data = callback_data; + char full_path[PATH_MAX]; isc_result_t result; - result = ns_plugin_check(plugin_path, parameters, config, + result = ns_plugin_expandpath(plugin_path, + full_path, sizeof(full_path)); + if (result != ISC_R_SUCCESS) { + cfg_obj_log(obj, data->lctx, ISC_LOG_ERROR, + "%s: plugin check failed: " + "unable to get full plugin path: %s", + plugin_path, isc_result_totext(result)); + return (result); + } + + result = ns_plugin_check(full_path, parameters, config, cfg_obj_file(obj), cfg_obj_line(obj), data->mctx, data->lctx, data->actx); if (result != ISC_R_SUCCESS) { cfg_obj_log(obj, data->lctx, ISC_LOG_ERROR, "%s: plugin check failed: %s", - plugin_path, isc_result_totext(result)); + full_path, isc_result_totext(result)); *data->check_result = result; }