Skip to content

Commit

Permalink
chore: do not save input file
Browse files Browse the repository at this point in the history
the user invokes the input already got the input but those content could be sensitive to another user who received this bundle
  • Loading branch information
York Chen committed Nov 1, 2023
1 parent d931479 commit 6af77ad
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions pkg/collect/host_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,10 @@ func (c *CollectHostRun) Collect(progressChan chan<- interface{}) (map[string][]
if err != nil {
return nil, errors.New("failed to created temp dir for host run input")
}
for inFilename, inFileContent := range runHostCollector.Input {
if strings.Contains(inFileContent, "/") {
for inFilename := range runHostCollector.Input {
if strings.Contains(inFilename, "/") {
return nil, errors.New("Input filename contains '/'")
}
cmdInputFilePath := filepath.Join(cmdInputTempDir, inFilename)
err = os.WriteFile(cmdInputFilePath, []byte(inFileContent), 0644)
if err != nil {
return nil, errors.Wrap(err, fmt.Sprintf("failed to write input file: %s to temp directory", inFilename))
}
}
cmd.Env = append(cmd.Env,
fmt.Sprintf("TS_INPUT_DIR=%s", cmdInputTempDir),
Expand Down

0 comments on commit 6af77ad

Please sign in to comment.