From d55dc2ac560e18b0e101995707be336ddf52c6d7 Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Sun, 31 Oct 1999 19:30:16 +0000 Subject: [PATCH] implement directory option --- bin/named/server.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bin/named/server.c b/bin/named/server.c index bd8ef459b2..de7e847832 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -327,6 +328,19 @@ load_configuration(const char *filename) { dns_view_attach(version_view, &view); ISC_LIST_APPEND(lctx.viewlist, view, link); + /* + * Change directory. + */ + if (configctx->options != NULL && + configctx->options->directory != NULL) { + result = isc_dir_chdir(configctx->options->directory); + if (result != ISC_R_SUCCESS) + ns_server_fatal(NS_LOGMODULE_SERVER, ISC_FALSE, + "change directory to '%s' failed: %s", + configctx->options->directory, + isc_result_totext(result)); + } + /* * Load zones. */