-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
community.general.sudoers should do a syntax check #4745
Comments
Files identified in the description: If these files are incorrect, please update the |
cc @JonEllis @JonEllis0 |
For me on RHEL 8 boxes the "visudo -c "check command reports that the file permissions are bad on files that were created by the sudoers module. New files are created with 644. Should I create a new issue for this?
|
@repcsi since it's not related to the current issue, yes please. |
Great suggestion. Validation sounds like a good addition to me. |
Summary
The
sudoers
module currently allows writing brokensudoers
files, for example whencommands
is not an absolute path. This kind of user error can easily be detected by runningvisudo -c -f ...
on the new file. I think it makes sense for thesudoers
module to run this check.Some errors, such as duplicate aliases, can only be detected in the context of the other
sudoers
files. According to this post a more comprehensive check can be done by running a full configuration checkvisudo -c
after installing the new file. However, I'm not sure if this is worth implementing. Thesudoers
module does not currently seem to be capable of producing syntax error that can not be detected by a simplevisudo -c -f ...
.Issue Type
Feature Idea
Component Name
sudoers
Additional Information
Slightly modified example task from the documentation:
sudo
commands complain about the syntax error:Code of Conduct
The text was updated successfully, but these errors were encountered: