Preserve DISPLAY environment variable by default.
This commit is contained in:
1
env.c
1
env.c
@@ -160,6 +160,7 @@ static const char *initial_checkenv_table[] = {
|
||||
*/
|
||||
static const char *initial_keepenv_table[] = {
|
||||
"KRB5CCNAME",
|
||||
"DISPLAY",
|
||||
"PATH",
|
||||
"TERM",
|
||||
"TZ",
|
||||
|
4
sudo.pod
4
sudo.pod
@@ -185,8 +185,8 @@ in the L<passwd(@mansectform@)> entry of the user that the command is
|
||||
being run as. The command name argument given to the shell begins
|
||||
with a `C<->' to tell the shell to run as a login shell. B<sudo>
|
||||
attempts to change to that user's home directory before running the
|
||||
shell. It also initializes the environment, leaving I<TERM>
|
||||
unchanged, setting I<HOME>, I<SHELL>, I<USER>, I<LOGNAME>, and
|
||||
shell. It also initializes the environment, leaving I<DISPLAY>
|
||||
and I<TERM> unchanged, setting I<HOME>, I<SHELL>, I<USER>, I<LOGNAME>, and
|
||||
I<PATH>, and unsetting all other environment variables.
|
||||
|
||||
=item -K
|
||||
|
15
sudoers.pod
15
sudoers.pod
@@ -437,13 +437,14 @@ function.
|
||||
=item env_reset
|
||||
|
||||
If set, B<sudo> will reset the environment to only contain the
|
||||
following variables: C<HOME>, C<LOGNAME>, C<PATH>, C<SHELL>, C<TERM>,
|
||||
C<TZ> and C<USER> (in addition to the C<SUDO_*> variables).
|
||||
Of these, only C<PATH>, C<TZ> and C<TERM> are copied unaltered from the old
|
||||
environment. The other variables are set to default values (possibly
|
||||
modified by the value of the I<set_logname> option). If the I<secure_path>
|
||||
option is set, its value will be used for the C<PATH> environment variable.
|
||||
Other variables may be preserved via the I<env_keep> option.
|
||||
following variables: C<DISPLAY>, C<HOME>, C<LOGNAME>, C<PATH>,
|
||||
C<SHELL>, C<TERM>, C<TZ> and C<USER> (in addition to the C<SUDO_*>
|
||||
variables). Of these, only C<DISPLAY>, C<PATH>, C<TZ> and C<TERM>
|
||||
are copied unaltered from the old environment. The other variables
|
||||
are set to default values (possibly modified by the value of the
|
||||
I<set_logname> option). If the I<secure_path> option is set, its
|
||||
value will be used for the C<PATH> environment variable. Other
|
||||
variables may be preserved via the I<env_keep> option.
|
||||
This flag is I<on> by default.
|
||||
|
||||
=item use_loginclass
|
||||
|
Reference in New Issue
Block a user