TR Member Perks!

If you’re a Linux user and a gamer, chances are you have Steam installed. But according to users on the GitHub page for the Linux version of Steam, Valve has a horrible bug in the current release that can cause a bash statement to return your entire home directory as a target for deletion.

Github user keyvin reported that moving his Steam directory, which by default is saved to /home/user/.local/steam, to run off of an external drive via a shortcut caused him to lose everything under ownership of his owner as well as the contents of a 3TB drive for backups.

“I am not sure what happened. I moved the folder in the title to a drive mounted under /media/user/BLAH and symlinked /home/user/.local/steam to the new location.

I launched steam. It did not launch, it offered to let me browse, and still could not find it when I pointed to the new location. Steam crashed. I restarted it.

It re-installed itself and everything looked great. Until 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.”

User pythoneer also found an older bug where “rm -rf “$STEAMROOT/”* could be evaluated as rm -rf “/”* if $STEAMROOT is empty”. For those unfamiliar with bash, rm is the command to delete a file, and –rf is a parameter that recursively force-deletes files and directories contained within.

keyvin repoted that the system in use was Ubuntu 14.04, with the target drive for Steam being formatted as NTFS. The author was able to successfully replicate this issue with the current version of Steam on Fedora 21 and was able to perform this on drives formatted as both NTFS as well as exFAT.

For now, the best way to avoid this bug is to avoid using any sort of link in place of the .steam directory. Valve has not officially commented on the bug, but given Gabe Newell’s numerous statements about SteamOS and Linux being a huge part of the future of Valve, as well as the attention this bug in particular is getting, this will likely be a priority for them. As always, TechRaptor encourages users to keep reliable backups of all files.

John Quilty

Staff Writer

I've been a lover of video games, writing, and technology for as long as I remember. I have a B.A. in English from the University of Illinois at Urbana-Champaign and I'm happy to write about gaming and technology for TechRaptor.

  • the problem seems to be a issue where the clients new directory is not being read right, so steam tries to guess where your telling it to go. But, because it isn’t aware of what’s not the right place to modify, steam ends up going everywhere

  • Ulp. That is one nasty bug. I might look into running Steam as a different user, just in case.

  • John Quilty

    It’s nasty, but you have to be creating a link to another directory to act as your Steam directory for it to happen. As far as I can tell, this isn’t present if you just leave it as /home/user/.local. I’m running Steam on Fedora natively (I did the above testing in a VM) but aren’t using shortcuts and I don’t feel the need to go as a different user.

  • Fair enough. My initial thought was that if they’re failing to check $STEAMROOT properly here, what else are they doing wrong? 🙂 I was really considering it more as a precaution, rather than a necessity.