summaryrefslogtreecommitdiff
path: root/src/blocked.c
diff options
context:
space:
mode:
authorMadelyn Olson <34459052+madolson@users.noreply.github.com>2021-03-15 22:00:29 -0700
committerGitHub <noreply@github.com>2021-03-15 22:00:29 -0700
commite1d98bca5a54bb71ff10a69337863d5543ad4373 (patch)
tree1426b7f688fef57f5ba103543bf5d1ebd02eedf7 /src/blocked.c
parentdba33a943d508bc5929db4950b4abadf6278ef02 (diff)
downloadredis-e1d98bca5a54bb71ff10a69337863d5543ad4373.tar.gz
Redact slowlog entries for config with sensitive data. (#8584)
Redact config set requirepass/masterauth/masteruser from slowlog in addition to showing ACL commands without sensitive values.
Diffstat (limited to 'src/blocked.c')
-rw-r--r--src/blocked.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/blocked.c b/src/blocked.c
index 09e17213c..2009c9a24 100644
--- a/src/blocked.c
+++ b/src/blocked.c
@@ -106,12 +106,20 @@ void blockClient(client *c, int btype) {
void updateStatsOnUnblock(client *c, long blocked_us, long reply_us){
const ustime_t total_cmd_duration = c->duration + blocked_us + reply_us;
c->lastcmd->microseconds += total_cmd_duration;
+
/* Log the command into the Slow log if needed. */
- if (!(c->lastcmd->flags & CMD_SKIP_SLOWLOG)) {
+ if (!(c->lastcmd->flags & CMD_SKIP_SLOWLOG) &&
+ !(c->flags & CLIENT_PREVENT_LOGGING))
+ {
slowlogPushEntryIfNeeded(c,c->argv,c->argc,total_cmd_duration);
/* Log the reply duration event. */
latencyAddSampleIfNeeded("command-unblocking",reply_us/1000);
}
+
+ /* Always clear the prevent logging field now. */
+ if (c->flags & CLIENT_PREVENT_LOGGING) {
+ c->flags &= ~CLIENT_PREVENT_LOGGING;
+ }
}
/* This function is called in the beforeSleep() function of the event loop