XREAD and XREADGROUP should not be allowed from scripts when BLOCK option is being used

This commit is contained in:
Valentino Geron
2020-03-26 11:49:21 +02:00
parent c4d7f30e25
commit 9a1843ef2d
3 changed files with 18 additions and 2 deletions

View File

@ -1373,6 +1373,11 @@ void xreadCommand(client *c) {
int moreargs = c->argc-i-1;
char *o = c->argv[i]->ptr;
if (!strcasecmp(o,"BLOCK") && moreargs) {
if (c->flags & CLIENT_LUA) {
/* There is no sense to use BLOCK option within LUA */
addReplyErrorFormat(c, "%s command is not allowed with BLOCK option from scripts", (char *)c->argv[0]->ptr);
return;
}
i++;
if (getTimeoutFromObjectOrReply(c,c->argv[i],&timeout,
UNIT_MILLISECONDS) != C_OK) return;