Merge pull request #6524 from itamarhaber/acl-cli

Omits  `ACL SETUSER` from redis-cli's history
This commit is contained in:
Salvatore Sanfilippo 2019-12-12 09:33:48 +01:00 committed by GitHub
commit 81dc180323
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}