Skip to content
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

Plugins: Fix file permissions check to always use the correct path #17340

Merged
merged 4 commits into from
Sep 30, 2022

Conversation

tomhjp
Copy link
Contributor

@tomhjp tomhjp commented Sep 28, 2022

Previously, there was a bug where the wrong path would be checked during the mount operation because we just pulled the plugin name from the config (but not during registration, because it correctly used the command input at that point). The plugin name often matches the binary name, but not necessarily, and it will match the name less often once people start using versioned plugins if they want two versions of the same plugin to co-exist in the plugin directory.

I've committed the test first, so hopefully that should show an error which gets fixed by the second commit once the CI finishes.

@tomhjp tomhjp added bug Used to indicate a potential bug core/plugin labels Sep 28, 2022
@tomhjp tomhjp requested review from akshya96 and a team September 28, 2022 12:18
@tomhjp tomhjp force-pushed the plugin-permissions-check-fix branch from 1914da5 to 6ad58d3 Compare September 28, 2022 16:00
@tomhjp tomhjp requested a review from swenson September 28, 2022 16:00
vault/plugin_catalog.go Outdated Show resolved Hide resolved
Copy link
Contributor

@swenson swenson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tomhjp tomhjp merged commit b4783bf into main Sep 30, 2022
@tomhjp tomhjp deleted the plugin-permissions-check-fix branch September 30, 2022 09:33
tvoran added a commit that referenced this pull request Oct 7, 2022
Plugins: Fix file permissions check to always use the correct path

* Add failing test for when command != plugin name
* wrapFactoryCheckPerms uses pluginCatalog.Get to fetch the correct command
* Use filepath.Rel for consistency with plugin read API handler
tvoran added a commit that referenced this pull request Oct 7, 2022
Plugins: Fix file permissions check to always use the correct path

* Add failing test for when command != plugin name
* wrapFactoryCheckPerms uses pluginCatalog.Get to fetch the correct command
* Use filepath.Rel for consistency with plugin read API handler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to indicate a potential bug core/plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants