summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2013-07-30 02:02:45 +0200
committerKay Sievers <kay@vrfy.org>2013-07-30 02:07:50 +0200
commitce8aba568156f2b9d0d3b023e960cda3d9d7db81 (patch)
treeda3a24baab776cddf2cae206b7e3a6c36505a384
parent82659fd7571bda0f3dce9755b89a23c411d53dda (diff)
do not pass-along the environment from the kernel or initrd
-rw-r--r--src/core/main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/main.c b/src/core/main.c
index 91cbee2e59..8a73ad3cc7 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -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);
}