mirror of
https://github.com/fluencelabs/redis
synced 2025-04-01 15:21:03 +00:00
ACL: implement keys field in ACL GETUSER.
This commit is contained in:
parent
f021da5e30
commit
77471dfe86
18
src/acl.c
18
src/acl.c
@ -850,7 +850,7 @@ void aclCommand(client *c) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
addReplyMapLen(c,3);
|
addReplyMapLen(c,4);
|
||||||
|
|
||||||
/* Flags */
|
/* Flags */
|
||||||
addReplyBulkCString(c,"flags");
|
addReplyBulkCString(c,"flags");
|
||||||
@ -892,6 +892,22 @@ void aclCommand(client *c) {
|
|||||||
addReplyBulkCString(c,"commands");
|
addReplyBulkCString(c,"commands");
|
||||||
sds cmddescr = ACLDescribeUserCommandRules(u);
|
sds cmddescr = ACLDescribeUserCommandRules(u);
|
||||||
addReplyBulkSds(c,cmddescr);
|
addReplyBulkSds(c,cmddescr);
|
||||||
|
|
||||||
|
/* Key patterns */
|
||||||
|
addReplyBulkCString(c,"keys");
|
||||||
|
if (u->flags & USER_FLAG_ALLKEYS) {
|
||||||
|
addReplyArrayLen(c,1);
|
||||||
|
addReplyBulkCBuffer(c,"*",1);
|
||||||
|
} else {
|
||||||
|
addReplyArrayLen(c,listLength(u->patterns));
|
||||||
|
listIter li;
|
||||||
|
listNode *ln;
|
||||||
|
listRewind(u->patterns,&li);
|
||||||
|
while((ln = listNext(&li))) {
|
||||||
|
sds thispat = listNodeValue(ln);
|
||||||
|
addReplyBulkCBuffer(c,thispat,sdslen(thispat));
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (!strcasecmp(sub,"help")) {
|
} else if (!strcasecmp(sub,"help")) {
|
||||||
const char *help[] = {
|
const char *help[] = {
|
||||||
"LIST -- List all the registered users.",
|
"LIST -- List all the registered users.",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user