mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 22:35:10 +00:00
Only read /etc/environment on Linux and AIX
This commit is contained in:
2
env.c
2
env.c
@@ -737,6 +737,7 @@ validate_env_vars(env_vars)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__linux__) || defined(_AIX)
|
||||||
/*
|
/*
|
||||||
* Read in /etc/environment ala AIX and Linux.
|
* Read in /etc/environment ala AIX and Linux.
|
||||||
* Lines are in the form of NAME=VALUE
|
* Lines are in the form of NAME=VALUE
|
||||||
@@ -770,6 +771,7 @@ read_env_file(path)
|
|||||||
}
|
}
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
|
#endif /* __linux__ || _AIX */
|
||||||
|
|
||||||
void
|
void
|
||||||
init_envtables()
|
init_envtables()
|
||||||
|
2
sudo.c
2
sudo.c
@@ -462,8 +462,10 @@ main(argc, argv, envp)
|
|||||||
if (chdir(runas_pw->pw_dir) == -1)
|
if (chdir(runas_pw->pw_dir) == -1)
|
||||||
warning("unable to change directory to %s", runas_pw->pw_dir);
|
warning("unable to change directory to %s", runas_pw->pw_dir);
|
||||||
|
|
||||||
|
#if defined(__linux__) || defined(_AIX)
|
||||||
/* Insert system-wide environment variables. */
|
/* Insert system-wide environment variables. */
|
||||||
read_env_file(_PATH_ENVIRONMENT);
|
read_env_file(_PATH_ENVIRONMENT);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ISSET(sudo_mode, MODE_EDIT))
|
if (ISSET(sudo_mode, MODE_EDIT))
|
||||||
|
6
sudo.pod
6
sudo.pod
@@ -209,8 +209,8 @@ shell is executed. B<sudo> attempts to change to that user's home
|
|||||||
directory before running the shell. It also initializes the
|
directory before running the shell. It also initializes the
|
||||||
environment, leaving I<DISPLAY> and I<TERM> unchanged, setting
|
environment, leaving I<DISPLAY> and I<TERM> unchanged, setting
|
||||||
I<HOME>, I<SHELL>, I<USER>, I<LOGNAME>, and I<PATH>, as well as
|
I<HOME>, I<SHELL>, I<USER>, I<LOGNAME>, and I<PATH>, as well as
|
||||||
the contents of F</etc/environment>. All other environment variables
|
the contents of F</etc/environment> on Linux and AIX systems.
|
||||||
are removed.
|
All other environment variables are removed.
|
||||||
|
|
||||||
=item -K
|
=item -K
|
||||||
|
|
||||||
@@ -506,7 +506,7 @@ Default editor to use in B<-e> (sudoedit) mode
|
|||||||
|
|
||||||
=item F<@timedir@>C< >Directory containing timestamps
|
=item F<@timedir@>C< >Directory containing timestamps
|
||||||
|
|
||||||
=item F</etc/environment>C< >Initial environment for B<-i> mode
|
=item F</etc/environment>C< >Initial environment for B<-i> mode on Linux and AIX
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user