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
b70d81f6
Unverified
Commit
b70d81f6
authored
Mar 11, 2021
by
Harkrishn Patro
Committed by
GitHub
Mar 10, 2021
Browse files
Process hello command even if the default user has no permissions. (#8633)
Co-authored-by:
Harkrishn Patro
<
harkrisp@amazon.com
>
parent
c945e112
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/acl.c
View file @
b70d81f6
...
@@ -1180,9 +1180,9 @@ int ACLCheckCommandPerm(client *c, int *keyidxptr) {
...
@@ -1180,9 +1180,9 @@ int ACLCheckCommandPerm(client *c, int *keyidxptr) {
/* If there is no associated user, the connection can run anything. */
/* If there is no associated user, the connection can run anything. */
if
(
u
==
NULL
)
return
ACL_OK
;
if
(
u
==
NULL
)
return
ACL_OK
;
/* Check if the user can execute this command
. */
/* Check if the user can execute this command
or if the command
if
(
!
(
u
->
flags
&
USER_FLAG_ALLCOMMANDS
)
&&
* doesn't need to be authenticated (hello, auth). */
c
->
cmd
->
proc
!=
authCommand
)
if
(
!
(
u
->
flags
&
USER_FLAG_ALLCOMMANDS
)
&&
!
(
c
->
cmd
->
flags
&
CMD_NO_AUTH
)
)
{
{
/* If the bit is not set we have to check further, in case the
/* If the bit is not set we have to check further, in case the
* command is allowed just with that specific subcommand. */
* command is allowed just with that specific subcommand. */
...
...
tests/unit/acl.tcl
View file @
b70d81f6
...
@@ -409,6 +409,14 @@ start_server {tags {"acl"}} {
...
@@ -409,6 +409,14 @@ start_server {tags {"acl"}} {
set e
set e
}
{
*NOAUTH*
}
}
{
*NOAUTH*
}
test
{
When default user has no command permission, hello command still works for other users
}
{
r ACL setuser secure-user >supass on +@all
r ACL setuser default -@all
r HELLO 2 AUTH secure-user supass
r ACL setuser default nopass +@all
r AUTH default
""
}
test
{
ACL HELP should not have unexpected options
}
{
test
{
ACL HELP should not have unexpected options
}
{
catch
{
r ACL help xxx
}
e
catch
{
r ACL help xxx
}
e
assert_match
"*Unknown subcommand or wrong number of arguments*"
$e
assert_match
"*Unknown subcommand or wrong number of arguments*"
$e
...
...
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