1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-10 05:18:17 +03:00

main: unset some bash specific environment variables that might get leaked to us

https://bugzilla.redhat.com/show_bug.cgi?id=811537
This commit is contained in:
Lennart Poettering 2012-04-11 13:19:26 +02:00
parent 71ecc858fa
commit 9543ad1663

View File

@ -1343,6 +1343,12 @@ int main(int argc, char *argv[]) {
unsetenv("HOME");
unsetenv("TERM");
/* When we are invoked by a shell, these might be set,
* but make little sense to pass on */
unsetenv("PWD");
unsetenv("SHLVL");
unsetenv("_");
/* All other variables are left as is, so that clients
* can still read them via /proc/1/environ */
}