wow-addon-updater icon indicating copy to clipboard operation
wow-addon-updater copied to clipboard

Addons should always copy to a clean destination directory

Open grrttedwards opened this issue 5 years ago • 2 comments

In the situation where an addon has files A, B, C in version 1, then in version 2, it has filed B, C, D, then A will sit on the filesystem forever alone. The copy operation from zip.extract() will recursively overwrite any files with conflicts, but does not wipe the destination directory clean beforehand.

grrttedwards avatar Aug 17 '19 01:08 grrttedwards

Checking that the path that gets deleted is in the chosen directory for addons is probaly a good idea. We could do this by getting the os.path.realpath on the addon path and making sure that its starts with addon location. Just to avoid deleting folders outside the addon directory.

Hjaltesorgenfrei avatar Aug 17 '19 01:08 Hjaltesorgenfrei

The code which I thought closed this forgot about addons with many top-level folders. In that case, until a refactor can be done for the extraction code, this will stay open.

grrttedwards avatar Aug 25 '19 13:08 grrttedwards