From e51831fab36f88bc9ccf4e6ab7987d8e84a233c2 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 8 May 2017 13:55:02 -0600 Subject: [PATCH] Be clear that #includedir diverts control to the files in the specified directory and, when parsing of those files is complete, returns control to the original file. Bug #775 --- doc/sudoers.cat | 15 +++++++++------ doc/sudoers.man.in | 8 ++++++-- doc/sudoers.mdoc.in | 8 ++++++-- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/doc/sudoers.cat b/doc/sudoers.cat index b880ee45e..a647432e1 100644 --- a/doc/sudoers.cat +++ b/doc/sudoers.cat @@ -852,14 +852,17 @@ SSUUDDOOEERRSS FFIILLEE FFOORRMMAATT #includedir /etc/sudoers.d - ssuuddoo will read each file in _/_e_t_c_/_s_u_d_o_e_r_s_._d, skipping file names that end - in `~' or contain a `.' character to avoid causing problems with package - manager or editor temporary/backup files. Files are parsed in sorted - lexical order. That is, _/_e_t_c_/_s_u_d_o_e_r_s_._d_/_0_1___f_i_r_s_t will be parsed before + ssuuddoo will suspend processing of the current file and read each file in + _/_e_t_c_/_s_u_d_o_e_r_s_._d, skipping file names that end in `~' or contain a `.' + character to avoid causing problems with package manager or editor + temporary/backup files. Files are parsed in sorted lexical order. That + is, _/_e_t_c_/_s_u_d_o_e_r_s_._d_/_0_1___f_i_r_s_t will be parsed before _/_e_t_c_/_s_u_d_o_e_r_s_._d_/_1_0___s_e_c_o_n_d. Be aware that because the sorting is lexical, not numeric, _/_e_t_c_/_s_u_d_o_e_r_s_._d_/_1___w_h_o_o_p_s would be loaded _a_f_t_e_r _/_e_t_c_/_s_u_d_o_e_r_s_._d_/_1_0___s_e_c_o_n_d. Using a consistent number of leading zeroes in - the file names can be used to avoid such problems. + the file names can be used to avoid such problems. After parsing the + files in the directory, control returns to the file that contained the + #includedir directive. Note that unlike files included via #include, vviissuuddoo will not edit the files in a #includedir directory unless one of them contains a syntax @@ -2810,4 +2813,4 @@ DDIISSCCLLAAIIMMEERR file distributed with ssuuddoo or https://www.sudo.ws/license.html for complete details. -Sudo 1.8.20 May 3, 2017 Sudo 1.8.20 +Sudo 1.8.20 May 8, 2017 Sudo 1.8.20 diff --git a/doc/sudoers.man.in b/doc/sudoers.man.in index 2ebed460e..18de06b83 100644 --- a/doc/sudoers.man.in +++ b/doc/sudoers.man.in @@ -21,7 +21,7 @@ .\" Agency (DARPA) and Air Force Research Laboratory, Air Force .\" Materiel Command, USAF, under agreement number F39502-99-1-0512. .\" -.TH "SUDOERS" "5" "May 3, 2017" "Sudo @PACKAGE_VERSION@" "File Formats Manual" +.TH "SUDOERS" "5" "May 8, 2017" "Sudo @PACKAGE_VERSION@" "File Formats Manual" .nh .if n .ad l .SH "NAME" @@ -1819,7 +1819,7 @@ For example, given: .fi .PP \fBsudo\fR -will read each file in +will suspend processing of the current file and read each file in \fI/etc/sudoers.d\fR, skipping file names that end in \(oq~\(cq @@ -1839,6 +1839,10 @@ would be loaded \fI/etc/sudoers.d/10_second\fR. Using a consistent number of leading zeroes in the file names can be used to avoid such problems. +After parsing the files in the directory, control returns to the +file that contained the +\fR#includedir\fR +directive. .PP Note that unlike files included via \fR#include\fR, diff --git a/doc/sudoers.mdoc.in b/doc/sudoers.mdoc.in index f902b9d2d..a69a7acc5 100644 --- a/doc/sudoers.mdoc.in +++ b/doc/sudoers.mdoc.in @@ -19,7 +19,7 @@ .\" Agency (DARPA) and Air Force Research Laboratory, Air Force .\" Materiel Command, USAF, under agreement number F39502-99-1-0512. .\" -.Dd May 3, 2017 +.Dd May 8, 2017 .Dt SUDOERS @mansectform@ .Os Sudo @PACKAGE_VERSION@ .Sh NAME @@ -1695,7 +1695,7 @@ For example, given: .Ed .Pp .Nm sudo -will read each file in +will suspend processing of the current file and read each file in .Pa /etc/sudoers.d , skipping file names that end in .Ql ~ @@ -1715,6 +1715,10 @@ would be loaded .Pa /etc/sudoers.d/10_second . Using a consistent number of leading zeroes in the file names can be used to avoid such problems. +After parsing the files in the directory, control returns to the +file that contained the +.Li #includedir +directive. .Pp Note that unlike files included via .Li #include , -- 2.40.0