Commit 2e7ec854 authored by Evan Hunt's avatar Evan Hunt Committed by Mark Andrews

construct the rndc.conf path from rndc.key

parent 43ae6c62
......@@ -447,6 +447,8 @@ set_flags(const char *arg, struct flag_def *defs, unsigned int *ret) {
static void
printversion(bool verbose) {
char rndcconf[PATH_MAX], *dot = NULL;
printf("%s %s%s%s <id:%s>\n",
named_g_product, named_g_version,
(*named_g_description != '\0') ? " " : "",
......@@ -507,12 +509,27 @@ OPENSSL_VERSION_NUMBER >= 0x10100000L /* 1.1.0 or higher */
#endif
printf("threads support is enabled\n\n");
/*
* The default rndc.conf and rndc.key paths are in the same
* directory, but named only has rndc.key defined internally.
* We construct the rndc.conf path from it. (We could use
* NAMED_SYSCONFDIR here but the result would look wrong on
* Windows.)
*/
strlcpy(rndcconf, named_g_keyfile, sizeof(rndcconf));
dot = strrchr(rndcconf, '.');
if (dot != NULL) {
size_t len = dot - rndcconf + 1;
snprintf(dot + 1, PATH_MAX - len, "conf");
}
/*
* Print default configuration paths.
*/
printf("default paths:\n");
printf(" named configuration: %s\n", named_g_conffile);
printf(" rndc configuration: %s/rndc.conf\n", NAMED_SYSCONFDIR);
printf(" rndc configuration: %s\n", rndcconf);
printf(" DNSSEC root key: %s\n", named_g_defaultbindkeys);
printf(" nsupdate session key: %s\n", named_g_defaultsessionkeyfile);
printf(" named PID file: %s\n", named_g_defaultpidfile);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment