View RSS Feed

HiGame

Nasty Steam for Linux bug can wipe all your user files

Rate this Entry
by , 01-24-2015 at 02:59 AM (999 Views)
      
   

Over the past few years, Valve has built grassroots support and interest for alternate operating systems, including OS X and Linux, as well as its own version of the Linux operating system. Unfortunately, there are clearly bugs still to be worked out of the Linux variant, and a new problem can lead to Steam wiping all of a users’ files.

Here’s the problem: when Steam installs itself, it sets its own active directory to $STEAMROOT. If the user then moves the Steam directory, when the system attempts to run “rm -rf”$STEAMROOT/”*. This command tells the system to remove all subfolders and directories from STEAMROOT, including the STEAMROOT directory itself.

When that command fails to execute, typically because the end-user has moved the install directory to a different drive, the system interprets this failing as “rm -rf /”. For those of you not familiar with the Bash script, that command means “Delete everything on the hard drive.” Since Linux doesn’t give the userspace permission to touch core operating system files, the only thing that gets dumped is all the data in user-land. The command shouldn’t touch files on alternate hard drives, but since most user data is stored on the OS disk, the damage is enough to care about.
This bug was triggered when user Keyvin moved the Steam install directory, but attempted to create symbolic links (symlinks) between the STEAMROOT location and the new storage point.

The necessity of moving Steam folders


Steam collections are somewhat unique when it comes to moving data, and if I sympathize with the penguinistas on this point it’s because I’ve performed precisely the same kind of operation in Windows multiple times before. Today, you can simply create a new library location and add games to it, but in the Bad Old Days, moving a Steam install from one drive to another was something of a laborious process that involved a partial reinstallation of the application.



Copying your system folder and Symlinking it was a way to avoid going through the full reinstall process and it saved a great deal of time. It also made it easier to swap games between a small SSD and a large hard drive back when SSD costs were high enough that one could only reasonably fit a few games at a time.

Having performed this kind of operation without a second thought in Windows, it’s sobering to think that a scripting bug could destroy years of accumulates files in Linux. Even if you use an online backup service, erasing and then retrieving 50-70GB of data could take quite some time.
This latest bug comes on the heels of some rough hits for Steam — the Steam Machines project was delayed last year, and the company forced to institute region locking to prevent people from engaging in currency speculation via the collapsing Russian ruble. Valve has yet to respond to any requests for comments on this issue or provide guidance on a fix.


More...

Submit "Nasty Steam for Linux bug can wipe all your user files" to Google Submit "Nasty Steam for Linux bug can wipe all your user files" to del.icio.us Submit "Nasty Steam for Linux bug can wipe all your user files" to Digg Submit "Nasty Steam for Linux bug can wipe all your user files" to reddit

Tags: linux, steamroot Add / Edit Tags
Categories
Uncategorized

Comments