Jump to content

steam bug involving rm -fr /*


nelsoncs
 Share

Recommended Posts

Just wanted to give a heads up for linux users, the bug is still open and this could potentially be a big disaster:

 

http://www.theregister.co.uk/2015/01/17/scary_code_of_the_week_steam_cleans_linux_pcs/

 

and:

 

https://github.com/ValveSoftware/steam-for-linux/issues/3671

 

 

"...remove all files recursively, and without stopping, from the root directory down. Assuming the client is run as a normal user, it will delete everything owned by that account – including mounted backup drives and network shares – although leave other stuff, such as system files owned by root, intact."

 

Please see line #468 of .steam/steam.sh (at least that is the line # in my current version).

Link to comment
Share on other sites

That is interesting, because I had mine set up that way before (with the symlink) and it worked fine. Although I kept the bulk of the Steam installation on the original drive. I had just moved the steamapps folder to another drive and sym linked it to the Steam installation folder.

 

There is also a setting within the Steam UI (Settings -> Downloads) to manage multiple game libraries across multiple drives. I wonder if that is safer.

"The only true wisdom is in knowing you know nothing." ~ Socrates

Link to comment
Share on other sites

It looks like this is only going happen if you invoke the "reset_steam()" function in the script. So, definitely don't use the --reset commandline option, or try to move your steam directory and then symlink it at the old location (which is what the bug originator reported doing).

 

I myself have commented out the offending line and plan to check for my change being overwritten with each update. Don't know if this will actually serve as protection. But, if this causes a problem before this is patched, it seems better than risking my entire user dir being wiped.

Link to comment
Share on other sites

Right here.

 

http://store.steampowered.com/news/15512/

 

You can check your steam.sh file to see if you have it already. The naughty line now checks if $STEAMROOT is empty.

 

# Check before removing
if [ "$STEAMROOT" != "" ]; then
rm -rf "$STEAMROOT/"*
fi

will still fail if $STEAMROOT is one of

  • .. ( optionally with /.. added ad-nauseum )
  • one or more spaces
  • ~

and properly a host more

 

readlink -m $STEAMROOT

 

or realpath if available on the system side steps this issue by resolving the actual path first and then you can see if your someplace stupid like root, the root of your user dir ( ~ ) etc...

 

not sure how to alert value to the problem tho

System:

Linux Mint 17 ( = Ubuntu 14.04 with cinnamon desktop ) Ubuntu 14.04, AMD HD 6850, i5 2500k

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...