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

semanage: allow '-m' to add new entries #180

Open
ensc opened this issue Oct 2, 2019 · 1 comment
Open

semanage: allow '-m' to add new entries #180

ensc opened this issue Oct 2, 2019 · 1 comment

Comments

@ensc
Copy link

ensc commented Oct 2, 2019

It would be nice when semanage's -m operation would get a --force flag or so which would imply -a when entry does not exist.

Atm, it is very difficult to bring a system into a known state because every semanage invocation must be expressed by two commands; e.g.

semanage login -a -s unconfined_u -r s0-s0:c0.c1023 wheel || \
semanage login -m -s unconfined_u -r s0-s0:c0.c1023 wheel

because it might be unclear whether a mapping has been already defined.

Having an operation which translates to modify-or-add-when-not-existing would simplify things significantly. Tt would allow so use semanage -i transactions in more situations too.

@stephensmalley
Copy link
Member

I'd be willing to take a patch that either introduces such a --force flag or that simply makes this the default behavior for -m (unless someone sees a problem with that), Patches to [email protected].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants