1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

News Steam for Linux hit by file-deletion bug

Discussion in 'Article Discussion' started by Gareth Halfacree, 16 Jan 2015.

  1. Gareth Halfacree

    Gareth Halfacree WIIGII! Staff Administrator Super Moderator Moderator

    Joined:
    4 Dec 2007
    Posts:
    12,708
    Likes Received:
    1,977
  2. will_123

    will_123 Small childs brain in a big body

    Joined:
    2 Feb 2011
    Posts:
    1,060
    Likes Received:
    15
    that is a very bold '-rf'
     
  3. Gareth Halfacree

    Gareth Halfacree WIIGII! Staff Administrator Super Moderator Moderator

    Joined:
    4 Dec 2007
    Posts:
    12,708
    Likes Received:
    1,977
    Rule Number the First of Bash Scripting: Think really, really carefully about whether you want to use rm -rf (recursive and force-deletion) in your script, especially where there are wildcards or variable expansion.
    Rule Number the Second of Bash Scripting: If you thought carefully and the answer was 'yes,' get someone else to write the script for you. Go sit in the corner and think about what you've done.

    Remember Bumblebee? Guy wrote an install script which cleaned out old files when run. It was *supposed* to execute "rm -rf /usr/lib/nvidia-current/xorg/xorg". Trouble is, the author added a space - which was then committed and rolled out without testing. The command became "rm -rf /usr /lib/nvidia-current/xorg/xorg" - which turned "delete everything in and below the directory usr/lib/nvidia-current/xorg/xorg" into "delete everything in and below the directory /usr and the directory /lib/nvidia-current/xorg/xorg" Bye-bye, files.
     
  4. will_123

    will_123 Small childs brain in a big body

    Joined:
    2 Feb 2011
    Posts:
    1,060
    Likes Received:
    15
    I hadnt heard about bumblebee until I read the github posts about this bug. People in the github posts are pretty unhappy and i would say rightfully so. seems pretty poor bug if you ask me.
     
  5. schmidtbag

    schmidtbag New Member

    Joined:
    30 Jul 2010
    Posts:
    1,082
    Likes Received:
    10
    While this is a pretty nasty bug, I doubt there are too many people who are actually affected by this. Linux Steam users fall between 1-2%, of all linux users I'm sure 99% of them never used this reset command, and of the people who have probably didn't have enough of Steam missing to cause this problem. It wouldn't surprise me if less than 200 people were affected by this (though even that is still too much).
     
  6. Gareth Halfacree

    Gareth Halfacree WIIGII! Staff Administrator Super Moderator Moderator

    Joined:
    4 Dec 2007
    Posts:
    12,708
    Likes Received:
    1,977
    I'mma stop you there, to quote myself:
    In other words: you don't have to use the --reset-steam option to trigger the bug. In fact, if you follow the link to the original bug report you'll see that the reporter didn't use the option: he simply moved his Steam directory to a larger drive.

    You're absolutely right, of course, that Linux users represent a tiny minority of Steam's overall user base - but that's hardly an excuse for wiping out their systems with a schoolboy coding error.
     
  7. Woodstock

    Woodstock So Say We All

    Joined:
    10 Sep 2006
    Posts:
    1,783
    Likes Received:
    2
    It may have been the Hacker News thread about this, but similar things have happened with steam on windows.

    Rule number 3 of Bash Scripting, make the interperter stricter about what it will allow

    #!/bin/bash
    set -o nounset #traps on useing undefined variables (would have prevented this bug from doing damage)
    set -o errexit #traps on unhandled programs called that fail
    set -o pipefail #treats any failed program of pipeline as an overall failure
     

Share This Page