Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible risk of temporary file collision #191

Open
JensRantil opened this issue Oct 25, 2020 · 1 comment
Open

Possible risk of temporary file collision #191

JensRantil opened this issue Oct 25, 2020 · 1 comment

Comments

@JensRantil
Copy link

I'm reading

filename := fmt.Sprintf("%s/s3_%d", os.TempDir(), rand.Uint32())
and
filename := fmt.Sprintf("%s/gs_%d", os.TempDir(), rand.Uint32())
and both has a slight risk of file name collisions. I propose migrating to use https://golang.org/pkg/io/ioutil/#TempFile which makes that scenario impossible.

@chrislusf
Copy link
Owner

Send a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants