mirror of
https://github.com/replicatedhq/troubleshoot.git
synced 2026-02-14 18:29:53 +00:00
chore: do not save input file
the user invokes the input already got the input but those content could be sensitive to another user who received this bundle
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user