summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShaya Potter <shaya@redislabs.com>2023-03-20 08:04:13 +0200
committerGitHub <noreply@github.com>2023-03-20 08:04:13 +0200
commit6cf8fc08f59cd34cfcf364ab6a233f100611078c (patch)
treeb496e35be3d0fb18e50557f8244274d367c99f56 /src
parentbbf364a442b463f3cf0d310ad052727de68a493a (diff)
downloadredis-6cf8fc08f59cd34cfcf364ab6a233f100611078c.tar.gz
Don't run command filter on blocked command reprocessing (#11895)
Previously we would run the module command filters even upon blocked command reprocessing. This could modify the command, and it's args. This is irrelevant in the context of a command being reprocessed (it already went through the filters), as well as breaks the crashed command lookup that exists in the case of a reprocessed command. fixes #11894. Co-authored-by: Oran Agra <oran@redislabs.com>
Diffstat (limited to 'src')
-rw-r--r--src/server.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/server.c b/src/server.c
index 0990ff7fa..4e77d2f6d 100644
--- a/src/server.c
+++ b/src/server.c
@@ -3813,14 +3813,15 @@ int processCommand(client *c) {
serverAssert(!scriptIsRunning());
}
- moduleCallCommandFilters(c);
-
/* in case we are starting to ProcessCommand and we already have a command we assume
* this is a reprocessing of this command, so we do not want to perform some of the actions again. */
int client_reprocessing_command = c->cmd ? 1 : 0;
- if (!client_reprocessing_command)
+ /* only run command filter if not reprocessing command */
+ if (!client_reprocessing_command) {
+ moduleCallCommandFilters(c);
reqresAppendRequest(c);
+ }
/* Handle possible security attacks. */
if (!strcasecmp(c->argv[0]->ptr,"host:") || !strcasecmp(c->argv[0]->ptr,"post")) {