Commit d26c9b53 authored by antirez's avatar antirez
Browse files

ACL: ACLLoadFromFile(), restore DefaultUser global.

parent 6a7545e4
...@@ -1122,6 +1122,7 @@ sds ACLLoadFromFile(const char *filename) { ...@@ -1122,6 +1122,7 @@ sds ACLLoadFromFile(const char *filename) {
* so if there are errors loading the ACL file we can rollback to the * so if there are errors loading the ACL file we can rollback to the
* old version. */ * old version. */
rax *old_users = Users; rax *old_users = Users;
user *old_default_user = DefaultUser;
Users = raxNew(); Users = raxNew();
ACLInitDefaultUser(); ACLInitDefaultUser();
...@@ -1198,6 +1199,7 @@ sds ACLLoadFromFile(const char *filename) { ...@@ -1198,6 +1199,7 @@ sds ACLLoadFromFile(const char *filename) {
ACLFreeUser(fakeuser); ACLFreeUser(fakeuser);
sdsfreesplitres(lines,totlines); sdsfreesplitres(lines,totlines);
DefaultUser = old_default_user; /* This pointer must never change. */
/* Check if we found errors and react accordingly. */ /* Check if we found errors and react accordingly. */
if (sdslen(errors) == 0) { if (sdslen(errors) == 0) {
......
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