From d26c9b5307843fd163fca0e4bd2171ede1c8effc Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 7 Feb 2019 17:00:35 +0100 Subject: [PATCH] ACL: ACLLoadFromFile(), restore DefaultUser global. --- src/acl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/acl.c b/src/acl.c index b17036df7..4ab660e9f 100644 --- a/src/acl.c +++ b/src/acl.c @@ -1122,6 +1122,7 @@ sds ACLLoadFromFile(const char *filename) { * so if there are errors loading the ACL file we can rollback to the * old version. */ rax *old_users = Users; + user *old_default_user = DefaultUser; Users = raxNew(); ACLInitDefaultUser(); @@ -1198,6 +1199,7 @@ sds ACLLoadFromFile(const char *filename) { ACLFreeUser(fakeuser); sdsfreesplitres(lines,totlines); + DefaultUser = old_default_user; /* This pointer must never change. */ /* Check if we found errors and react accordingly. */ if (sdslen(errors) == 0) {