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

Bugfix in ACLCheckCommandPerm
This commit is contained in:
Salvatore Sanfilippo 2019-01-25 13:00:17 +01:00 committed by GitHub
commit 1aa9fa37e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -555,7 +555,7 @@ int ACLCheckCommandPerm(client *c) {
for (int j = 0; j < numkeys; j++) {
listIter li;
listNode *ln;
listRewind(u->passwords,&li);
listRewind(u->patterns,&li);
/* Test this key against every pattern. */
int match = 0;
@ -570,9 +570,12 @@ int ACLCheckCommandPerm(client *c) {
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