ACL: ACLLoadFromFile(), restore DefaultUser global.
This commit is contained in:
parent
6a7545e4d4
commit
d26c9b5307
@ -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) {
|
|||||||
|
|
||||||
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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user