chiark / gitweb /
main: unset some more env vars
[elogind.git] / 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 */
         }