summary refs log tree commit diff
path: root/pkgs/build-support/build-fhs-userenv
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/build-support/build-fhs-userenv')
-rwxr-xr-xpkgs/build-support/build-fhs-userenv/chroot-user.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkgs/build-support/build-fhs-userenv/chroot-user.rb b/pkgs/build-support/build-fhs-userenv/chroot-user.rb
index 05b4914b6f6..97316ac4369 100755
--- a/pkgs/build-support/build-fhs-userenv/chroot-user.rb
+++ b/pkgs/build-support/build-fhs-userenv/chroot-user.rb
@@ -140,10 +140,10 @@ if $cpid == 0
   link_swdir.call swdir, Pathname.new('')
 
   # New environment
-  ENV.replace(Hash[ envvars.map { |x| [x, ENV[x]] } ])
+  new_env = Hash[ envvars.map { |x| [x, ENV[x]] } ]
 
   # Finally, exec!
-  exec *execp
+  exec(new_env, *execp, close_others: true, unsetenv_others: true)
 end
 
 # Wait for a child. If we catch a signal, resend it to child and continue