-
Notifications
You must be signed in to change notification settings - Fork 70
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
Allow override built-in fcontext #119
Comments
A PR will help to better understand the issue and the fix. |
@Stromweld I will submit a PR in the next day or 2. Thanks. |
…types Signed-off-by: Yansheng Wei <[email protected]>
@Stromweld , please take a look at PR #120. If the approach makes sense, I will update the test cases and the rest for the PR. Thanks |
That looks good to me. I'm not very versed in selinux though. I think it'll help to add the test cases for each scenario as well as to make sure future regression isn't introduced. Would you also be able to open PR for the same thing here https://github.com/chef/chef/blob/main/lib/chef/resource/selinux_fcontext.rb. This resource was based on this cookbooks resource. It'll help chef-client as well as cinc-client since it's based on chef-client. |
@Stromweld Will do. Let me do it in 2 steps.
Thanks for the quick feedback. |
…types Signed-off-by: Yansheng Wei <[email protected]>
…types Signed-off-by: Yansheng Wei <[email protected]>
* [issue #119] Update fcontext to allow override of built-in types --------- Signed-off-by: Yansheng Wei <[email protected]>
🙍 Problem Statement
The selinux_fcontext::manage/modify does not allow override of built-in contexts.
:add
action would skip ifsemanage fcontext -l
returns an entry, and:modify
would fail if there is no such entry in the.local
spec file. Hence there is no way to override a built-in context.❔ Possible Solution
The most straightforward solution is to check whether the type matches at the conditional statement. Instead of checking "if fcontext is already registered", it should check "if the desired fcontext is already registered". So the conditional check will the same as the
:modify
action.One possibility is to clone and hack it, but that defeats the purpose of a re-usable cookbook.
➕ Additional context
I can submit a PR if the proposed solution is acceptable.
The text was updated successfully, but these errors were encountered: