Score:2

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

in flag

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.

hr flag
The only thing I can find is this [sudo changeset 12448:c422a5c8ea5d](https://marc.info/?l=sudo-commits&m=159000688202280&w=2) (also found in the source package's `NEWS` file) - it's not clear to me whether the new syntax is mandatory or just preferred
Score:1
jp flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.