From: Lennart Poettering Date: Fri, 13 Apr 2012 15:36:41 +0000 (+0200) Subject: main: unset some more env vars X-Git-Tag: v183~324 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f28b98ec6461b4e06edd1e149c1ee5e9dcc4be0;p=systemd main: unset some more env vars --- diff --git a/src/core/main.c b/src/core/main.c index 9db83aa2..9bcedbe7 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -1350,6 +1350,12 @@ int main(int argc, char *argv[]) { unsetenv("SHLVL"); unsetenv("_"); + /* When we are invoked by a tool chroot-like such as + * nspawn, these might be set, but make little sense + * to pass on */ + unsetenv("USER"); + unsetenv("LOGNAME"); + /* All other variables are left as is, so that clients * can still read them via /proc/1/environ */ }