mds: misc fixes for MDSAuthCaps code#54381
Merged
rishabh-d-dave merged 3 commits intoceph:mainfrom Jan 16, 2024
Merged
Conversation
923035b to
9683110
Compare
Once the caller_gid is matched it will make no sense to do the following caller gid list check. Signed-off-by: Xiubo Li <xiubli@redhat.com>
aab6cef to
b756d3a
Compare
kotreshhr
reviewed
Nov 8, 2023
b756d3a to
95ec78e
Compare
Contributor
There was a problem hiding this comment.
Is there a chance you could add unit tests for the match_path function that verifies that it works correctly?
Member
Author
|
The test result: |
Just in case the 'target_path' is tailed with '/' it may fail to match the 'path', such as in case 'path=/foo/' and 'target_path=/foo' it will fail. Just try to remove the tailing '/' from 'target_path' and then also we can simplify the code to make it more readable. Signed-off-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Xiubo Li <xiubli@redhat.com>
a97ad13 to
516b099
Compare
rishabh-d-dave
approved these changes
Jan 15, 2024
| * path=/foo _path=/foo target_path=/foo --> match | ||
| * path=/foo/ _path=/foo target_path=/foo --> match | ||
| * | ||
| * In case target_path.find(_path) == 0 && target_path.length() > _path.length(): |
Contributor
There was a problem hiding this comment.
same nit: will be nice to be explicit and wrap at/before 79 characters.
Suggested change
| * In case target_path.find(_path) == 0 && target_path.length() > _path.length(): | |
| * Or when, instead, following condition is true - | |
| * target_path.find(_path) == 0 && target_path.length() > _path.length(): |
rishabh-d-dave
approved these changes
Jan 16, 2024
Contributor
rishabh-d-dave
left a comment
There was a problem hiding this comment.
Testing was successful - https://tracker.ceph.com/projects/cephfs/wiki/Main#16-Jan-2023
This was referenced Oct 9, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Once the caller_gid is matched it will make no sense to do the following caller gid list check.
https://tracker.ceph.com/issues/68453
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windows