MantisBT - VCMI
View Issue Details
0002673VCMILauncherpublic2017-05-04 10:312020-04-27 10:09
mickare 
SXX 
urgentcrashhave not tried
resolvedfixed 
LinuxUbuntu17.04
0.99 
1.next 
0002673: Uninstall mod wipes and removes all files from home directory
Short version:
I didn't run the game yet and started the vcmilauncher via terminal in my home directory. I installed some mods via the launcher, but then decided to uninstall one again. The uninstall failed and wiped my complete home directory.

Long version:
Thanks dudes, you are the best. Fortunately I have a one month old backup with all important files. But seriously...
I installed daily-builds vcmi via the ppa for linux. Run the vcmilauncher in my home directory and uninstalled a mod that I just had installed. The next moment my desktop environment goes crazy and then the launcher throws an exception and crashes. Some shock-seconds later I check my home directory and find nothing. Thanks for the data wipe.

Proposal:
- Do some sanity checks when deleting files.
- Or prompt with list of files for deletion.
- Or restrict on a specific folder.
1. Install vcmi via daily build ppa for linux.
2. Start vcmilauncher in home directory
3. Install mod
4. Uninstall mod
5. Hope you have a backup
I am not willed to try the reproducibility.
No tags attached.
has duplicate 0002680resolved SXX Removed my personal files 
has duplicate 0003116resolved Nordsoft Trying to uninstall the terrain mod WIPED my personal files in home 
Issue History
2017-05-04 10:31mickareNew Issue
2017-05-04 10:31mickareStatusnew => assigned
2017-05-04 10:31mickareAssigned To => Ivan
2017-05-08 15:24SXXAssigned ToIvan => SXX
2017-05-08 16:07SXXNote Added: 0007012
2017-05-24 23:24SXXRelationship addedhas duplicate 0002680
2017-05-25 00:09SXXNote Added: 0007034
2017-05-25 00:19SXXNote Added: 0007035
2017-05-25 00:19SXXStatusassigned => resolved
2017-05-25 00:19SXXFixed in Version => 1.next
2017-05-25 00:19SXXResolutionopen => fixed
2017-05-25 00:49mickareNote Added: 0007039
2017-05-25 00:54SXXNote Added: 0007040
2020-04-27 10:09SXXRelationship addedhas duplicate 0003116

Notes
(0007012)
SXX   
2017-05-08 16:07   
I'll investigate it ASAP. Though this is really weird since there was no changes in launcher in last few years and obviously nobody reported anything like that before.
(0007034)
SXX   
2017-05-25 00:09   
First I'm very very sorry I just forgot about this one and didn't fixed it straight away and in this case nothing I could post going to justify that... Sorry...

Postmortem: if mod installed and immediately removed without launcher restart then empty path is passed to QDir which usually mean user working directory on Linux. QDir::removeRecursively applied on it. I not sure when exactly that problem appear, but might be during some resource system refactoring since I can't believe it's here from the beginning.

I still can't understand at all how in year I didn't manage to wreck my own home directory. Probably I was just super lucky...
(0007035)
SXX   
2017-05-25 00:19   
Fix:
https://github.com/vcmi/vcmi/commit/5d8e943787666543df6b858c001ab4e59b09fe2d [^]
(0007039)
mickare   
2017-05-25 00:49   
No problem. That's one of those mystic errors that appear out of nothing with a big bang.
(0007040)
SXX   
2017-05-25 00:54   
This is certainly not appear out of nothing.

It's just insane to remove something recursively without prior check...