提交 d7a87d0e 编写于 作者: A antirez

redis-cli: some refactoring about not logging AUTH & co.

上级 81dc1803
......@@ -1946,11 +1946,19 @@ static void repl(void) {
}
/* 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"))))) {
int dangerous = 0;
if (argv && argc > 0) {
if (!strcasecmp(argv[skipargs], "auth")) {
dangerous = 1;
} else if (skipargs+1 < argc &&
!strcasecmp(argv[skipargs], "acl") &&
!strcasecmp(argv[skipargs+1], "setuser"))
{
dangerous = 1;
}
}
if (!dangerous) {
if (history) linenoiseHistoryAdd(line);
if (historyfile) linenoiseHistorySave(historyfile);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册