-
Notifications
You must be signed in to change notification settings - Fork 714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ACL regression with renamed commands #1651
Fix ACL regression with renamed commands #1651
Conversation
…renamed Signed-off-by: Rain Valentine <[email protected]>
…y, deleted dead code Signed-off-by: Rain Valentine <[email protected]>
Signed-off-by: Rain Valentine <[email protected]>
Signed-off-by: Rain Valentine <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #1651 +/- ##
============================================
+ Coverage 70.98% 71.03% +0.04%
============================================
Files 121 121
Lines 65176 65203 +27
============================================
+ Hits 46264 46315 +51
+ Misses 18912 18888 -24
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks for finding and fixing this before the release!
Signed-off-by: Rain Valentine <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, LGTM! (I looked at the test cases a bit more this time and added two nits.)
Signed-off-by: Viktor Söderqvist <[email protected]>
This regression occurred when we converted the command tables from dict to hashtable. For both server.commands and server.orig_commands pointed to the same struct and used the same field as a key. When a command is renamed it changed this key without updating server.orig_commands, causing it to be unable to find any renamed command.
server.orig_commands is used by ACLs which are always configured and manipulated using the original command names. For example,
-config
should always remove permission to use theconfig
command, even if its been renamed toasdfconfig
.I added a tcl test which passes before the command table conversion, breaks after the conversion, and passes again with this fix.
Changes in acl.c are only for code cleanup and not necessary for the fix:
static
to methods (clarifies scope/use, aids compiler optimization)goto
tobreak
🤷🏻♀️