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
82790e51
Commit
82790e51
authored
Jan 30, 2020
by
antirez
Browse files
ACL LOG: also log ACL errors in the scripting/MULTI ctx.
parent
943008eb
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/multi.c
View file @
82790e51
...
@@ -177,8 +177,10 @@ void execCommand(client *c) {
...
@@ -177,8 +177,10 @@ void execCommand(client *c) {
must_propagate
=
1
;
must_propagate
=
1
;
}
}
int
acl_retval
=
ACLCheckCommandPerm
(
c
,
NULL
);
int
acl_keypos
;
int
acl_retval
=
ACLCheckCommandPerm
(
c
,
&
acl_keypos
);
if
(
acl_retval
!=
ACL_OK
)
{
if
(
acl_retval
!=
ACL_OK
)
{
addACLLogEntry
(
c
,
acl_retval
,
acl_keypos
);
addReplyErrorFormat
(
c
,
addReplyErrorFormat
(
c
,
"-NOPERM ACLs rules changed between the moment the "
"-NOPERM ACLs rules changed between the moment the "
"transaction was accumulated and the EXEC call. "
"transaction was accumulated and the EXEC call. "
...
...
src/scripting.c
View file @
82790e51
...
@@ -606,8 +606,10 @@ int luaRedisGenericCommand(lua_State *lua, int raise_error) {
...
@@ -606,8 +606,10 @@ int luaRedisGenericCommand(lua_State *lua, int raise_error) {
}
}
/* Check the ACLs. */
/* Check the ACLs. */
int
acl_retval
=
ACLCheckCommandPerm
(
c
,
NULL
);
int
acl_keypos
;
int
acl_retval
=
ACLCheckCommandPerm
(
c
,
&
acl_keypos
);
if
(
acl_retval
!=
ACL_OK
)
{
if
(
acl_retval
!=
ACL_OK
)
{
addACLLogEntry
(
c
,
acl_retval
,
acl_keypos
);
if
(
acl_retval
==
ACL_DENIED_CMD
)
if
(
acl_retval
==
ACL_DENIED_CMD
)
luaPushError
(
lua
,
"The user executing the script can't run this "
luaPushError
(
lua
,
"The user executing the script can't run this "
"command or subcommand"
);
"command or subcommand"
);
...
...
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