squentin / gmusicbrowser

jukebox for large collections of music
http://gmusicbrowser.org
GNU General Public License v3.0
194 stars 42 forks source link

[BUG][CRITICAL] Moving and renaming files if folder doesnt exist will delete the files #229

Open BeatLink opened 2 years ago

BeatLink commented 2 years ago

I just found a bug that could result in severe data loss. If you attempt to use the file renaming/moving system to move your library to a folder that doesn't exist or isn't writeable, the moving process will fail silently and the files will simply be deleted. Luckily I have a good backup system so I was able to restore but this bug should be looked into ASAP

squentin commented 2 years ago

Could you give a bit more details on what exactly you are doing to get this bug. I couldn't reproduce it with: multiple-files selected -> right-click -> mass-rename -> set it up to move them to a folder that is not writable. Also tried with the rename folder function from the folder tab. I get proper error messages. Though I found a crash when presenting the error dialog due to a function not existing in the gtk3 bindings (fix coming).

BeatLink commented 2 years ago

In my case, it was after a reinstallation on a new system with a different username. The folder option from the renaming system from the settings menu was pointed to /home/bob/Music but on the new system the home folder was /home/john/Music so /home/bob/Music doesnt exist and since /home is owned by root, couldnt even be created.

So if I attempted a move, with the setting still pointed to /home/bob/Music, the move would show as successful but then restarting gmusicbrowser will show all the files as gone, and checking the music folder will show the files gone as well