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
68fd4a97
Commit
68fd4a97
authored
Feb 04, 2019
by
antirez
Browse files
ACL: better error reporting in users configuration errors.
parent
b166c41e
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/config.c
View file @
68fd4a97
...
...
@@ -794,7 +794,11 @@ void loadServerConfigFromString(char *config) {
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"user"
)
&&
argc
>=
2
)
{
int
argc_err
;
if
(
ACLAppendUserForLoading
(
argv
,
argc
,
&
argc_err
)
==
C_ERR
)
{
err
=
"Syntax error in user declaration"
;
char
buf
[
1024
];
char
*
errmsg
=
ACLSetUserStringError
();
snprintf
(
buf
,
sizeof
(
buf
),
"Error in user declaration '%s': %s"
,
argv
[
argc_err
],
errmsg
);
err
=
buf
;
goto
loaderr
;
}
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"loadmodule"
)
&&
argc
>=
2
)
{
...
...
src/server.h
View file @
68fd4a97
...
...
@@ -1739,6 +1739,7 @@ int ACLSetUser(user *u, const char *op, ssize_t oplen);
sds
ACLDefaultUserFirstPassword
(
void
);
uint64_t
ACLGetCommandCategoryFlagByName
(
const
char
*
name
);
int
ACLAppendUserForLoading
(
sds
*
argv
,
int
argc
,
int
*
argc_err
);
char
*
ACLSetUserStringError
(
void
);
/* Sorted sets data type */
...
...
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