From 6fe222329854ae1c6cfe2fd995027340d0d5c496 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 20 Jun 2019 11:05:15 -0600 Subject: [PATCH] Fix details of how EDITOR, VISUAL and SUDO_EDITOR are (or are not) preserved. The description in the editor option was incorrect and didn't mention env_keep. Reported by Sander Bos --- doc/sudoers.cat | 9 +++++---- doc/sudoers.man.in | 10 ++++++---- doc/sudoers.mdoc.in | 10 ++++++---- doc/visudo.cat | 10 +++++----- doc/visudo.man.in | 13 +++++++++---- doc/visudo.mdoc.in | 13 +++++++++---- 6 files changed, 40 insertions(+), 25 deletions(-) diff --git a/doc/sudoers.cat b/doc/sudoers.cat index 6158a08c6..751ec09e4 100644 --- a/doc/sudoers.cat +++ b/doc/sudoers.cat @@ -1669,9 +1669,10 @@ SSUUDDOOEERRSS OOPPTTIIOONNSS VISUAL or EDITOR environment variable if possible, or the first editor in the list that exists and is executable if not. Unless invoked as ssuuddooeeddiitt, ssuuddoo - does not preserve the SUDO_EDITOR, VISUAL and EDITOR - environment variables by default, even when the - _e_n_v___r_e_s_e_t option is enabled. The default is _v_i. + does not preserve the SUDO_EDITOR, VISUAL or EDITOR + environment variables unless they are present in the + _e_n_v___k_e_e_p list or the _e_n_v___r_e_s_e_t option is disabled. The + default is _v_i. iolog_dir The top-level directory to use when constructing the path name for the input/output log directory. Only @@ -2951,4 +2952,4 @@ DDIISSCCLLAAIIMMEERR file distributed with ssuuddoo or https://www.sudo.ws/license.html for complete details. -Sudo 1.8.28 June 19, 2019 Sudo 1.8.28 +Sudo 1.8.28 June 20, 2019 Sudo 1.8.28 diff --git a/doc/sudoers.man.in b/doc/sudoers.man.in index 2f7082266..fcc7ddb54 100644 --- a/doc/sudoers.man.in +++ b/doc/sudoers.man.in @@ -25,7 +25,7 @@ .nr BA @BAMAN@ .nr LC @LCMAN@ .nr PS @PSMAN@ -.TH "SUDOERS" "@mansectform@" "June 19, 2019" "Sudo @PACKAGE_VERSION@" "File Formats Manual" +.TH "SUDOERS" "@mansectform@" "June 20, 2019" "Sudo @PACKAGE_VERSION@" "File Formats Manual" .nh .if n .ad l .SH "NAME" @@ -3453,11 +3453,13 @@ Unless invoked as does not preserve the \fRSUDO_EDITOR\fR, \fRVISUAL\fR -and +or \fREDITOR\fR -environment variables by default, even when the +environment variables unless they are present in the +\fIenv_keep\fR +list or the \fIenv_reset\fR -option is enabled. +option is disabled. The default is \fI@editor@\fR. .TP 18n diff --git a/doc/sudoers.mdoc.in b/doc/sudoers.mdoc.in index 368eb3cdb..8c4e23c08 100644 --- a/doc/sudoers.mdoc.in +++ b/doc/sudoers.mdoc.in @@ -24,7 +24,7 @@ .nr BA @BAMAN@ .nr LC @LCMAN@ .nr PS @PSMAN@ -.Dd June 19, 2019 +.Dd June 20, 2019 .Dt SUDOERS @mansectform@ .Os Sudo @PACKAGE_VERSION@ .Sh NAME @@ -3255,11 +3255,13 @@ Unless invoked as does not preserve the .Ev SUDO_EDITOR , .Ev VISUAL -and +or .Ev EDITOR -environment variables by default, even when the +environment variables unless they are present in the +.Em env_keep +list or the .Em env_reset -option is enabled. +option is disabled. The default is .Pa @editor@ . .It iolog_dir diff --git a/doc/visudo.cat b/doc/visudo.cat index fe3be5260..cd587c400 100644 --- a/doc/visudo.cat +++ b/doc/visudo.cat @@ -32,11 +32,11 @@ DDEESSCCRRIIPPTTIIOONN vviissuuddoo. vviissuuddoo will choose the editor that matches the user's SUDO_EDITOR, VISUAL or EDITOR environment variable if possible, or the first editor in the list that exists and is executable. - Note that the SUDO_EDITOR, VISUAL and EDITOR environment - variables are not preserved by default when the _e_n_v___r_e_s_e_t - _s_u_d_o_e_r_s option is enabled. The default editor path is _v_i which - can be set at compile time via the --with-editor configure - option. + Note that ssuuddoo does not preserve the SUDO_EDITOR, VISUAL or + EDITOR environment variables unless they are present in the + _e_n_v___k_e_e_p list or the _e_n_v___r_e_s_e_t option is disabled in the + _s_u_d_o_e_r_s file. The default editor path is _v_i which can be set + at compile time via the --with-editor configure option. env_editor If set, vviissuuddoo will use the value of the SUDO_EDITOR, VISUAL or diff --git a/doc/visudo.man.in b/doc/visudo.man.in index 746754cf7..9bdc21979 100644 --- a/doc/visudo.man.in +++ b/doc/visudo.man.in @@ -101,15 +101,20 @@ or \fREDITOR\fR environment variable if possible, or the first editor in the list that exists and is executable. -Note that the +Note that +\fBsudo\fR +does not preserve the \fRSUDO_EDITOR\fR, \fRVISUAL\fR -and +or \fREDITOR\fR -environment variables are not preserved by default when the +environment variables unless they are present in the +\fIenv_keep\fR +list or the \fIenv_reset\fR +option is disabled in the \fIsudoers\fR -option is enabled. +file. The default editor path is \fI@editor@\fR which can be set at compile time via the diff --git a/doc/visudo.mdoc.in b/doc/visudo.mdoc.in index a9dc8ec1d..20e5d6326 100644 --- a/doc/visudo.mdoc.in +++ b/doc/visudo.mdoc.in @@ -99,15 +99,20 @@ or .Ev EDITOR environment variable if possible, or the first editor in the list that exists and is executable. -Note that the +Note that +.Nm sudo +does not preserve the .Ev SUDO_EDITOR , .Ev VISUAL -and +or .Ev EDITOR -environment variables are not preserved by default when the +environment variables unless they are present in the +.Em env_keep +list or the .Em env_reset +option is disabled in the .Em sudoers -option is enabled. +file. The default editor path is .Pa @editor@ which can be set at compile time via the -- 2.40.0