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

was changed to:

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:
Matt Levine
January 29, 2020, 1:26 AM
Edited

Here’s a unit test . I don’t think my suggest fix is correct. I tried a few things and have been able to figure it out yet.

I think the key is that I’m zipping into the same directory twice with overwrite=true. It seems to be deleting files that don’t match the entrypath filter. I think the expectation is that it would only affect files within the entrypath.

 

Pothys - MitrahSoft
February 13, 2020, 4:08 PM

I've checked this & can able to reproduce it when as per your test case but additionally I added an extra one unzip condition. So, then only I've facing same issue as what you've faced. But, if we add ( !target.isDirectory() ), directory doesn't delete. This problem was solved. And if that directory has any file means, it'll be deleted. But, ACF works fine. will confirm about this issue.

Damien
July 31, 2020, 2:17 PM

This issue and the related workaround have caused a regression in Mura, see Mura issue 3190.

Zac Spitzer
October 25, 2020, 12:52 AM

Pothys - MitrahSoft
November 24, 2020, 2:07 PM

, I've checked this issue with PR. It works fine as expected.

Assignee

Michael Offner

Reporter

Matt Levine

Priority

Major

Labels

Fix versions

None

Affects versions

Configure