summaryrefslogtreecommitdiff
path: root/src/acl.c
diff options
context:
space:
mode:
authorHarkrishn Patro <30795839+hpatro@users.noreply.github.com>2021-04-19 12:27:44 +0200
committerGitHub <noreply@github.com>2021-04-19 13:27:44 +0300
commit7a3d1487e443c3cb5fde3605aebea20698a940b4 (patch)
tree60c164c5e23b797b2084857fc9000773274a9ecb /src/acl.c
parent3a955d9ad443adcb1d0495f4b702612f6b250f6e (diff)
downloadredis-7a3d1487e443c3cb5fde3605aebea20698a940b4.tar.gz
ACL channels permission handling for save/load scenario. (#8794)
In the initial release of Redis 6.2 setting a user to only allow pubsub access to a specific channel, and doing ACL SAVE, resulted in an assertion when ACL LOAD was used. This was later changed by #8723 (not yet released), but still not properly resolved (now it errors instead of crash). The problem is that the server that generates an ACL file, doesn't know what would be the setting of the acl-pubsub-default config in the server that will load it. so ACL SAVE needs to always start with resetchannels directive. This should still be compatible with old acl files (from redis 6.0), and ones from earlier versions of 6.2 that didn't mess with channels. Co-authored-by: Harkrishn Patro <harkrisp@amazon.com> Co-authored-by: Oran Agra <oran@redislabs.com>
Diffstat (limited to 'src/acl.c')
-rw-r--r--src/acl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/acl.c b/src/acl.c
index 6f8ab4055..6a2ade646 100644
--- a/src/acl.c
+++ b/src/acl.c
@@ -652,6 +652,7 @@ sds ACLDescribeUser(user *u) {
if (u->flags & USER_FLAG_ALLCHANNELS) {
res = sdscatlen(res,"&* ",3);
} else {
+ res = sdscatlen(res,"resetchannels ",14);
listRewind(u->channels,&li);
while((ln = listNext(&li))) {
sds thispat = listNodeValue(ln);