diff --git a/CHANGES b/CHANGES index 52e8458715..d9f845354b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +4073. [cleanup] Add libjson-c version number reporting to + "named -V"; normalize version number formatting. + [RT #38056] + 4072. [func] Add a --enable-querytrace configure switch for very verbose query tracelogging. [RT #37520] diff --git a/bin/named/main.c b/bin/named/main.c index 3b47537e36..fd6cdbe5f2 100644 --- a/bin/named/main.c +++ b/bin/named/main.c @@ -600,16 +600,16 @@ parse_command_line(int argc, char *argv[]) { ns_g_username = isc_commandline_argument; break; case 'v': - printf("%s %s", ns_g_product, ns_g_version); - if (*ns_g_description != 0) - printf(" %s", ns_g_description); - printf("\n"); + printf("%s %s%s%s \n", + ns_g_product, ns_g_version, + (*ns_g_description != '\0') ? " " : "", + ns_g_description, ns_g_srcid); exit(0); case 'V': - printf("%s %s", ns_g_product, ns_g_version); - if (*ns_g_description != 0) - printf(" %s", ns_g_description); - printf(" built by %s with %s\n", ns_g_srcid, + printf("%s %s%s%s \n", ns_g_product, ns_g_version, + (*ns_g_description != '\0') ? " " : "", + ns_g_description, ns_g_srcid); + printf("built by %s with %s\n", ns_g_builder, ns_g_configargs); #ifdef __clang__ printf("compiled by CLANG %s\n", __VERSION__); @@ -907,8 +907,10 @@ setup(void) { isc_result_totext(result)); isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, - ISC_LOG_NOTICE, "starting %s %s%s", ns_g_product, - ns_g_version, saved_command_line); + ISC_LOG_NOTICE, "starting %s %s%s%s %s", + ns_g_product, ns_g_version, + *ns_g_description ? " " : "", ns_g_description, + ns_g_srcid, saved_command_line); isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, ISC_LOG_NOTICE, "built with %s", ns_g_configargs); diff --git a/bin/named/server.c b/bin/named/server.c index 84b4067bf4..198e65aacb 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -7632,7 +7632,7 @@ ns_server_status(ns_server_t *server, isc_buffer_t *text) { n = snprintf((char *)isc_buffer_used(text), isc_buffer_availablelength(text), - "version: %s%s%s%s \n" + "version: %s %s%s%s %s%s%s\n" #ifdef ISC_PLATFORM_USETHREADS "CPUs found: %u\n" "worker threads: %u\n" @@ -7647,7 +7647,9 @@ ns_server_status(ns_server_t *server, isc_buffer_t *text) { "recursive clients: %d/%d/%d\n" "tcp clients: %d/%d\n" "server is up and running", - ns_g_version, ob, alt, cb, ns_g_srcid, + ns_g_product, ns_g_version, + (*ns_g_description != '\0') ? " " : "", + ns_g_description, ns_g_srcid, ob, alt, cb, #ifdef ISC_PLATFORM_USETHREADS ns_g_cpus_detected, ns_g_cpus, ns_g_udpdisp, #endif