cffile makeunique filename isn't synchronised

Description

I think there’s a tiny chance under load that makeunique might conflict, if multiple users upload the same filename at the same time, as I think there’s no locking between generating a unique filename and actually writing out to the new unique filename. both could end up with the same destination filename. I guess one of the requests would then fail at createNewFile…

https://github.com/lucee/Lucee/blob/5.3/core/src/main/java/lucee/runtime/tag/FileTag.java#L963

Environment

None

Activity

Show:
Zac Spitzer
May 6, 2020, 10:04 AM

immediately creating an empty file when a unique filename is generated would help, that way the locking could be more localised

Pothys - MitrahSoft
July 13, 2020, 7:13 AM

I've checked this ticket. If multiple users doing same thing means, sometimes the error "The process cannot access the file because it is being used by another process" will occur. Ok. Micha will decide about this issue.

Assignee

Michael Offner

Reporter

Zac Spitzer

Priority

New

Labels

Fix versions

None

Affects versions

Configure