• Ronald G. Minnich's avatar
    syscall: fix ordering of Unshare and chroot on Linux · 67399c62
    Ronald G. Minnich authored
    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/41626Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    67399c62
exec_linux.go 12.6 KB