Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
d7a87d0e
Commit
d7a87d0e
authored
Dec 12, 2019
by
antirez
Browse files
redis-cli: some refactoring about not logging AUTH & co.
parent
81dc1803
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-cli.c
View file @
d7a87d0e
...
@@ -1946,11 +1946,19 @@ static void repl(void) {
...
@@ -1946,11 +1946,19 @@ static void repl(void) {
}
}
/* Won't save auth or acl setuser commands in history file */
/* Won't save auth or acl setuser commands in history file */
if
(
!
(
argv
&&
argc
>
0
&&
int dangerous = 0;
(
!
strcasecmp
(
argv
[
0
+
skipargs
],
"auth"
)
||
if (argv && argc > 0) {
(
skipargs
+
1
<
argc
&&
if (!strcasecmp(argv[skipargs], "auth")) {
!
strcasecmp
(
argv
[
0
+
skipargs
],
"acl"
)
&&
dangerous = 1;
!
strcasecmp
(
argv
[
0
+
skipargs
+
1
],
"setuser"
)))))
{
} else if (skipargs+1 < argc &&
!strcasecmp(argv[skipargs], "acl") &&
!strcasecmp(argv[skipargs+1], "setuser"))
{
dangerous = 1;
}
}
if (!dangerous) {
if (history) linenoiseHistoryAdd(line);
if (history) linenoiseHistoryAdd(line);
if (historyfile) linenoiseHistorySave(historyfile);
if (historyfile) linenoiseHistorySave(historyfile);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment