Description of problem:
Using `setenforce 0` became a common way to "fix" errors (Permission denied) caused by mislabeled files, bugs or missing rules in the policy, etc. Disabling SELinux policy enforcement as the only action to fix these issues is arguably not the best thing to do.
I would like to suggest adding a confirmation prompt and a warning/advice text to the setenforce command -- only when executed with the intention to disable policy enforcement.
Actual results:
No question and no warning message about the consequences of running setenforce 0.
Expected results:
A prompt asking for confirmation of the action (with a default "no" answer) and a warning message explaining what are the consequences of disabling policy enforcement (thus educating users who found this "solution" somewhere on the internet). Optionally, show a bit of advice how to debug the most common issues -- possibly with a redirection to a man page that explains the most common workflows to fix policy issues, mislabeling or creating better temporary workaround fixes that don't disable policy enforcement on the whole system).
Additional info:

Note

You need to
log in
before you can comment on or make changes to this bug.