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
389c5e14
Commit
389c5e14
authored
Oct 26, 2021
by
Wen Hui
Committed by
Oran Agra
Dec 12, 2022
Browse files
Sentinel: don't log auth-pass value for better security (#9652)
(cherry picked from commit
43b22f17
)
parent
64c657a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/sentinel.c
View file @
389c5e14
...
...
@@ -4024,6 +4024,7 @@ void sentinelSetCommand(client *c) {
int j, changes = 0;
int badarg = 0; /* Bad argument position for error reporting. */
char *option;
int redacted;
if ((ri = sentinelGetMasterByNameOrReplyError(c,c->argv[2]))
== NULL) return;
...
...
@@ -4034,6 +4035,7 @@ void sentinelSetCommand(client *c) {
option = c->argv[j]->ptr;
long long ll;
int old_j = j; /* Used to know what to log as an event. */
redacted = 0;
if (!strcasecmp(option,"down-after-milliseconds") && moreargs > 0) {
/* down-after-millisecodns <milliseconds> */
...
...
@@ -4108,6 +4110,7 @@ void sentinelSetCommand(client *c) {
sdsfree(ri->auth_pass);
ri->auth_pass = strlen(value) ? sdsnew(value) : NULL;
changes++;
redacted = 1;
} else if (!strcasecmp(option,"auth-user") && moreargs > 0) {
/* auth-user <username> */
char *value = c->argv[++j]->ptr;
...
...
@@ -4155,7 +4158,7 @@ void sentinelSetCommand(client *c) {
switch(numargs) {
case 2:
sentinelEvent(LL_WARNING,"+set",ri,"%@ %s %s",(char*)c->argv[old_j]->ptr,
(
char
*
)
c
->
argv
[
old_j
+
1
]
->
ptr
);
redacted ? "******" :
(char*)c->argv[old_j+1]->ptr);
break;
case 3:
sentinelEvent(LL_WARNING,"+set",ri,"%@ %s %s %s",(char*)c->argv[old_j]->ptr,
...
...
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