mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-12 05:38:04 +00:00
Revert usage of filepath.Clean (azure compatability issues)
This commit is contained in:
parent
38ce8618e1
commit
bae319ab7f
@ -25,7 +25,10 @@ func safelyRenameFile(from string, to string) {
|
|||||||
|
|
||||||
// thanks https://stackoverflow.com/questions/21060945/simple-way-to-copy-a-file-in-golang
|
// thanks https://stackoverflow.com/questions/21060945/simple-way-to-copy-a-file-in-golang
|
||||||
func copyFileContents(src, dst string) (err error) {
|
func copyFileContents(src, dst string) (err error) {
|
||||||
in, err := os.Open(src) // nolint gosec
|
// ignore CWE-22 gosec issue - that's more targetted for http based apps that run in a public directory,
|
||||||
|
// and ensuring that it's not possible to give a path to a file outside thar directory.
|
||||||
|
|
||||||
|
in, err := os.Open(src) // #nosec
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,9 @@ func readStream(filename string) (io.Reader, error) {
|
|||||||
if filename == "-" {
|
if filename == "-" {
|
||||||
return bufio.NewReader(os.Stdin), nil
|
return bufio.NewReader(os.Stdin), nil
|
||||||
} else {
|
} else {
|
||||||
return os.Open(filename) // nolint gosec
|
// ignore CWE-22 gosec issue - that's more targetted for http based apps that run in a public directory,
|
||||||
|
// and ensuring that it's not possible to give a path to a file outside thar directory.
|
||||||
|
return os.Open(filename) // #nosec
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +81,9 @@ func WriteTempYamlFile(content string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ReadTempYamlFile(name string) string {
|
func ReadTempYamlFile(name string) string {
|
||||||
content, _ := ioutil.ReadFile(name)
|
// ignore CWE-22 gosec issue - that's more targetted for http based apps that run in a public directory,
|
||||||
|
// and ensuring that it's not possible to give a path to a file outside thar directory.
|
||||||
|
content, _ := ioutil.ReadFile(name) // #nosec
|
||||||
return string(content)
|
return string(content)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user