Is it possible to perform a visudo
sanity check for a file in the context of other files included from /etc/sudoers.d
?
Scenario:
I want to add a new file to /etc/sudoers.d
the file itself is correct and it passes the visudo -c
parser.
It does however contain a Cmnd_Alias
line which conflicts with another file in etc/sudoers.d
.
If moved to a /etc/sudoers.d
it would break the sudo
command with Alias '<name>' already defined near line
error.
Question:
Is there any method which I could employ to check if the new file wouldn't break the sudo
after placing it in sudoers.d
?
Or is there any method to make sudo
ignore/stop processing included files if there was any error encountered?