]> Cypherpunks repositories - gostls13.git/commit
syscall: fix ordering of Unshare and chroot on Linux
authorRonald G. Minnich <rminnich@gmail.com>
Mon, 24 Apr 2017 23:09:24 +0000 (16:09 -0700)
committerIan Lance Taylor <iant@golang.org>
Tue, 25 Apr 2017 04:10:39 +0000 (04:10 +0000)
commit67399c6279d7c2777a1a83103644f853d87533ba
treefddd1524d938051d7d2e4252eb410fa95ff2db4a
parentcf3a28124b199d15b7e968327ba07d45f2f24a88
syscall: fix ordering of Unshare and chroot on Linux

When unshare specifies a new namespace, the syscall
package changes / to make namespace changes private.

If a chroot is specified, the unshare must be done first.
If the chroot is done first then the unshare will
not specify the correct /.

A new test is included which test combining chroot
and CLONE_NEWNS; it fails without the patch and works with
it.

Fixes #20103

Change-Id: I86022803c784bd418a30383321f3d64103d95c62
Reviewed-on: https://go-review.googlesource.com/41626
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/syscall/exec_linux.go
src/syscall/exec_linux_test.go