From: Lennart Poettering Date: Wed, 11 Apr 2012 11:19:26 +0000 (+0200) Subject: main: unset some bash specific environment variables that might get leaked to us X-Git-Tag: v183~398 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9543ad166338a7bef8718070f11465df4b9badd7;p=systemd main: unset some bash specific environment variables that might get leaked to us https://bugzilla.redhat.com/show_bug.cgi?id=811537 --- diff --git a/src/main.c b/src/main.c index a0bcbdf0..6656cb4e 100644 --- a/src/main.c +++ b/src/main.c @@ -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 */ }