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
43b22f17
Unverified
Commit
43b22f17
authored
Oct 26, 2021
by
Wen Hui
Committed by
GitHub
Oct 26, 2021
Browse files
Sentinel: don't log auth-pass value for better security (#9652)
parent
37559ca7
Changes
1
Show whitespace changes
Inline
Side-by-side
src/sentinel.c
View file @
43b22f17
...
@@ -4156,6 +4156,7 @@ void sentinelSetCommand(client *c) {
...
@@ -4156,6 +4156,7 @@ void sentinelSetCommand(client *c) {
int j, changes = 0;
int j, changes = 0;
int badarg = 0; /* Bad argument position for error reporting. */
int badarg = 0; /* Bad argument position for error reporting. */
char *option;
char *option;
int redacted;
if ((ri = sentinelGetMasterByNameOrReplyError(c,c->argv[2]))
if ((ri = sentinelGetMasterByNameOrReplyError(c,c->argv[2]))
== NULL) return;
== NULL) return;
...
@@ -4166,6 +4167,7 @@ void sentinelSetCommand(client *c) {
...
@@ -4166,6 +4167,7 @@ void sentinelSetCommand(client *c) {
option = c->argv[j]->ptr;
option = c->argv[j]->ptr;
long long ll;
long long ll;
int old_j = j; /* Used to know what to log as an event. */
int old_j = j; /* Used to know what to log as an event. */
redacted = 0;
if (!strcasecmp(option,"down-after-milliseconds") && moreargs > 0) {
if (!strcasecmp(option,"down-after-milliseconds") && moreargs > 0) {
/* down-after-milliseconds <milliseconds> */
/* down-after-milliseconds <milliseconds> */
...
@@ -4240,6 +4242,7 @@ void sentinelSetCommand(client *c) {
...
@@ -4240,6 +4242,7 @@ void sentinelSetCommand(client *c) {
sdsfree(ri->auth_pass);
sdsfree(ri->auth_pass);
ri->auth_pass = strlen(value) ? sdsnew(value) : NULL;
ri->auth_pass = strlen(value) ? sdsnew(value) : NULL;
changes++;
changes++;
redacted = 1;
} else if (!strcasecmp(option,"auth-user") && moreargs > 0) {
} else if (!strcasecmp(option,"auth-user") && moreargs > 0) {
/* auth-user <username> */
/* auth-user <username> */
char *value = c->argv[++j]->ptr;
char *value = c->argv[++j]->ptr;
...
@@ -4287,7 +4290,7 @@ void sentinelSetCommand(client *c) {
...
@@ -4287,7 +4290,7 @@ void sentinelSetCommand(client *c) {
switch(numargs) {
switch(numargs) {
case 2:
case 2:
sentinelEvent(LL_WARNING,"+set",ri,"%@ %s %s",(char*)c->argv[old_j]->ptr,
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;
break;
case 3:
case 3:
sentinelEvent(LL_WARNING,"+set",ri,"%@ %s %s %s",(char*)c->argv[old_j]->ptr,
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