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
cbed35ef
Commit
cbed35ef
authored
Feb 07, 2019
by
antirez
Browse files
ACL: add assertion and fix comment typo.
parent
7a86ba22
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/acl.c
View file @
cbed35ef
...
@@ -1199,12 +1199,13 @@ sds ACLLoadFromFile(const char *filename) {
...
@@ -1199,12 +1199,13 @@ sds ACLLoadFromFile(const char *filename) {
ACLFreeUser
(
fakeuser
);
ACLFreeUser
(
fakeuser
);
sdsfreesplitres
(
lines
,
totlines
);
sdsfreesplitres
(
lines
,
totlines
);
/* Chec if we found errors and react accordingly. */
/* Chec
k
if we found errors and react accordingly. */
if
(
sdslen
(
errors
)
==
0
)
{
if
(
sdslen
(
errors
)
==
0
)
{
/* The default user pointer is referenced in different places: instead
/* The default user pointer is referenced in different places: instead
* of replacing such occurrences it is much simpler to copy the new
* of replacing such occurrences it is much simpler to copy the new
* default user configuration in the old one. */
* default user configuration in the old one. */
user
*
new
=
ACLGetUserByName
(
"default"
,
7
);
user
*
new
=
ACLGetUserByName
(
"default"
,
7
);
serverAssert
(
new
!=
NULL
);
ACLCopyUser
(
DefaultUser
,
new
);
ACLCopyUser
(
DefaultUser
,
new
);
ACLFreeUser
(
new
);
ACLFreeUser
(
new
);
raxInsert
(
Users
,(
unsigned
char
*
)
"default"
,
7
,
DefaultUser
,
NULL
);
raxInsert
(
Users
,(
unsigned
char
*
)
"default"
,
7
,
DefaultUser
,
NULL
);
...
...
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