Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
d26c9b53
Commit
d26c9b53
authored
Feb 07, 2019
by
antirez
Browse files
ACL: ACLLoadFromFile(), restore DefaultUser global.
parent
6a7545e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/acl.c
View file @
d26c9b53
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment