mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 08:08:53 -05:00
passwords printed in the crash log (#11930)
When the server crashes during the AUTH command, or another command with an AUTH argument, the password was recorded in the log. Now, when the `auth` keyword is detected (could be in HELLO or MIGRATE, etc), the loop exits before printing any additional arguments.
This commit is contained in:
parent
6cf8fc08f5
commit
56eef6fb5a
@ -1859,11 +1859,17 @@ void logCurrentClient(client *cc, const char *title) {
|
||||
client = catClientInfoString(sdsempty(),cc);
|
||||
serverLog(LL_WARNING|LL_RAW,"%s\n", client);
|
||||
sdsfree(client);
|
||||
serverLog(LL_WARNING|LL_RAW,"argc: '%d'\n", cc->argc);
|
||||
for (j = 0; j < cc->argc; j++) {
|
||||
robj *decoded;
|
||||
decoded = getDecodedObject(cc->argv[j]);
|
||||
sds repr = sdscatrepr(sdsempty(),decoded->ptr, min(sdslen(decoded->ptr), 128));
|
||||
serverLog(LL_WARNING|LL_RAW,"argv[%d]: '%s'\n", j, (char*)repr);
|
||||
if (!strcasecmp(decoded->ptr, "auth") || !strcasecmp(decoded->ptr, "auth2")) {
|
||||
sdsfree(repr);
|
||||
decrRefCount(decoded);
|
||||
break;
|
||||
}
|
||||
sdsfree(repr);
|
||||
decrRefCount(decoded);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user