Steam For Linux’s Single Line Of Script That Deletes All Your Stuff

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 FilesSteam, 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.

Moved ~/.local/share/steam. Ran steam. It deleted everything on system owned by user. [GitHub, via PC World]


The Cheapest NBN 1000 Plans

Looking to bump up your internet connection and save a few bucks? Here are the cheapest plans available.

At Kotaku, we independently select and write about stuff we love and think you'll like too. We have affiliate and advertising partnerships, which means we may collect a share of sales or other compensation from the links on this page. BTW – prices are accurate and items in stock at the time of posting.

Comments


4 responses to “Steam For Linux’s Single Line Of Script That Deletes All Your Stuff”