From d6d5406c180164a7e6f17fbc2baf7aef3099c95f Mon Sep 17 00:00:00 2001 From: Itamar Haber Date: Thu, 31 Oct 2019 15:45:52 +0200 Subject: [PATCH] Ommits from redis-cli's history --- src/redis-cli.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/redis-cli.c b/src/redis-cli.c index c67663c23..b421344fa 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -1945,8 +1945,12 @@ static void repl(void) { } } - /* Won't save auth command in history file */ - if (!(argv && argc > 0 && !strcasecmp(argv[0+skipargs], "auth"))) { + /* Won't save auth or acl setuser commands in history file */ + if (!(argv && argc > 0 && + (!strcasecmp(argv[0+skipargs], "auth") || + (skipargs + 1 < argc && + !strcasecmp(argv[0+skipargs], "acl") && + !strcasecmp(argv[0+skipargs+1], "setuser"))))) { if (history) linenoiseHistoryAdd(line); if (historyfile) linenoiseHistorySave(historyfile); }