We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2ebcf45 commit f0ad571Copy full SHA for f0ad571
jail/linux.go
@@ -11,6 +11,7 @@ import (
11
"syscall"
12
"time"
13
14
+ "github.com/coder/boundary/util"
15
"golang.org/x/sys/unix"
16
)
17
@@ -71,13 +72,18 @@ func (l *LinuxJail) Command(command []string) *exec.Cmd {
71
72
cmd.Stdout = os.Stdout
73
cmd.Stdin = os.Stdin
74
75
+ l.logger.Debug("os.Getuid()", "os.Getuid()", os.Getuid())
76
+ _, uid, gid, _, _ := util.GetUserInfo()
77
+
78
cmd.SysProcAttr = &syscall.SysProcAttr{
79
Cloneflags: syscall.CLONE_NEWUSER | syscall.CLONE_NEWNET,
80
UidMappings: []syscall.SysProcIDMap{
- {ContainerID: 0, HostID: os.Getuid(), Size: 1},
81
+ {ContainerID: 0, HostID: 0, Size: 1},
82
+ {ContainerID: uid, HostID: uid, Size: 1},
83
},
84
GidMappings: []syscall.SysProcIDMap{
- {ContainerID: 0, HostID: os.Getgid(), Size: 1},
85
86
+ {ContainerID: gid, HostID: gid, Size: 1},
87
88
}
89
0 commit comments