From 9f28b98ec6461b4e06edd1e149c1ee5e9dcc4be0 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 13 Apr 2012 17:36:41 +0200 Subject: [PATCH] main: unset some more env vars --- src/core/main.c | 6 ++++++ 1 file changed, 6 insertions(+) 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 */ } -- 2.39.5