The PC gamer's nightmare: Waking up one day to find your PC is barren of content. All your photos, games and other important data given the digital go-ahead to stop existing. A shoddy platter, virus or surge could be responsible, but no one would ever suspect Steam. Well, it's more likely than you think for Linux users, going by a disastrous bug recently discovered with Valve's software.
The issue was uncovered two days ago by user "keyvin", and reported on Steam for Linux's GitHub repository. After moving their Steam folder to another directory, keyvin fired up the program, only for it to crap out. Steam then reinstalled itself and everything "looked great", until keyvin realised that the program had rather thoroughly cleaned up his hard drive:
...I looked and saw that steam had apparently deleted everything owned by my user recursively from the root directory. Including my 3tb external drive I back everything up to that was mounted under /media.
The report states that it's likely not a "common problem", but upon further investigation it seems the script responsible "does something in a really, really stupid way". You'd think Valve would be a little more careful when it came to deleting things... but no.
Here's where the issue occurs:
rm -rf "$STEAMROOT/"*
To put it simply, the code relies on the variable "$STEAMROOT" to contain the user's Steam directory. If, for some reason, that variable isn't populated correctly (the user has an atypical configuration or has moved their Steam folder) then the variable would be empty and the
rm -rf command — essentially a "nuke from orbit" delete — would hit up the root directory instead and well... you can figure out the rest.
The thing is, the Windows version of Steam is a little blasé too. In the right (or wrong) circumstances, uninstalling the software can also delete things it shouldn't:
Warning: The uninstallation process deletes the folder Steam was installed to to ensure it is fully uninstalled. If you accidentally installed Steam to a folder containing other data, for example C:\Program Files\ instead of C:\Program Files\Steam\, STOP! Do not run the uninstaller and instead carefully follow the instructions below for Manually Removing Steam, except only delete Steam-related files in step 3.
Of course, in the case of Linux, simply moving a folder for a non-critical piece of software should never run the risk of wiping data. It looks like someone from Valve has been assigned to the issue, so hopefully it'll be resolved soon.