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

temporary file folder no longer unique #10194

Closed
bartschuller opened this issue Apr 15, 2020 · 4 comments · Fixed by #10230
Closed

temporary file folder no longer unique #10194

bartschuller opened this issue Apr 15, 2020 · 4 comments · Fixed by #10230
Labels
Milestone

Comments

@bartschuller
Copy link

Play Version

2.8.0-M4+

API

Scala

Operating System

Linux primary 4.15.0-96-generic #97-Ubuntu SMP Wed Apr 1 03:25:46 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

JDK

openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08)
OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)

Library Dependencies

Expected Behavior

  1. We have an existing Play application which uses a file upload form. We're upgrading it from Play 2.6.21 to 2.8.1.
  2. Under Play 2.6.21, when a user uploads a file, a temporary directory with a unique name is created, such as /tmp/playtemp189725596617018652
  3. We depend on that directory being unique, because the same machine runs multiple independent Play applications, each under their own Unix user.

Actual Behavior

  1. The same application upgraded to Play 2.8.1 suddenly creates a directory /tmp/playtemp.
  2. It's sister application running on the same machine under a different user tries to create a file within this directory (because it too is using /tmp/playtemp now) , but fails, because it doesn't own it.

Reproducible Test Case

I can trace the regression to commit 940bd88 belonging to #9390 which replaced a call to JFiles.createTempDirectory(TempDirectoryPrefix) with a call to JFiles.createDirectories(Paths.get(s"$dir/$TempDirectoryPrefix")). The latter doesn't use it's argument as a prefix for a unique name.

@mkurz
Copy link
Member

mkurz commented Apr 15, 2020

Thanks for the report. I will check. Let's target Play 2.8.2 with a fix if necessary.

@mkurz mkurz added this to the Play 2.8.2 milestone Apr 15, 2020
@mkurz
Copy link
Member

mkurz commented Apr 15, 2020

@bartschuller Do you want to provide a pull request with a fix?

@bartschuller
Copy link
Author

Sorry, I don't have one.

@mkurz
Copy link
Member

mkurz commented Apr 15, 2020

It's ok, I will take a look.

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

Successfully merging a pull request may close this issue.

2 participants