chiark / gitweb /
do not pass-along the environment from the kernel or initrd
authorKay Sievers <kay@vrfy.org>
Tue, 30 Jul 2013 00:02:45 +0000 (02:02 +0200)
committerKay Sievers <kay@vrfy.org>
Tue, 30 Jul 2013 00:07:50 +0000 (02:07 +0200)
src/core/main.c

index 91cbee2e5907c47e580e8d71bba43048dc705f32..8a73ad3cc798a29344d5bc63b2cf50d1cc22bbf4 100644 (file)
@@ -1776,6 +1776,10 @@ finish:
                         args[i++] = sfd;
                         args[i++] = NULL;
 
+                        /* do not pass along the environment we inherit from the kernel or initrd */
+                        if (switch_root_dir)
+                                clearenv();
+
                         assert(i <= args_size);
                         execv(args[0], (char* const*) args);
                 }