trifectatechfoundation/sudo-rs

Parse unknown tags in sudoers file even if we do not know them

Opened this issue · 2 comments

I.e. right now we do not support the noexec tag, but that results in this error:

/etc/sudoers:91:29: expected host name
ALL ALL = (ALL:ALL) NOEXEC: /bin/sh, /bin/less

Instead something like 'noexec is an unsupported tag' would be a nicer error message for people jumping over from ogsudo.

squell commented

Note: should also add some code in the Def<T> parser so the Xyzzy_Alias syntax warns about attempts to define ambiguous sudoers rules.

The diagnostic (#760 (comment)) is a good idea

Still there should be an extra flag to explicitly reject the configuration when validating when it contains not-yet-supported options. for example when calling visudo -c with extra --no-unsupported. or we can just make visudo -c --strict include that check, without an extra flag.