From: Todd C. Miller Date: Tue, 28 Sep 2004 01:04:57 +0000 (+0000) Subject: document #include X-Git-Tag: SUDO_1_7_0~933 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fbb62c6805d69f66b3fd8930b16474ba1d728fbc;p=sudo document #include --- diff --git a/sudoers.pod b/sudoers.pod index 064edd704..6422e4c17 100644 --- a/sudoers.pod +++ b/sudoers.pod @@ -978,13 +978,33 @@ with B arguments. =back +=head2 Including other files from within sudoers + +It is possible to include other I files from within the +I file currently being parsed using the C<#include> +directive, similar to the one used by the C preprocessor. This is +useful, for example, for keeping a site-wide I file in +addition to a per-machine local one. For the sake of this example +the site-wide I will be F and the per-machine +one will be F. To include F +from F we would use the following line in F: + + #include /etc/sudoers.local + +When B reaches this line it will suspend processing of the +current file (F) and switch to F. +Upon reaching the end of F, the rest of +F will be processed. Files that are included may +themselves include other files. A hard limit of 128 nested include +files is enforced to prevent include file loops. + =head2 Other special characters and reserved words -The pound sign ('#') is used to indicate a comment (unless it -occurs in the context of a user name and is followed by one or -more digits, in which case it is treated as a uid). Both the -comment character and any text after it, up to the end of the line, -are ignored. +The pound sign ('#') is used to indicate a comment (unless it is +part of a #include directive or unless it occurs in the context of +a user name and is followed by one or more digits, in which case +it is treated as a uid). Both the comment character and any text +after it, up to the end of the line, are ignored. The reserved word B is a built-in I that always causes a match to succeed. It can be used wherever one might otherwise