Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What's the difference between `#include` and `@include` in `/etc/sudoers`

I’m updating to Ubuntu 21.04 and apt wants to swap out my sudoers file with one where #include is replaced by @include. Is the old syntax deprecated? It’s not something I seem to be able to google.

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Expanding on @steeldriver’s comment, which provides the answer.

The commit comment states the reason for the new directive is to avoid confusion because # is also used for comments.

Add support for @include and @includedir
These are less confusing than #include and #includedir when the
hash character is also the comment character.

The latest man page indicates both directives are accepted, but the old style is supported for backwards compatibility. I infer the new style is preferred. There is no indication the old style will stop being supported.

It is possible to include other sudoers files from within the sudoers file currently being parsed using the @include and @includedir directives. For compatibility with sudo versions prior to 1.9.1, #include and #includedir are also accepted.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading