Unverified Commit 1aa9fa37 authored by Salvatore Sanfilippo's avatar Salvatore Sanfilippo Committed by GitHub
Browse files

Merge pull request #5806 from soloestoy/bugfix-acl-check-key-pattern

Bugfix in ACLCheckCommandPerm
parents 5cc3b557 0de83bcc
...@@ -555,7 +555,7 @@ int ACLCheckCommandPerm(client *c) { ...@@ -555,7 +555,7 @@ int ACLCheckCommandPerm(client *c) {
for (int j = 0; j < numkeys; j++) { for (int j = 0; j < numkeys; j++) {
listIter li; listIter li;
listNode *ln; listNode *ln;
listRewind(u->passwords,&li); listRewind(u->patterns,&li);
/* Test this key against every pattern. */ /* Test this key against every pattern. */
int match = 0; int match = 0;
...@@ -570,9 +570,12 @@ int ACLCheckCommandPerm(client *c) { ...@@ -570,9 +570,12 @@ int ACLCheckCommandPerm(client *c) {
break; break;
} }
} }
if (!match) return ACL_DENIED_KEY; if (!match) {
getKeysFreeResult(keyidx);
return ACL_DENIED_KEY;
}
} }
getKeysFreeResult(keyidx); if (keyidx) getKeysFreeResult(keyidx);
} }
/* If we survived all the above checks, the user can execute the /* If we survived all the above checks, the user can execute the
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment