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

[3006.x] Updated semanage fcontext to use --modify if context already exists when adding context #65003

Merged
merged 2 commits into from
Aug 17, 2023

Conversation

dmurphy18
Copy link
Contributor

What does this PR do?

If a semanage fcontext already exists for a file, then the command semanage fcontext --modify is used rather than semanage fcontext --add

What issues does this PR fix or reference?

Fixes:#64625

Previous Behavior

If the file already had a fcontext, a ValueError would be thrown, similar to the following

Unable to manage file: Problem setting fcontext: {'pid': 43053, 'retcode': 1, 'stdout': '', 'stderr': 'ValueError: File context for /root/test-one.txt already defined'}

New Behavior

The code checks to see if If the file already has a fcontext, and uses --modify rather than --add which will throw a ValueError if used in this case.

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

@dmurphy18 dmurphy18 requested a review from a team as a code owner August 16, 2023 22:36
@dmurphy18 dmurphy18 requested review from cmcmarrow and removed request for a team August 16, 2023 22:36
@salt-project-bot-prod-environment salt-project-bot-prod-environment bot changed the title Updated semanage fcontext to use --modify if context already exists when adding context [3006.x] Updated semanage fcontext to use --modify if context already exists when adding context Aug 16, 2023
@dmurphy18 dmurphy18 temporarily deployed to ci August 16, 2023 22:53 — with GitHub Actions Inactive
@dmurphy18 dmurphy18 temporarily deployed to ci August 16, 2023 22:53 — with GitHub Actions Inactive
@dmurphy18 dmurphy18 temporarily deployed to ci August 16, 2023 22:53 — with GitHub Actions Inactive
@dmurphy18 dmurphy18 temporarily deployed to ci August 16, 2023 22:53 — with GitHub Actions Inactive
@dmurphy18 dmurphy18 temporarily deployed to ci August 16, 2023 23:46 — with GitHub Actions Inactive
@dmurphy18 dmurphy18 temporarily deployed to ci August 16, 2023 23:46 — with GitHub Actions Inactive
@dmurphy18 dmurphy18 temporarily deployed to ci August 16, 2023 23:46 — with GitHub Actions Inactive
@dmurphy18 dmurphy18 temporarily deployed to ci August 16, 2023 23:46 — with GitHub Actions Inactive
@dmurphy18 dmurphy18 temporarily deployed to ci August 17, 2023 00:02 — with GitHub Actions Inactive
@dmurphy18 dmurphy18 temporarily deployed to ci August 17, 2023 00:06 — with GitHub Actions Inactive
@dmurphy18 dmurphy18 temporarily deployed to ci August 17, 2023 02:12 — with GitHub Actions Inactive
@dmurphy18 dmurphy18 temporarily deployed to ci August 17, 2023 02:12 — with GitHub Actions Inactive
@dmurphy18 dmurphy18 temporarily deployed to ci August 17, 2023 02:12 — with GitHub Actions Inactive
@dmurphy18 dmurphy18 temporarily deployed to ci August 17, 2023 02:12 — with GitHub Actions Inactive
@dmurphy18 dmurphy18 temporarily deployed to ci August 17, 2023 02:12 — with GitHub Actions Inactive
@dmurphy18 dmurphy18 temporarily deployed to ci August 17, 2023 02:13 — with GitHub Actions Inactive
@garethgreenaway garethgreenaway merged commit 8395ff5 into saltstack:3006.x Aug 17, 2023
@dmurphy18 dmurphy18 deleted the fix_64625 branch March 13, 2024 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants