CFZIP action="unzip" overwrite="true" deletes existing directories.

Description

This related to this issue https://luceeserver.atlassian.net/browse/LDEV-2052

As of now if you can unzip a entrypoint it will unzip it into your destination {destination}/{entrypoint} . However, everything in the {destination} directory will be deleted.

As I posted on the other ticket it would be great it this line:

https://github.com/lucee/Lucee/commit/58d7bc020e4c2690dd2218d2f515abbceecc0422#diff-e59c5fa4549e18de6be943907a50f597R442

if(target.exists() && overwrite) target.delete();

was changed to:

if(target.exists() && !target.isDirectory() && overwrite) target.delete();

That way you can unzip var entry points into the different zip into the same directory.

Thanks!

Environment

Luceee 5.3.2.77 on java 8

Activity

Show:

Pothys - MitrahSoft 21 February 2022 at 13:02

I've checked this ticket with the fixed version and the issue was solved. So I marked this ticket as deployed.

Tim Parker 2 December 2021 at 21:45

I just tripped on this in 5.3.8.206 - hope this fix gets released soon, as it’s potentially devastating

 

In my case, the victims weren’t directories - just files - and I’m lucky that this was in a test environment (I was investigating reports of CFZip crashing with a divide-by-zero exception when trying to extract zero-size files)

Fixed

Details

Assignee

Reporter

Priority

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Sprint

Affects versions

Created 27 January 2020 at 23:50
Updated 21 February 2022 at 13:02
Resolved 21 February 2022 at 13:02

Flag notifications