Skip to content

Commit a6a4d37

Browse files
committed
Add ptrace cap for IDE and their child process
1 parent f7a95c2 commit a6a4d37

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

components/supervisor/pkg/supervisor/supervisor.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import (
4242
"github.com/prometheus/common/route"
4343
"github.com/soheilhy/cmux"
4444
"golang.org/x/crypto/ssh"
45+
"golang.org/x/sys/unix"
4546
"golang.org/x/xerrors"
4647
"google.golang.org/grpc"
4748
"google.golang.org/grpc/codes"
@@ -1035,6 +1036,7 @@ func prepareIDELaunch(cfg *Config, ideConfig *IDEConfig) *exec.Cmd {
10351036
// IDE and its children.
10361037
cmd.SysProcAttr.Setpgid = true
10371038
cmd.SysProcAttr.Pdeathsig = syscall.SIGKILL
1039+
cmd.SysProcAttr.AmbientCaps = append(cmd.SysProcAttr.AmbientCaps, unix.CAP_SYS_PTRACE)
10381040

10391041
// Here we must resist the temptation to "neaten up" the IDE output for headless builds.
10401042
// This would break the JSON parsing of the headless builds.

0 commit comments

Comments
 (0)