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') ? " " : "",
#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);