SoylentNews
SoylentNews is people
https://soylentnews.org/

Title    rm -rf / Considered Harmful, to Steam Users
Date    Friday January 16 2015, @01:55PM
Author    LaminatorX
Topic   
from the no-shortcuts dept.
https://soylentnews.org/article.pl?sid=15/01/16/120248

FatPhil writes:

If you're a Steam user — beware, even slight modifications of your system may result in the nuking of your home directory, and more!

Fortunately, as the entry point for the user is a shell script (bash, but that's another story), it's been quite easy to find the source of the problem, the lack of sanitising shell variables before passing them to potentially dangerous commands — in this case, “rm -rf "$STEAMROOT/"*'”. The commit that introduced the bug also seems to have contained a remarkably apt comment ``#Scary!'' (it's not clear that the repo being pointed to, and its commits, mirror exactly the same commits as Steam themselves would have added them.)

It seems that even on MS Windows, Steam gets a bit over-eager about deleting files it doesn't own.

As a software engineer, who's also been a package maintainer on huge projects with up to 70 engineers wanting to force patches into my tree, I've become hyper-attuned to the concept of asking "what could possibly go wrong" (and having a mindset like Bob the Bastard from the animated Dilbert series), and consequently for demanding small readable patches which do just one small thing that's trivial to review. Would the patch have passed review? How confident are you about the quality of the rest of the code if things like this can slip through?

Links

  1. "FatPhil" - http://reversethis-if.fdsatatnelyos-cp/
  2. "rm -rf "$STEAMROOT/"*" - https://github.com/ValveSoftware/steam-for-linux/issues/3671
  3. "deleting files it doesn't own." - https://support.steampowered.com/kb_article.php?ref=9609-OBMP-2526

© Copyright 2024 - SoylentNews, All Rights Reserved

printed from SoylentNews, rm -rf / Considered Harmful, to Steam Users on 2024-05-23 07:04:23