MCPcopy Create free account
hub / github.com/Xenov-X/csbot / executeRun

Method executeRun

workflow/executor_spawn.go:13–25  ·  view source on GitHub ↗

--- Command Execution Variants --- executeRun executes a command without cmd.exe

(ctx context.Context, client *csclient.Client, beaconID string, action Action)

Source from the content-addressed store, hash-verified

11
12// executeRun executes a command without cmd.exe
13func (e *Executor) executeRun(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) {
14 program, ok := action.Parameters["program"].(string)
15 if !ok {
16 return "", fmt.Errorf("program parameter required for run")
17 }
18 args, _ := action.Parameters["args"].(string) // optional
19
20 resp, err := client.Run(ctx, beaconID, program, args)
21 if err != nil {
22 return "", err
23 }
24 return e.waitForOutput(ctx, client, resp.TaskID)
25}
26
27// executeRunAs executes a command as another user
28func (e *Executor) executeRunAs(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) {

Callers 1

executeActionMethod · 0.95

Calls 1

waitForOutputMethod · 0.95

Tested by

no test coverage detected