From 50dd7e95c8c9c20994d2d6b64c3ab25177aa095e Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 30 Nov 2022 17:47:08 +0100 Subject: [PATCH] CLEANUP: anon: clarify the help message on "debug dev hash" This command is used to hash a section name using the current anon key, it was brought in 2.7 by commit 54966dffd ("MINOR: anon: store the anonymizing key in the CLI's appctx"). However the help message only says "return msg hashed" which is misleading because if anon mode is not enabled, it returns the string as-is. Let's just mention this condition in the help message, and also fix the alphabetical ordering and alignment on the line. --- src/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/debug.c b/src/debug.c index 88cd2fead..7187cef4c 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1629,6 +1629,7 @@ static struct cli_kw_list cli_kws = {{ },{ #endif {{ "debug", "dev", "fd", NULL }, "debug dev fd : scan for rogue/unhandled FDs", debug_parse_cli_fd, debug_iohandler_fd, NULL, NULL, ACCESS_EXPERT }, {{ "debug", "dev", "exit", NULL }, "debug dev exit [code] : immediately exit the process", debug_parse_cli_exit, NULL, NULL, NULL, ACCESS_EXPERT }, + {{ "debug", "dev", "hash", NULL }, "debug dev hash [msg] : return msg hashed if anon is set", debug_parse_cli_hash, NULL, NULL, NULL, ACCESS_EXPERT }, {{ "debug", "dev", "hex", NULL }, "debug dev hex [len] : dump a memory area", debug_parse_cli_hex, NULL, NULL, NULL, ACCESS_EXPERT }, {{ "debug", "dev", "log", NULL }, "debug dev log [msg] ... : send this msg to global logs", debug_parse_cli_log, NULL, NULL, NULL, ACCESS_EXPERT }, {{ "debug", "dev", "loop", NULL }, "debug dev loop [ms] : loop this long", debug_parse_cli_loop, NULL, NULL, NULL, ACCESS_EXPERT }, @@ -1642,7 +1643,6 @@ static struct cli_kw_list cli_kws = {{ },{ {{ "debug", "dev", "tkill", NULL }, "debug dev tkill [thr] [sig] : send signal to thread", debug_parse_cli_tkill, NULL, NULL, NULL, ACCESS_EXPERT }, {{ "debug", "dev", "warn", NULL }, "debug dev warn : call WARN_ON() and possibly crash", debug_parse_cli_warn, NULL, NULL, NULL, ACCESS_EXPERT }, {{ "debug", "dev", "write", NULL }, "debug dev write [size] : write that many bytes in return", debug_parse_cli_write, NULL, NULL, NULL, ACCESS_EXPERT }, - {{ "debug", "dev", "hash", NULL }, "debug dev hash [msg] : return msg hashed", debug_parse_cli_hash, NULL, NULL, NULL, ACCESS_EXPERT }, #if defined(HA_HAVE_DUMP_LIBS) {{ "show", "libs", NULL, NULL }, "show libs : show loaded object files and libraries", debug_parse_cli_show_libs, NULL, NULL },