ACL: setuser reset implemented.

This commit is contained in:
antirez 2019-01-21 18:21:02 +01:00
parent 9e5c38282b
commit 8dfeb4fba1

View File

@ -342,6 +342,11 @@ int ACLSetUser(user *u, const char *op, ssize_t oplen) {
ACLSetUserCommandBit(u,id,0);
u->flags &= ~USER_FLAG_ALLCOMMANDS;
ACLResetSubcommandsForCommand(u,id);
} else if (!strcasecmp(op,"reset")) {
serverAssert(ACLSetUser(u,"resetpass",-1) == C_OK);
serverAssert(ACLSetUser(u,"resetkeys",-1) == C_OK);
serverAssert(ACLSetUser(u,"off",-1) == C_OK);
serverAssert(ACLSetUser(u,"-@all",-1) == C_OK);
} else {
errno = EINVAL;
return C_ERR;