Merge pull request #11602 from zimbatm/stricter-chroot-user
build-fhs-userenv: don't leak file descriptors
This commit is contained in:
commit
8ec4b45dbd
|
@ -140,10 +140,10 @@ if $cpid == 0
|
||||||
link_swdir.call swdir, Pathname.new('')
|
link_swdir.call swdir, Pathname.new('')
|
||||||
|
|
||||||
# New environment
|
# New environment
|
||||||
ENV.replace(Hash[ envvars.map { |x| [x, ENV[x]] } ])
|
new_env = Hash[ envvars.map { |x| [x, ENV[x]] } ]
|
||||||
|
|
||||||
# Finally, exec!
|
# Finally, exec!
|
||||||
exec *execp
|
exec(new_env, *execp, close_others: true, unsetenv_others: true)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Wait for a child. If we catch a signal, resend it to child and continue
|
# Wait for a child. If we catch a signal, resend it to child and continue
|
||||||
|
|
Loading…
Reference in New Issue