MCPcopy Create free account
hub / github.com/dim-an/cod / shellApiAttachMain

Function shellApiAttachMain

api_attach.go:28–54  ·  view source on GitHub ↗
(pid uint, shell string)

Source from the content-addressed store, hash-verified

26}
27
28func shellApiAttachMain(pid uint, shell string) {
29 config, err := server.DefaultConfiguration()
30 if err != nil {
31 fatal(err)
32 }
33
34 // Trying to daemonize.
35 err = daemonize(&config)
36 verifyFatal(err)
37
38 client, err := server.NewClient(config)
39 if err != nil {
40 fatal(err)
41 }
42
43 rsp := server.AttachResponse{}
44 req := server.AttachRequest{
45 Pid: int(pid),
46 Shell: shell,
47 CodBinaryPath: CodBinaryPath,
48 }
49
50 err = client.Request(&req, &rsp)
51 if err != nil {
52 fatal(err)
53 }
54}

Callers 1

mainFunction · 0.85

Calls 6

RequestMethod · 0.95
DefaultConfigurationFunction · 0.92
NewClientFunction · 0.92
daemonizeFunction · 0.85
verifyFatalFunction · 0.85
fatalFunction · 0.70

Tested by

no test coverage detected