]> err.no Git - systemd/commitdiff
main: unset some more env vars
authorLennart Poettering <lennart@poettering.net>
Fri, 13 Apr 2012 15:36:41 +0000 (17:36 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 13 Apr 2012 16:52:53 +0000 (18:52 +0200)
src/core/main.c

index 9db83aa2e534c73c39db002a6121c2ca5ec08cf6..9bcedbe71f6e0657f580782ac884b774537c2787 100644 (file)
@@ -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 */
         }