Fix RunAsRoot arguments forwarding

It was including the path to the executable twice in the
arguments.

PiperOrigin-RevId: 211098311
Change-Id: I5357c51c63f38dfab551b17bb0e04011a0575010
This commit is contained in:
Fabricio Voznika
2018-08-31 09:45:32 -07:00
committed by Shentubot
parent 3f04bd68b2
commit e669697241
+1 -1
View File
@@ -254,7 +254,7 @@ func RunAsRoot(m *testing.M) {
runtime.LockOSThread()
defer runtime.UnlockOSThread()
cmd := exec.Command("/proc/self/exe", os.Args...)
cmd := exec.Command("/proc/self/exe", os.Args[1:]...)
cmd.SysProcAttr = &syscall.SysProcAttr{
Cloneflags: syscall.CLONE_NEWUSER | syscall.CLONE_NEWNS,
// Set current user/group as root inside the namespace.