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
21aabab4
Unverified
Commit
21aabab4
authored
Mar 01, 2022
by
Harkrishn Patro
Committed by
GitHub
Feb 28, 2022
Browse files
Fix acl dryrun to return the tested common permission error. (#10359)
parent
dff153ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/acl.c
View file @
21aabab4
...
...
@@ -2799,7 +2799,7 @@ setuser_cleanup:
sds
err
=
sdsempty
();
if
(
result
==
ACL_DENIED_CMD
)
{
err
=
sdscatfmt
(
err
,
"This user has no permissions to run "
"the '%s' command"
,
c
->
cmd
->
fullname
);
"the '%s' command"
,
cmd
->
fullname
);
}
else
if
(
result
==
ACL_DENIED_KEY
)
{
err
=
sdscatfmt
(
err
,
"This user has no permissions to access "
"the '%s' key"
,
c
->
argv
[
idx
+
3
]
->
ptr
);
...
...
tests/unit/acl-v2.tcl
View file @
21aabab4
...
...
@@ -305,6 +305,12 @@ start_server {tags {"acl external:skip"}} {
assert_equal
"ERR Command 'not-a-command' not found"
$e
}
test
{
Test various commands for command permissions
}
{
r ACL setuser command-test -@all
assert_equal
"This user has no permissions to run the 'set' command"
[
r ACL DRYRUN command-test set somekey somevalue
]
assert_equal
"This user has no permissions to run the 'get' command"
[
r ACL DRYRUN command-test get somekey
]
}
test
{
Test various odd commands for key permissions
}
{
r ACL setuser command-test +@all %R~read* %W~write* %RW~rw*
...
...
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