Slashdot Mirror


Steam For Linux Bug Wipes Out All of a User's Files

An anonymous reader sends a report of a bug in Steam's Linux client that will accidentally wipe all of a user's files if they move their Steam folder. According to the bug report: 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. Another user reported a similar problem — losing his home directory — and problems with the script were found: at some point, the Steam script sets $STEAMROOT as the directory containing all Steam's data, then runs rm -rf "$STEAMROOT/"* later on. If Steam has been moved, $STEAMROOT returns as empty, resulting in rm -rf "/"* which causes the unexpected deletion.

329 comments

  1. When I see that [literaly] textbook mistake.... by Art+Popp · · Score: 5, Funny

    I can hear the Steam dev. shop manager:

    Carl! Put the bullhorn down! Dave! Quit staring at Lucy and get back to wark! Kevin! We have to ship this code in TWO DAYS! Jerry! Don't point that over here!

    1. Re:When I see that [literaly] textbook mistake.... by binarylarry · · Score: 5, Funny

      Larry! Quit sniffing glue and get back to writing that steam root mover script pronto!

      --
      Mod me down, my New Earth Global Warmingist friends!
    2. Re:When I see that [literaly] textbook mistake.... by TomTraynor · · Score: 5, Informative

      Really? Really doing a delete and you don't check the existence of the folder before you start? I am not a Unix/Linux scripting expert (just a very dangerous amateur), but, I always test to see if the directory is there before I even start my scripts. If the folder isn't there the script screams, rants and raves to the console and then stops before it even starts processing. Common code I do for most Z/OS BASH scripts at the start before I even run the rest of the script:

      1. Is the folder(s) there that I need.
      2. Do I have the proper access to the folder(s)/file(s).

      If either two fail I dump to the console full information on what happened and what I think should be done to fix the problem.

      It is a common set I use ->

      Directory test:

      if test -d $1
      then
          exit ;
      else
          uExit=128
      fi;

      File existence check:

      if test -f $1
      then
          exit ;
      else
          uExit=128
      fi;

      Can I read the file:

      if test -r $1
      then
          exit ;
      else
          uExit=128
      fi;

      Not pretty, probably can be coded better, but, this works for me and saved my ass a few times.

      --
      Panic now, beat the rush!
    3. Re:When I see that [literaly] textbook mistake.... by houghi · · Score: 5, Funny

      The driectory / existed

      --
      Don't fight for your country, if your country does not fight for you.
    4. Re:When I see that [literaly] textbook mistake.... by TomTraynor · · Score: 5, Insightful

      Yep, but, they should test to see if the variable has a value. I remember vaguely that I tested for something like that by appending a value to the end saving it to a new variable and then testing both the original and new and if the same it was null.

      --
      Panic now, beat the rush!
    5. Re:When I see that [literaly] textbook mistake.... by HetMes · · Score: 1

      ...said the guy who's obviously never worked in a production environment.

    6. Re:When I see that [literaly] textbook mistake.... by Anonymous Coward · · Score: 5, Insightful

      if [ -z "$STEAMROOT" ] ; then echo 'you fucking idiot what are you doing'; fi

    7. Re:When I see that [literaly] textbook mistake.... by Z00L00K · · Score: 1

      The only remedy would be to have a specific gaming account.

      Then only files which that account had write access to would have been in danger.

      Even better is to run under 'chroot' to protect from such mistakes. 'chroot' isn't perfect, but at least it makes it harder to mess up.

      --
      If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
    8. Re:When I see that [literaly] textbook mistake.... by Anonymous Coward · · Score: 0

      Obviously that is not a sufficiently strict test. You look for a characteristic file that has to be in that folder if it is indeed a Steam folder, and if that's not there, then it's not a Steam folder and you do nothing to it.

    9. Re:When I see that [literaly] textbook mistake.... by Anonymous Coward · · Score: 0

      I think the larger problem was that the user was running as root, or had given overly permmissive conditions that allowed for this.

      That said, who the f*** ever does rm -rf ? That is textbook stupidity.

      You should always assume that any command that you can type at the command line may be truncated (either hitting enter before typing it completely, or a distraction), the problems are often compounded by scripts that make assumptions of where the script is located (frequently done by cron jobs.)

      SQL is a great example of how to do stuff wrong and survive. If you value your data you can rollback, if the database is in transaction mode. If it is not in transaction mode, then you're living dangerously. But even then, any time I type an UPDATE command, the first thing I type is the WHERE clause, so that even if I make an error, I don't end up changing all the rows in the database.

    10. Re:When I see that [literaly] textbook mistake.... by Anonymous Coward · · Score: 0

      I quit the last production environment I was in for this reason. “Quality is free, but only to those who are willing to pay heavily for it.” Tom DeMarco

    11. Re:When I see that [literaly] textbook mistake.... by zifferent · · Score: 5, Informative

      Root? No. It deleted his home folder. Don't need root for that. Any user can raze their own home folder.

      --
      cat sig > /dev/null
    12. Re:When I see that [literaly] textbook mistake.... by MachineShedFred · · Score: 1

      how about:

      if [ ! -z "$STEAMROOT" ]
      then...

      --
      Slashdot still doesnâ(TM)t support Unicode after it was added to the HTML standard in 1997.
    13. Re:When I see that [literaly] textbook mistake.... by Trepidity · · Score: 5, Interesting

      Does show a longstanding problem with the Unix security model, though: nothing more fine-grained than per-user permissions. There's no reason Steam should be able to delete (or even read) anything in my home directory other than its own files, but the only real way to keep it from doing so using straight Unix permissions is to create a new local user for every application.

    14. Re:When I see that [literaly] textbook mistake.... by Anonymous Coward · · Score: 2, Informative

      It also deleted everything on his mounted external hard drive.

    15. Re:When I see that [literaly] textbook mistake.... by Anonymous Coward · · Score: 0

      [ "${dir:-DUH}" = "DUH" ] && echo "Hey dumbass, you fucked up." && exit 255

    16. Re:When I see that [literaly] textbook mistake.... by Anonymous Coward · · Score: 5, Informative

      That's not a problem with the model, you should own everything in your home directory. One of the irritating things about Windows is that you can't necessarily delete all the files. Some of the files aren't deletable no matter what account you use, even being admin won't work.

      In this case, giving the directory it's own Steam UID ownership would prevent Steam from deleting things that it shouldn't be deleting. You can then have the user be a member of the group that Steam belongs to and give that group the ability to change permissions. At which point, the desired behavior is easy and undesired behavior is much harder.

      Why it is that people still have these kinds of issues is beyond me, the traditional model handles things like this without much trouble, as long as you actually know what you're doing.

    17. Re:When I see that [literaly] textbook mistake.... by Anonymous Coward · · Score: 0

      Except it becomes SUPER annoying.

      You'll be shoehorned into using specific folders for files. The permission restricts you place on steam will also affect, say, Word. It would be unable to read or save files not in a specific folder. Take a look at i devices - you can't share content between programs without the programmer explicitly allowing it (and who knows if you can even use content types that are less common like OpenOffice files...)

      You could probably put a prompt up to tell the user that it's requesting additional permissions to do stuff, but the common end user will just simply click yes.

    18. Re:When I see that [literaly] textbook mistake.... by Anonymous Coward · · Score: 1

      Am I the only one that has a separate user for steam? I would think most people would want to restrict access to applications they don't trust.

    19. Re:When I see that [literaly] textbook mistake.... by phantomfive · · Score: 1

      If the programmer had just left of the /* this wouldn't have happened.

      --
      "First they came for the slanderers and i said nothing."
    20. Re:When I see that [literaly] textbook mistake.... by whoever57 · · Score: 1

      [ -z "$STEAMROOT" ] && echo "stop right now!" # no need for if ..then.

      --
      The real "Libtards" are the Libertarians!
    21. Re:When I see that [literaly] textbook mistake.... by Kiwikwi · · Score: 1

      if [ ! -z "$STEAMROOT" ] then...

      ! -z is the same as -n; though personally, I find it more readable to elide the "-z" and "-n" test operators entirely:

      if [ ! "$STEAMROOT" ]; then echo "BAD BAD BAD"; exit 1; fi

      or

      if [ "$STEAMROOT" ]; then rm stuff; fi

      (And yes, this still works if $STEAMROOT starts with a dash.)

    22. Re:When I see that [literaly] textbook mistake.... by ejasons · · Score: 5, Insightful

      OSX sandboxed apps cannot look outside of their own directories. However, when the user chooses a file via the "Open" dialog, the application is given a handle that allows it to open just that particular file. Sandboxing really is the solution to this kind of mess...

    23. Re:When I see that [literaly] textbook mistake.... by Anonymous Coward · · Score: 0

      Only if I could get rid of Origin that easy.

      Captcha: Useful

      You bet your ass it would be.

    24. Re:When I see that [literaly] textbook mistake.... by Anonymous Coward · · Score: 0

      BTW, echoing stop right now, does not actually stop anything. you know that, right?

      the best thing that can be said about your snippet is that at least your comment will in fact not get executed.

    25. Re:When I see that [literaly] textbook mistake.... by Anonymous Coward · · Score: 0

      Which was linked in his home directory and owned by the same user.

    26. Re:When I see that [literaly] textbook mistake.... by Anonymous Coward · · Score: 0

      how bout we actually stop it...

      [ -z "$STEAMROOT" ] && echo "WHAT THE FUCK" && exit 255

    27. Re:When I see that [literaly] textbook mistake.... by Anonymous Coward · · Score: 0

      > Root? No. It deleted his home folder. Don't need root for that. Any user can raze their own home folder.

      According to the summary, it deleted everything owned by his UID, whether it was in his home folder or not!

    28. Re:When I see that [literaly] textbook mistake.... by Anonymous Coward · · Score: 0

      I guess you haven't heard of unix groups.

    29. Re:When I see that [literaly] textbook mistake.... by Anonymous Coward · · Score: 0

      But the directory "" did not exist, which is the issue. They should have checked that it existed before concatenating it with "/*". Yes, hindsight is 20/20, but this is something I expect* any programmer to pick up by foresight. When you have an important precondition you really should test it - especially before passing it as an argument to rm -rf

      * note the "expect" is very different to "anticipate"

    30. Re:When I see that [literaly] textbook mistake.... by angel'o'sphere · · Score: 1

      Would not have helped much, as the directory did exist, otherwise 'rm $something' had not deleted anything ...

      Yes, it can be coded better by simply writing "exit 128" instead of uExit = 128.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    31. Re:When I see that [literaly] textbook mistake.... by Anonymous Coward · · Score: 1

      I think SELinux may prevent this sort of thing. Most modern distros have it enabled by default. Most users then disable it by default.

    32. Re:When I see that [literaly] textbook mistake.... by Anonymous Coward · · Score: 0

      if [ -z "$STEAMROOT" ] ; then echo 'you fucking idiot what are you doing'; fi

      Good start.... but it really should have been:

      if [ -z "$STEAMROOT" ] ; then
              echo "what he said..."
      else
              cd $STEAMROOT
              currentdir=`pwd`
              if [ "$STEAMROOT" != "$currentdir" ] ; then
                      echo "cd FAILED!"
              else
                      echo "do yo' thing!"
              fi
      fi

      NEVER, EVER assume that cd always works without fail. Who knows? Maybe $STEAMROOT got corrupted, had embedded spaces, or whatever in it. I mean, it might not be zero length, but might be "/[whitespacehere]/home//steam". Whaddya think 'cd /[whitespacehere]/home//steam' is going to do with that command? Succeed. And where does that leave you? At the root directory.

      BEFORE REMOVING TONS OF SH*T - ALWAYS MAKE SURE YOU COMPARE YOUR RESULTING WORKING DIRECTORY AGAINST WHAT YOU *THOUGHT* YOU WERE GOING TO CHANGE TO. Do not assume.

    33. Re:When I see that [literaly] textbook mistake.... by Anonymous Coward · · Score: 0

      Yup. there needs to be some sort of 'sub-user' model. Each app is assigned a sub-user, and a user is effectively 'root' to their set of sub-users.

      And on it should go. Sub-users should be able to create further sub-users, etc. (Example use-case: root > user > app store > apps > subapps...). We should never have stopped at root+users. Because...

      Big fleas have little fleas,
      Upon their backs to bite 'em,
      And little fleas have lesser fleas,
      and so, ad infinitum.

      http://en.wikipedia.org/wiki/The_Siphonaptera

    34. Re:When I see that [literaly] textbook mistake.... by david_thornley · · Score: 2

      Which is why always-online drives with no special protection are a dumb idea for backups.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    35. Re:When I see that [literaly] textbook mistake.... by greg1104 · · Score: 3, Insightful

      Checking if STEAMROOT is an empty string is a good start, but it's still not enough. Anything that's unleashing something as dangerous as "rm -rf" should do a serious sanity check first. Looking at the text name of the directory, seeing if it's really a directory, or seeing if you can cd into it (and the output from pwd still matches) are all useful checks. But you will still find edge cases where they do terrible things in the real world.

      As an example of something more robust, PostgreSQL does what it can to deal with this problem by having a file named PG_VERSION in every installed database directory tree. All utilities that do something scary take the directory provided and check to see if there's a PG_VERSION file in there. If not, abort, saying that the structure expected isn't there. Everything less complicated than that occasionally ate people's files. A common source of trouble here for database servers is when there was a race condition against a NFS mount, so that it showed up in the middle of when the script was running.

      When you stare at that sort of problem long enough, no check for whether your incoming data is sensible is good enough. You must looking for a positive match on a "I see exactly the data I expect" test of the directory tree instead, before wiping out files in particular. Even the level of paranoia in Postgres is still not good enough in one case. It can wipe things if you run the new database initialization step and hit one of those mount race conditions. For that reason, the initialize database setup is never run in the init scripts anymore, no matter how many complaints we get that it should be automatic.

      I first saw this class of bug in IBM's Directory software, in its RPM uninstaller. It asked RPM what directory the software was installed in, then ran "rm -rf $INSTALLDIR/data". Problem: RedHat 8.0 had a bug where that RPM query returned nothing. Guess what was in /data on the server? That's right, the 1TB of image data that server ran against. (And to put the scale of that into perspective...this was 2003, when 1TB was not a trivial amount)

    36. Re:When I see that [literaly] textbook mistake.... by thogard · · Score: 1

      or make use of &&

      cd /tmp && cd $SOMEPLACE && do_dangerous_work

      Of course having code do rm * tends to question why they don't know which files they need to purge in the 1st place.

    37. Re:When I see that [literaly] textbook mistake.... by Anonymous Coward · · Score: 0

      and we can blame Microsoft for that.

    38. Re:When I see that [literaly] textbook mistake.... by PrimaryConsult · · Score: 1

      Isn't selinux's whole purpose is to solve this exact problem?

      Any yet I get a lot of flak whenever I try to even enable it in "permissive" mode (as opposed to outright disabled) so I can at least audit when applications are trying to do things to files they shouldn't...

    39. Re:When I see that [literaly] textbook mistake.... by Blaskowicz · · Score: 1

      A bit weird that bash and sh don't have the $cwd variable (csh does)

    40. Re:When I see that [literaly] textbook mistake.... by Anonymous Coward · · Score: 0

      If by "this kind of mess" you mean the entire concept of Unix, sure. The entire point of the Unix design is to allow knowledgeable users to manipulate data in arbitrary ways, based on the assumption that this will allow them to do useful things. Sandboxing everything would certainly get rid of Unix.

      There have been a bunch of efforts recently, some obnoxiously successful, to cut the Unix out of Linux based on the presumption that the needs uninformed Desktop users should take precedence over the needs of the people who build infrastructure. Assuming we want to keep things like the Internet, weather forecasting, financial institutions, Universities, and warehouses (to name a few areas where either I or someone I know has found Unix irreplaceable), we're going to have to stop that.

      1. Keep a backup.
      2. If you develop software, make sure your code-review process is good enough not to let accidental attempts to delete the entire host machine slip into production. There's a major design flaw here, but it's not Unix.

    41. Re:When I see that [literaly] textbook mistake.... by brantondaveperson · · Score: 1

      And yet.. OS X is UNIX and it sandboxes applications. It doesn't appear to sandbox command line tools though, and perhaps a more knowledgeable reader can explain how it all hangs together?

    42. Re:When I see that [literaly] textbook mistake.... by Anonymous Coward · · Score: 0

      POSIX ACLs have existed for a very long time.

      Look at the man pages for setfacl and getfacl. The thing is, that old style perms are usually sufficient, but when they are not, (of course), there are other options.

      ACLs would not have done a damn thing to prevent what happened here. The user had rights to delete the files the user owned. Yeah, that is pretty much how it is supposed to work.

    43. Re:When I see that [literaly] textbook mistake.... by MikeBabcock · · Score: 1

      There's nothing stopping you from creating a steam user and executing steam as that user with sudo.

      --
      - Michael T. Babcock (Yes, I blog)
    44. Re:When I see that [literaly] textbook mistake.... by Anonymous Coward · · Score: 2, Interesting

      Maybe because I don't want 300 users on my system, where each little application and widget has to add another group and user to the system. If my home directory were to contain files owned by hundreds of throwaway user accounts, I would not be happy.

      This is exactly where application sandboxing comes into play. The operating system needs to be built to keep an application within proper bounds. Not only good for removing permission clutter, but also heavily improves security at the cost of the inconvenience of having to grant an application explicit permission to operate on files outside its own sandboxed file structure.

    45. Re:When I see that [literaly] textbook mistake.... by Anonymous Coward · · Score: 0

      True, but it's not like nothing more fine-grained than per-user permissions is all that's available on most any modern Linux distro. Some examples off the top of my head that provide more than this::

      1) SELinux
      2) chroot
      3) ACLs

      All of these are available on the Fedora box I'm typing this on.

    46. Re:When I see that [literaly] textbook mistake.... by Barsteward · · Score: 2

      This should have been picked up in testing.......... looks like they didn;t do much

      --
      "The hands that help are better far than lips that pray." - Robert Ingersoll (1833-1899)
    47. Re:When I see that [literaly] textbook mistake.... by Anonymous Coward · · Score: 0

      Thanks for posting this. For a couple of years I've felt like I was the only person in the world to realize such a thing was possible. Now there are two of us, so I'm not alone. Yay!

    48. Re:When I see that [literaly] textbook mistake.... by rdnetto · · Score: 1

      And we already have the solution too - the one guy who was running it under SELinux got an error message instead of a wiped system.
      (He also appears to be the one responsible for the bug in the first place...)

      --
      Most human behaviour can be explained in terms of identity.
    49. Re:When I see that [literaly] textbook mistake.... by AmiMoJo · · Score: 1

      Why would scripts even be able to read / though? On some systems, such as Android, apps are not allowed to read the root filesystem, or in fact anything outside of their own directory without permission.

      --
      const int one = 65536; (Silvermoon, Texture.cs)
      SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
    50. Re:When I see that [literaly] textbook mistake.... by omnichad · · Score: 1

      But even unmounting the drive after the backup runs would be better than this.

  2. And that people... by omfg-no · · Score: 5, Insightful

    Is why you have backups. You need to apply the rule Total Backups = Total Backups -1 so if you have 1 you have 0.

    1. Re:And that people... by beelsebob · · Score: 5, Insightful

      And also, why redundancy is not backup. If your backup is plugged in and/or mounted, it's not a backup any more.

    2. Re:And that people... by MetalliQaZ · · Score: 5, Insightful

      so if you have 1 you have 0.

      Dude, what does that even mean? Backups have to be done intelligently based on your situation. In the summary, the user had an external hard disk on USB which would have protected against primary HD failure, but not against common mode failures such as a fire at home or a compromised PC. He didn't protect himself against malicious code, and got burned. The raw number of backups don't matter if you're not paying attention to what you are and are not protecting against.

      --
      "Here Lies Philip J. Fry, named for his uncle, to carry on his spirit"
    3. Re:And that people... by CanHasDIY · · Score: 5, Insightful

      Did you read the part where it also erased his backups?

      I think the moral here is, don't leave your backup drive plugged in when you're not running backups.

      --
      An enigma, wrapped in a riddle, shrouded in bacon and cheese
    4. Re:And that people... by Anonymous Coward · · Score: 0

      Lazy meets a bug.

      It is not a reasonable disaster recovery backup if it is directly connected to and accessible from the system you are backing up!

      The external usb disk hung off the back of the computer permanently covers the single failing hard disk case.

      It doesn't help in the case of lightning strikes, fire, theft, viruses, software bugs, etc.

      Just Duh! Isn't slashdot supposed to be geeks?

    5. Re:And that people... by jeffmflanagan · · Score: 4, Informative

      It can't erase backups. Backups are offline. He imagined that an attached hard drive was backup. It is not.

    6. Re:And that people... by beelsebob · · Score: 2

      They were not backups. If they're plugged in, they're merely redundancy.

    7. Re:And that people... by f3rret · · Score: 4, Funny

      Is why you have backups. You need to apply the rule Total Backups = Total Backups -1

      so if you have 1 you have 0.

      So...apparently I have -1 backups, does this mean I owe the universe a backup?

      --
      Admit nothing. Deny Everything. Make Counter-accusations.
    8. Re:And that people... by CodeReign · · Score: 1

      I have Linux. I use deja dupe :)

      one month later (20 Tb)

      I have Linux. I use deja dupe :(

    9. Re:And that people... by mwvdlee · · Score: 4, Interesting

      It is. It just protects against fewer problems.

      Every type of backup method has drawbacks and benefits.
      If there existed a perfect backup method, we would have only that method.

      Redundancy makes it very easy and fast to recover data, but lacks security against localized physical problems and malicious software. It would be a perfectly valid first layer of backup and sufficient for backing up reproducable information such as downloaded/scanned/ripped media. It protects against accidentally deleting files or hardware problems. For less easily reproducable information you probably want some additional backup layers.

      --
      Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
    10. Re:And that people... by Anonymous Coward · · Score: 0

      Sorry, but I beg to differ. This has fuckall to do with backups, and here's why!

      As a long time linux user, occasionally with foss programs and their user directories, things go wonky. Be it a new version bug, or corrupted file from improper program closure, directories and files go wonky. That is, or was for a while, just how things were in the linux desktop program world. For a long time, the solution would often be, 'rm or mv ~/.$prog-conf' problem directory, and let it create a fresh one upon relaunch, to see if that fixes the issue. This behavior should be fairly obvious to anyone programming for, or heavily using, a desktop linux environment. That the developers didn't consider, what I would argue is a VERY common 'attempt to fix' a programs user conf. issues, speaks to 2 things in my mind:

      1. that Steam developers really haven't been using and troubleshooting desktop linux environments that long, or if so, haven't thoroughly tried to break things in their Q/A
      2. that Steam management and developers, while steering the online gaming marketplace, haven't put enough resources into beta and Q/A.

      Sorry, but NO 3rd party PROGRAM, much less a gaming interface, should be capable of 'rm -Rf /'. That is an absolutely HORRIBLE, VERY ROOKIE, programming mistake!

    11. Re:And that people... by houghi · · Score: 2

      I have a PC and a NAS. The NAS holds the data, so it is accessible for other devices. It also has one HD for (incremential) backups for the PC.
      Most of the data on the NAS is music, images and movies.

      I have these backed up to my PC with rsync.
      The backup HD on the NAS is mounted read-write only for root during backup. Otherwise it is read-only.

      The backup-HDs for media on my PC are only mounted during backup. Otherwise they are unmounted.

      So even though they are not unplugged, they are either read-only or not mounted. Also data is available on two devices. So even if one explodes, the other is still there. No, I do not do offsite backup. If my house burns down, I have bigger issues then data.

      In each users directory I have ~/backup/ point to /media/backup/latest/home// so that I can easily get a file back I deleted because human error (99.9% of why you need a restore) with just `cp backup/file.txt ~/.` or do it with mc or anything else.

      And what I read is that he did have his backup directories read-write for the users. Read-only for everybody, except root should be the obvious way.

      --
      Don't fight for your country, if your country does not fight for you.
    12. Re:And that people... by BarbaraHudson · · Score: 4, Insightful

      They can be plugged in but not mounted. in such a case, rm -rf / won't touch them. Only mount the disk when doing a backup, then unmount it again, problem solved.

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    13. Re:And that people... by Anonymous Coward · · Score: 1

      Yes, that's exactly what it means. Make a backup. You owe it to the universe.

    14. Re:And that people... by Anonymous Coward · · Score: 0

      It protects against accidentally deleting files or hardware problems.

      No, it doesn't necessarily protect against hardware problems.

      I once had a power supply fail catastrophically such that it fried the electronics on (amongst other things) the boards on all three drives in the box. Litererally exploded chips and vaporized circuit traces. I managed to recover one drive because I happened to have an identical model that was not in the machine, and could swap out the board. The others, no such luck. I now make sure I duplicate to a completely different machine, in a different part of my house (and I recognize that's still not going to help me if the house takes a lightning strike or burns down, so I do off-site backups of my really critical stuff too.)

      I also don't buy cheap power supplies any more.

    15. Re:And that people... by rwa2 · · Score: 2

      Nice setup. I'd go a step further and buy a HD for a trusted friend and rsync a snapshot of my home dir to their box, gnupg encrypted if you want.

      There's also AWS Glacier that I use for semi-annual dumps for photo archives and other things that don't change. The SAGU java client is relatively straightforward, and I save the manifest in 1-2 cloud storage services. I think 10GB worth of stuff is costing me about 47 per month... most of the cost is just incurred during retrieval, so it's a pretty good deal for data insurance.

    16. Re:And that people... by rwa2 · · Score: 1

      47 (cents), /. ate my unicode

    17. Re:And that people... by Anonymous Coward · · Score: 0

      No, I do not do offsite backup. If my house burns down, I have bigger issues then data.

      For most data I'd agree. If you've got financial data or (as in my case, since I'm a writer) other files essential to your livelihood, at least throw them on a (encrypted!) thumb drive and put it in your pocket when you go out. House burns down*, you've still got it.

      *Or other disaster. Having an upstairs toilet valve fail, causing a flood that ends up pouring water and collapsed ceiling drywall all over your computer probably isn't very good for the disk drive either. Or just having someone break in and steal your computer. Lots of things can make your files disappear. An offsite backup (or at least partial backup) can save a lot of grief.

    18. Re:And that people... by hawguy · · Score: 2

      So even though they are not unplugged, they are either read-only or not mounted. Also data is available on two devices. So even if one explodes, the other is still there. No, I do not do offsite backup. If my house burns down, I have bigger issues then data.

      Depends what that data is -- when my sister lost her house in a fire (even the fire safe melted, all that was left was the fireplace and half of the 1920's era cast iron stove), she lost a *lot* of irreplaceable photos that she had scanned in over the years. Hundreds of old family photos dating back nearly 100 years -- she had the originals carefully packed away for safe keeping. Fortunately, most of her more recent photos were also stored in online photo albums so those were saved.

      She was smart enough to keep a photo record of the more expensive items in her house... also on her computer, so that was lost too, but at least she emailed the spreadsheet to herself (not as backup but so she could edit it while traveling).

      Her "backup" for everything was keeping a copy of everying on her laptop computer, which was also in the house.

      Of everything she lost in that fire, the photos are the things she misses most -- and those would have been trivial to keep safe through any cloud based backup service. (or her own offsite backup by shipping hard drives or DVD's, but that requires more discipline to keep current)

    19. Re:And that people... by Anonymous Coward · · Score: 0

      No, I do not do offsite backup. If my house burns down, I have bigger issues then data.

      For most data I'd agree.

      There is another way to look at it.
      If my house burns down I have a big problem. If my data isn't backed up I have a smaller problem on top of my big problem.

    20. Re:And that people... by Solandri · · Score: 2

      And also, why redundancy is not backup. If your backup is plugged in and/or mounted, it's not a backup any more.

      That's not strictly true anymore. True, a RAID user would've been screwed in this scenario. But newer redundant filesystems like ZFS and btrfs support snapshots, which would in fact have made this situation recoverable. Provided you were generating snapshots at regular intervals.

    21. Re:And that people... by Anonymous Coward · · Score: 0

      Until a bug wipes out the whole filesystem, including all the snaphsots. If you mean to create backups, you better make sure they're disconnected and at different physical locations.

    22. Re:And that people... by Anrego · · Score: 1

      One keeps backups to protect themselves against such horrible, very rookie mistakes. They happen. Yes we can rage about how it shouldn't have happened, and yes someone at steam should get slapped, and yes "everyone should have backups" doesn't lessen the reality of what happened here, but having backups is still a good idea and is the difference between an inconvenience and sobbing in the corner when something like this happens.

    23. Re:And that people... by Immerman · · Score: 1

      Ah, but you're not factoring in the perversity of the universe - having absolutely critical files destroyed in one location increases the odds that an unrelated event will have destroyed your only backup by at least three and as many as seven orders of magnitude. Each additional backup reduces that chance (per backup) by one to two orders of magnitude, depending on the exact degree of reliability: higher reliability spits in the face of Fate, which pisses her off and increases the odds that she'll arrange for total data loss. "Geologically" stable backups such as HD-Rossetta can aggravate this to such an extent that you may want to consider purchasing insurance against high-yield nuclear strikes.

      --
      --- Most topics have many sides worth arguing, allow me to take one opposite you.
    24. Re: And that people... by Anonymous Coward · · Score: 0

      How is the erasure of something mounted by root outside /home/[username] by a script invoked by a user even possible when /media or whatever should be 755, or the mount options equivalent, and the steam client should be run as user, not root? Someone hardcore fscked up somewhere...

    25. Re:And that people... by nedlohs · · Score: 1

      It obviously means "assume one backup is bad". Backup media fails too after all.

      Sure that's not enough for a silver bullet. But can you really not understand that simple statement (you don't have to agree of course)?

    26. Re:And that people... by Anne+Thwacks · · Score: 1

      "Real men use reel-to-reel tape drives".

      --
      Sent from my ASR33 using ASCII
    27. Re:And that people... by drinkypoo · · Score: 1

      You can still call an online backup a backup, but it isn't really. It's just an additional store. If one lightning strike can destroy the original and the backup, you don't have a backup.

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    28. Re:And that people... by Anonymous Coward · · Score: 0

      And a reach-around!

    29. Re:And that people... by phantomfive · · Score: 1

      Another person suggested creating a user that does backups, all it does is backups, and that user is the only one who has write access to the backup drive. That seems like a reasonable solution as well.

      --
      "First they came for the slanderers and i said nothing."
    30. Re:And that people... by wiredlogic · · Score: 2

      You can use NFS to mount volumes readonly that are only writable by root when a backup is performed. That way the world rest of the users get continuous online access and the only way to accidentally delete is to have root privileges in a narrow window of time.

      --
      I am becoming gerund, destroyer of verbs.
    31. Re:And that people... by Anonymous Coward · · Score: 1

      I have two USB hard drives that I use to back up my main system. They are only connected while doing backups. One is stored off-site at a trusted location. I swap them every two weeks. Files are also syncronized between my main system and my two laptops. I also back up to two DVD disks once a month. One is stored off-site, the other locally.

      If this seems a bit paranoid or a bit of overkill, it is a reaction to seeing some friends lose nearly everything in a house fire. Thnk it can't or won't happen to you? It happened to my friends. The fire in their home was confined to the kitchen at the back of the house. Yet almost everything in the home was damaged or destroyed by heat and/or smoke. The horrible smoke smell tainted most of the few items that they tried to save, and could not be removed. The heat and smoke damaged a laptop that was in the oposite end of the house, and it failed a week or so after the fire. Everything on it was recovered, but they lost most of their family photos and other files that were only on their main desktop computer.

      Unless you have seen the devestation that even a small house fire can cause, it is very hard to believe.

    32. Re:And that people... by Anonymous Coward · · Score: 0

      Most of the population isn't rich enough to buy a new HDD or cycle through multiple HDDs every time we make a backup (and forget about online backups as home home internet is still too slow, especially with quotas, to do backups in reasonable times. It's very difficult to find good upload speeds.) and you have to connect the HDD when you're making the backup. The guy could have been making a backup when effected by the bug.

    33. Re:And that people... by whoever57 · · Score: 1

      Another person suggested creating a user that does backups, all it does is backups, and that user is the only one who has write access to the backup drive. That seems like a reasonable solution as well.

      One could have a directory in the hierarchy above the backups that can only be executed by the root user. In this case, the backup directories and files below it can have normal user permissions, but the backup will not be accessible with normal user credentials.

      --
      The real "Libtards" are the Libertarians!
    34. Re:And that people... by Anonymous Coward · · Score: 0

      Not reasonable for the average home user, unless there's a 1-click GUI that does it all for you.

      Really, how many tech users were concerned about bad programs destroying their backups? I worry about power loss while making a backup, not my office suite deciding to go on a rampage against my files.

    35. Re:And that people... by Cro+Magnon · · Score: 1

      Well, one fire, started by said lightning, could destroy my desktop, my laptops, and any backup media that's in my house. Which means my online backup IS the backup.

      --
      Slow down, cowboy! It has been 4 hours since you last posted. You must wait another few hours.
    36. Re:And that people... by phantomfive · · Score: 1

      Really, how many tech users were concerned about bad programs destroying their backups?

      If you're not, you should be. Make sure your backups are not commonly destroyable by your typical user account. Some auto-backup programs do this for you already.

      --
      "First they came for the slanderers and i said nothing."
    37. Re:And that people... by hattable · · Score: 1

      Interesting concept. Is there any backup solution that implements this? Google's results are less than helpful since all of the search terms are so common in all applications that manage backups or sandbox users per program.

      --
      OMG facts!
    38. Re:And that people... by phantomfive · · Score: 1

      Reports are that Apple's Time machine does that. I haven't had a chance to verify that, though.

      --
      "First they came for the slanderers and i said nothing."
    39. Re:And that people... by aaarrrgggh · · Score: 1

      Backup>Snapshot>Redundancy for disaster recovery. It is the reverse for operating issues.

    40. Re:And that people... by aaarrrgggh · · Score: 1

      I'm proud of my SnapBack-esque pull backups set on a NAS drive. The NAS has backup priveledges on the laptops, and pulls data via rsync. The laptops have no access to the NAS drive except for ssh. Provides linked snapshots hourly, daily, weekly, and monthly. Just need to get a second drive running in a few months.

      Only challenge is that since the laptops are OSX I don't copy the resource forks, but that could be addressed if I really cared...

    41. Re:And that people... by Gibgezr · · Score: 5, Funny

      Or you have underflowed, and have 4,294,967,295 backups.

    42. Re:And that people... by angel'o'sphere · · Score: 1

      Usually root can not write on an NFS mounted file system. Because that would imply you are 'root' on the target system (the system from which your mount is exported). No one wants that (but you 'could' export filesystems so that mounting systems have root rights)

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    43. Re:And that people... by Richy_T · · Score: 1

      Yep. If you don't have offline backups, you're going to have a bad time.

    44. Re:And that people... by Richy_T · · Score: 1

      You have to have a realistic estimation of the value of your data.

      In truth, for many of us, the most valuable data is the most trivial to back up.

    45. Re:And that people... by Richy_T · · Score: 1

      Cool. I've been thinking about looking at Glacier as an additional backup option. Really needs to be supplemental to backups under local control as well unless it's just stuff you really don't care about too much.

    46. Re:And that people... by Anonymous Coward · · Score: 0

      > He didn't protect himself against malicious code
      Never attribute to malice, what you can attribute to ... mistakes

    47. Re:And that people... by greg1104 · · Score: 1

      If it's plugged in, there's a significant class of failures where the computer dies and it takes out everything attached to it. Electrical surges can do that from both the power supply and the network side. And the (presumably) USB port the drive is attached to might fail in a spectacular way, one that damages the connected drive.

      This is not simply paranoia--I have seen all three of these things happen. (I was running two southern NYC data centers in 2001, so I've seen more than a few really unusual hardware explosions) Any backup that's not electrically isolated is at a higher risk than it should be.

    48. Re:And that people... by BarbaraHudson · · Score: 1

      I remember those days - they were caused by bad capacitors. Those problems are for the most part history. For today's home user, leaving the usb connected but not mounted is "good enough."

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    49. Re:And that people... by Anonymous Coward · · Score: 0

      No, if it's plugged in, it's still open to theft along with the computer, power surge taking both out, etc, etc. A backup should be offline and stored separately.

    50. Re:And that people... by BarbaraHudson · · Score: 1

      No, if it's plugged in, it's still open to theft along with the computer, power surge taking both out, etc, etc. A backup should be offline and stored separately.

      It's open to theft either way. It's not like most people have a fireproof safe in their house.

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    51. Re:And that people... by roc97007 · · Score: 1

      Ok, wait. Home internet is not too slow for backup. Gigabit switches are about 30 bucks. Had he rsynced his files to a different machine instead of having the hard drive locally mounted, he'd still have his backups.

      I'd like to posit that backups to multiple hard drives aren't just for rich folks either. A terabyte hard drive is less than $60 on Amazon. If you have more than a terabyte of critical information, you really need to think about your backup architecture.

      I make part of my living from photographs, have over 90,000 photos on a separate drive. Part of my overhead is three other drives for backup. Two onsite, not attached to the computer except when backing up, and one geologically distant in a friend's fire safe. The most recent onsite drive gets swapped for the offsite drive every few months.

      Only you can decide how much your data is worth. If it's valuable, it needs backed up.

      --
      Oliver's law of assumed responsibility: If you're seen fixing it, you will be blamed for breaking it.
    52. Re:And that people... by greg1104 · · Score: 1

      None of the incidents I alluded to were caused by bad capacitors; most of them happened before the capacitor plague really got started. It's very dangerous to assume that because a source of a problem has been identified, that class of problem will never happen again.

      "Good enough" is a fuzzy term that doesn't mean anything. Not plugged in is statistically safer than plugged in. You can care about your data and try to maximize its survival, or you can be overconfident that you know how things are going to die and ignore some good practices. Confidence won't save your data though. Paranoia can.

    53. Re:And that people... by BarbaraHudson · · Score: 1
      The bad capacitor plague started in 1999.

      Also, my point was that for the average home user, leaving the drive in and unmounted is "good enuff." Those 5 gazillion cat pictures are not really worth worrying (and neither are all your torrents or your pr0n collection).

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    54. Re:And that people... by greg1104 · · Score: 1

      I know exactly when it started. I lost my first set of computer equipment at work due to electrical issues in 1990. The capacitor plague era was not a disruptive event. All of those issues were already around--a long as capacitors existed they have been failing like that--they just became a lot more likely during that period.

      I assume everyone's data is important to them. Apparently you do not. You can't expect to be taken seriously on this topic with that attitude.

    55. Re:And that people... by BarbaraHudson · · Score: 1

      Most of what people consider "important" simply isn't. Most people don't have source code to maintain, and original documents that they get from others are almost always hard-copies.

      Losing access to their facebook or twitter account on one device through a series of hardware failures simply isn't the end of the world, no matter how much they want to believe it.

      Thinking that the vast majority of users "need" absolute recoverability of all their data is something that is simply silly in the real world. Most people can keep all the important stuff on 1 usb key or flash card. The rest is mostly stuff that they will never look at again, but we've been spoiled by huge storage capacities so as not to prune off the crap every once in a while.

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    56. Re:And that people... by Anonymous Coward · · Score: 0

      You should.

      By way of friendly advice, next time you've some time to kill, simulate a primary HDD failure and attempt to restore all your backups.

      It can be an eye opening experience.

    57. Re:And that people... by phantomfive · · Score: 1

      That's not the aspect I'm talking about having not tested.

      --
      "First they came for the slanderers and i said nothing."
    58. Re:And that people... by omnichad · · Score: 1

      Had he rsynced his files to a different machine instead of having the hard drive locally mounted, he'd still have his backups.

      Or he could just unount the partition between backups or leave it mounted RO the rest of the time.

    59. Re:And that people... by roc97007 · · Score: 1

      Had he rsynced his files to a different machine instead of having the hard drive locally mounted, he'd still have his backups.

      Or he could just unount the partition between backups or leave it mounted RO the rest of the time.

      Yes you're right, and I use one of those hard drive "toasters" where you can shove a raw drive in the slot, do the backup, and then pull out the drive and put it on a shelf. I highly recommend this strategy. I was mostly addressing the "home network is too slow for backup" comment. Home network these days is fast and cheap enough for anyone with critical data that needs to be backed up.

      Moreover, using rsync (which I do not at the moment, but I'm a fan of the technique) makes it possible to completely automate backups, and not have to remember to manually disconnect the drive or remount it read only.

      --
      Oliver's law of assumed responsibility: If you're seen fixing it, you will be blamed for breaking it.
    60. Re:And that people... by omnichad · · Score: 1

      You said "Home Internet" not "home networks."

    61. Re:And that people... by alvarogmj · · Score: 1

      I don't think your "online" and the parent's "online" mean the same thing :)

  3. Gotta love Valve by Anonymous Coward · · Score: 4, Funny

    Screw over people on Windows with micro-transactions and useless updates, screw over people on Mac with games that run poorly, screw over people on Linux by wiping files. It's like, the less popular your OS of choice, the more shafting you get.

    1. Re:Gotta love Valve by Anonymous Coward · · Score: 0

      Windows? useless updates? not IMHO.
      Mac games run poorly because of Mac. Valve doesn't make that many games, they just sell them.

    2. Re:Gotta love Valve by Bonzoli · · Score: 1

      I've recently seen this same mistake at much larger company. Generally having checks and accept prompts in scripts when deleting anything, but especially when deleting recursively, is a good thing. Its one of the first things I expect a level 1 Admin to make a mistake on, and later never do again.
      Its also a good plan to make sure your backup drives unmount after the backups. Leaving them mounted is asking for trouble. Actually online backups are a bad idea anyway but its cheap so we do it.

    3. Re:Gotta love Valve by dkman · · Score: 1

      A friend of mine had something similar happen with another game company. I think it was Sierra, but I don't remember. They would default their games to install to a C:\Program Files\Sierra\ directory. He would change those to C:\Games\. When he told the last game to uninstall he had the option to remove the "management app" (you know how game companies like those). When he did that it simply went up one folder and nuked everything. So his whole Games folder just disappeared. That's not as bad as losing everything your user owns below / , but he wasn't pleased.

      --
      I refuse to sign
  4. Oh, nobody will possibly run into this... by Anonymous Coward · · Score: 0

    Who moves folders anyway? Just symlink everything.

  5. All part of the Steam Doomsday Device by NotDrWho · · Score: 4, Funny

    Attention user, Steam has detected unusual activity on your part that could be construed as part of an effort to hack Steam. Therefore, Steam has deployed the Doomsday Device on your machine. You now have 5 minutes to either comply with out request to restore Steam to its original folder or to send a bionic person to shut down the Doomsday Device at the source. Otherwise, your system will be wiped and FBI agents will be arriving at your home shortly. Please keep your hands in the yellow circles pending their arrival. And thank you for using Steam!

    --
    SJW's don't eliminate discrimination. They just expropriate it for themselves.
    1. Re:All part of the Steam Doomsday Device by CanHasDIY · · Score: 1

      That just made my morning, ha.

      --
      An enigma, wrapped in a riddle, shrouded in bacon and cheese
    2. Re:All part of the Steam Doomsday Device by tnk1 · · Score: 5, Funny

      Negative. I am a meat Popscicle.

      The Steam user is one door down.

    3. Re:All part of the Steam Doomsday Device by Anonymous Coward · · Score: 0

      Well, as Dr. Strangelove taught us, what's the point of having a Doomsday Device if you keep it a secret and never use it?

    4. Re:All part of the Steam Doomsday Device by NotDrWho · · Score: 1

      We must not allow a secrecy gap!

      --
      SJW's don't eliminate discrimination. They just expropriate it for themselves.
    5. Re:All part of the Steam Doomsday Device by Anonymous Coward · · Score: 0

      Please keep your hands in the yellow circles pending their arrival.

      That sounds a lot like the party escort submission position.

  6. Wow by lengel · · Score: 2

    Wow! That is all.

    1. Re:Wow by Anonymous Coward · · Score: 0

      Thanks for sharing.

  7. I hope no one runs steam as root. by wiredog · · Score: 1

    OTOH, running it on an SeLinux system would probably contain the damage.

    1. Re:I hope no one runs steam as root. by Anonymous Coward · · Score: 5, Insightful

      Who cares about root! My home directory is WAY more important than the system.

    2. Re:I hope no one runs steam as root. by The+MAZZTer · · Score: 1

      Yeah a user posted the results of that on the Steam bug tracker. It halted trying to remove a file in /boot, which I assume was the first attempt at a deletion.

    3. Re:I hope no one runs steam as root. by Lunix+Nutcase · · Score: 1

      How would that have contained the damage? His home directory files are what is important not the system files.

    4. Re:I hope no one runs steam as root. by fuzzyfuzzyfungus · · Score: 3, Insightful

      Who cares about root! My home directory is WAY more important than the system.

      This is a fairly serious hole in a lot of traditional security mechanisms, blowing away the entire OS is easy, replacing the documents that any process running as you can scribble on is hard; but SELinux could definitely be used to contain the damage in a situation like this.

      With SELinux, even if Steam is running as the user, its process could run in a different domain, and have access exclusively to files in the appropriate security context(presumably only the ones it created in the first place).

      You could also use the hackier; but simpler, method of running the steam process under a different user account; but(especially once X enters the picture and you want integration with your DE's menus and whatnot) that gets kind of gross.

    5. Re:I hope no one runs steam as root. by cbhacking · · Score: 1

      SELinux lets you specify what folders an application is allowed to access. The Steam software would have access to its own folders, but not to the rest of the user's directory or anywhere else that the user can write to (such as his mounted drive).

      --
      There's no place I could be, since I've found Serenity...
    6. Re:I hope no one runs steam as root. by rdnetto · · Score: 1

      Who cares about root! My home directory is WAY more important than the system.

      Which means you should have backups that are not writeable by your account, and the easiest way of doing so is having cron create a tarball of /home as root. Alternatively, if you're using btrfs snapshots work great for this.

      --
      Most human behaviour can be explained in terms of identity.
  8. Hey! by Anonymous Coward · · Score: 0

    For me, $STEAMROOT is "" you insensitive clod!

  9. First day of *nix training... by Assmasher · · Score: 3, Informative

    Okay children, I'm going to teach you this command explicitly so that you know what you never, ever, EVER - wake up little Johnny - what was I saying? Oh yeah, ever, ever use it.

    Seriously. Don't use it.

    --
    Loading...
    1. Re:First day of *nix training... by cliffjumper222 · · Score: 4, Funny

      Has anyone actually gone into root and executed the command-that-shall-not-be-named? It's like being in a slow-motion train-wreck. I'd like to say I did it once just to see what would happen, but that would be a lie. I was a fresh-faced admin on a Solaris workstation with root access cleaning up the hard drive of extraneous data. Imagine the scene: the finger comes down in slow motion, the Enter key depresses and a few microseconds after, everything speeds up to real time as the brain realizes what just happened. That little bit of skin between your legs crushes up and you feel like your guts are falling out of your body. You rapidly try to find the process and kill it before those very commands get wiped, but it's too late....

    2. Re:First day of *nix training... by SYSS+Mouse · · Score: 1
    3. Re:First day of *nix training... by dcollins117 · · Score: 1

      Has anyone actually gone into root and executed the command-that-shall-not-be-named?

      Oh yes. Once by accident due to finger flail. Fortunately, this was on my own desktop machine, and I was able to fully recover from backups. It was a valuable lesson though (once bitten. twice shy). I now pay more attention to what's on the screen before hitting enter.

    4. Re:First day of *nix training... by Anonymous Coward · · Score: 0

      Around 2001, I had a Linux box filled with an insane number of temp files that weren't deleted, and had used up all the inodes on my hard drive, even though I had hundreds of megs of free space.

      I think it was a Redhat box (that was my first mistake). Whatever it was, the well-known bug was a pain.

      So I found the files, changed to the directory, entered rm -rf * then waited.

      For a fraction of a second.

      Too many arguments is what I think it told me.

      Aha! I thought. I'll get you yet.

      cd ..
      rm -rf $temp_directory_name

      Too many arguments.

      FUUUUUUU.

      So I changed back to the directory, and had to delete them by small group (about an hour) at a time. Took me a few hours to get rid of enough of them for me to be able to rm -rf * my way through the rest of the folder.

      I didn't know any bash scripting at that point, that would have made it easier (after I'd freed up some space).

    5. Re:First day of *nix training... by Anonymous Coward · · Score: 0

      i did it just to watch on a machine that was no longer needed. it kinda ran into issues after /bin/rm got killed.

      I use a basic rule, never use * as root. Of course I have to sometimes, but I make really really certain of what is happening before I do it.

    6. Re:First day of *nix training... by greg1104 · · Score: 2

      The best part is that since the deletion normally runs alphabetically, one of the first files taken out is /bin/kill

    7. Re:First day of *nix training... by Anonymous Coward · · Score: 0

      Typing 'kill' into your shell more than likely doesn't actually execute '/bin/kill'. Spawning a new process in order to terminate a process would be crazy pants.

    8. Re:First day of *nix training... by Anonymous Coward · · Score: 0

      Yes, did this purposely a couple of times back when it was not prevented. Most (all?) distributions no longer allow you to rm -rf / without passing a --no-preserve-root argument. However, IIRC this does nothing to prevent against rm -rf /*

    9. Re:First day of *nix training... by greg1104 · · Score: 1

      Yes, in most shells, kill is a built-in function that doesn't actually run the kill binary. It's not required by the UNIX specification though, so only having the binary is just fine; it's certainly not crazy pants for a UNIX system to run without a built-in shell kill.

      Regardless, the ps you may need to find the process usually is not a built-in, and instead it will spawn a new binary. So the problem of /bin being wiped out first and removing the tools you need for a fix is still there.

    10. Re:First day of *nix training... by Anonymous Coward · · Score: 0

      I did it.

      On a Spark5 web server running Suse back in, oh, 2001 or 2002.

      I was pretty new to the game and was cleaning up some files and intended to do: rm -rf ./

      Now I realise that it was a stupid thing to do anyway, but, I missed off the . and typed in: rm -rf /

      The system tried its hardest to delete everything and kept running for another few minutes before collapsing...

      Sometimes you gotta learn the hard way!

  10. m -rf "$STEAMROOT/"* ??? by Ecuador · · Score: 2, Informative

    You don't even need to check $STEAMROOT, I mean what could possibly go wrong...
    But still for extra points the script should have asked to run as root...
    And a little advice to Valve, next time have developers familiar with Linux working on your Linux client. That /* is how a Windows developer would write the command to delete a directory if they simply looked up the equivalent command for Linux.

    --
    Violence is the last refuge of the incompetent. Polar Scope Align for iOS
    1. Re:m -rf "$STEAMROOT/"* ??? by jandrese · · Score: 1

      Yeah, that's some straight up sloppy coding. Then again, this comes from the company who's simple storefront and game launcher app still manages to require 100MB of heap and takes several seconds to start on a fast and powerful modern machine with a SSD.

      --

      I read the internet for the articles.
    2. Re:m -rf "$STEAMROOT/"* ??? by Anonymous Coward · · Score: 0

      How would a Linux developer write the shell command to delete everything in the directory (but leave the empty directory itself)?

      dom

    3. Re:m -rf "$STEAMROOT/"* ??? by Andtalath · · Score: 1

      Why would you want to leave the directory?

    4. Re:m -rf "$STEAMROOT/"* ??? by Anonymous Coward · · Score: 0

      I don't know. Sounds like somebody was just in a hurry and forgot to come back. I've come across my share of the following:

      try { foo(); } catch ( e ) {
      // Todo: Handle exceptions better.
      }

    5. Re:m -rf "$STEAMROOT/"* ??? by Anonymous Coward · · Score: 0

      Doesn't steam just embed WebKit? Don't get me wrong, it's a lot of memory for what might be effectively a shortcut to a game for you but for everything they do in the storefront it's not really a bad tradeoff...

    6. Re:m -rf "$STEAMROOT/"* ??? by jandrese · · Score: 1

      I think the problem is that it's written in .NET and has to fire up the whole .NET environment, just like how a Java app has to fire up the JVM to start, which puts a (rather large) lower bound on the amount of resources an application needs.

      --

      I read the internet for the articles.
    7. Re:m -rf "$STEAMROOT/"* ??? by flink · · Score: 1

      And a little advice to Valve, next time have developers familiar with Linux working on your Linux client. That /* is how a Windows developer would write the command to delete a directory if they simply looked up the equivalent command for Linux.

      A competent Windows developer would probably just write:
      if exist "%STEAMROOT%" rmdir /Q /S "%STEAMROOT%"
      no dangerous glob needed.

      It kind of floors me that they aren't doing some kind of check that the directory tree they are about to delete actually looks like a Steam install before deleting it. e.g. check that ClientRegistry.blob file or SteamApps directory exists under $STEAMHOME.

    8. Re:m -rf "$STEAMROOT/"* ??? by iampiti · · Score: 1

      Many (all?) of the things the Steam client displays are webpages and thus it contains a web browser and those are heavy beats. I believe that's the reason the Steam client uses so much RAM

    9. Re:m -rf "$STEAMROOT/"* ??? by jeffmflanagan · · Score: 0

      It seems like Valve does not take Linux support seriously. Windows is inherently less secure than Linux, but I expect that they dedicate enough resources to their Windows version that something like this would never happen.

    10. Re:m -rf "$STEAMROOT/"* ??? by VGPowerlord · · Score: 1

      I think the problem is that it's written in .NET and has to fire up the whole .NET environment, just like how a Java app has to fire up the JVM to start, which puts a (rather large) lower bound on the amount of resources an application needs.

      Steam isn't written in .NET... I'm not sure where you would ever get the idea that it was.

      As for the browser component, it uses Chromium Embedded Framework. However, I don't think it was ever upgraded to version 3.

      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
    11. Re:m -rf "$STEAMROOT/"* ??? by VGPowerlord · · Score: 1

      It kind of floors me that they aren't doing some kind of check that the directory tree they are about to delete actually looks like a Steam install before deleting it. e.g. check that ClientRegistry.blob file or SteamApps directory exists under $STEAMHOME.

      ClientRegistry.blob isn't used by Steam any more and thus won't exist if you've installed Steam in the past 9 months or so

      Would the Steam directory even have a SteamApps directory if you're using Steam's library feature to install all games to a different path?

      While we're at it, is it SteamApps, steamapps, or some other variation of capitalization? That kinda matters on Linux.

      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
    12. Re:m -rf "$STEAMROOT/"* ??? by nedlohs · · Score: 1

      That would remove the directory itself, which rm -rf "$STEAMROOT"/* would not. And of course any .* files in that directory.

      rm -rf "$STEAMROOT"

      would be the equivalent of your command, no need for the if exists since "rm -rf" is a no-op (the -f will surpress the missing operand error).

      But yes I can't imagine every doing a "remove this entire tree" without checking that the tree is what you think it is. Better to skip unknown directories/files within that directory really and leave those (and the parent) be - though that is significantly more difficult and thus bug prone (harder to make a bigger bug than this one though).

    13. Re:m -rf "$STEAMROOT/"* ??? by Moof123 · · Score: 2

      Most folks don't take Linux seriously at all.

    14. Re:m -rf "$STEAMROOT/"* ??? by Anonymous Coward · · Score: 0

      Looks like its C++ from searching around.

      That said: A) .NET and JVM just don't take that much memory. There's caching and garbage collection delayed until memory pressure is a concern, so if you have a lot of ram it can take a LOT, but baseline, it doesn't.

      B) It uses Webkit for most of the rendering. -THAT- takes a lot, as does any desktop app based on it or its forks (ie: nw.js, atom shell, etc)

    15. Re:m -rf "$STEAMROOT/"* ??? by Anonymous Coward · · Score: 0

      Seconds? HA.

      Minutes. At least 3 of them. On a quad core machine with a decent SSD and 16GB of RAM.

      Since the release of the Linux client, the Windows client hasn't worked properly. It no longer listens for a WM_ENDSESSION and closes up shop, now it just gets terminated by the OS and doesn't save its internal state. When the system boots up again and Steam starts, it checks to see if there's an update because it doesn't have the cache associated with those updates anywhere. If you File > Exit just once, it saves those cached update checks and doesn't take quite as long to start up the next time. But I'm too lazy to bother with that, and Valve is too lazy to fix their buggy program that doesn't handle a standard window message that has been around since Windows 1.0.

      And none of that even addresses why a fat client for a storefront and app launcher should ever use more than 25MB of memory (being generous here, it has built-in media players and such, so I'll cut it some slack).

    16. Re:m -rf "$STEAMROOT/"* ??? by dcollins117 · · Score: 1

      Another time-saving tip: just rethrow the exception so it becomes someone else's problem.

    17. Re:m -rf "$STEAMROOT/"* ??? by CrashNBrn · · Score: 1
      Opera 12 followed that ideology.

      Opera1217_en_Setup.exe ---------- 10,046 KB
      Opera1217_en_Setup_x64.exe --- 11,327 KB
      --- Then a few versions back, it wasn't much larger either, and basically had a WebServer built-in.

      For some unknown reason Chrome/Blink requires ~35MB, and FireFox ~50MB.

      When I first started using Opera in the late 90's, it was ~3.5MB, Mozilla with a Mail Client was over 25MB.

    18. Re:m -rf "$STEAMROOT/"* ??? by Anonymous Coward · · Score: 0

      Yeah... 50% of the servers on the planet, millions of Android devices, but nobody takes it seriously.

    19. Re:m -rf "$STEAMROOT/"* ??? by Anonymous Coward · · Score: 0

      shopt -s nocasematch #disable case sensitivity
      shopt -u nocasematch #re-enable case sensitivity

      Good one, slashdot:

      Slow Down Cowboy!

      Slashdot requires you to wait between each successful posting of a comment to allow everyone a fair chance at posting a comment.

      It's been 22 minutes since you last successfully posted a comment

      Funny thing is, it hasn't. It's been 14 minutes.

    20. Re:m -rf "$STEAMROOT/"* ??? by Anonymous Coward · · Score: 0

      It's C++, not .NET.

      https://partner.steamgames.com/

    21. Re:m -rf "$STEAMROOT/"* ??? by ihtoit · · Score: 1

      looking at my Chrome install here, it has a 465MB footprint and is swallowing, on ONE tab (this one) 271MB of RAM. Opening another blank tab swallows another 34MB. 34MB OF RAM AND IT ISN'T EVEN DOING ANYTHING USEFUL TO ME YET. Kick up a page with Flash content, let's pick Youtube to be random, and the RAM charge goes with the addition of FOUR more app processes (Chrome is now spawned across nine processes!), up to 1.1GB!

      The FUCK is going on here??

      --
      Political debates have me rolling my eyes so much I think I got optical whiplash. I should sue. - Foamy The Squirrel
  11. Power Tools for Powered Destruction by Anonymous Coward · · Score: 0

    And this is why we have software containers and VMs.

    Seriously, if any application can just wipe the host OS with a simple smattering of bash script then fail. The app shouldn't be able to see files there and it definitely shouldn't have privileges to be able to perform such actions.

    CAPTCHA: "deletion"

    1. Re:Power Tools for Powered Destruction by Anonymous Coward · · Score: 0

      A simple solution I use myself is creating a separate "steam" user that is isolated (in terms of file access permissions) from other non-root accounts on the same machine, and it is not used for anything other than running Steam. This is somewhat inconvenient, but it improves security, and reduces the potential damage due to bugs or malware. I think SteamOS uses a similar approach as well, as it has a "steam" and a "desktop" user, but I may be wrong, since I do not use SteamOS.

    2. Re:Power Tools for Powered Destruction by jeffmflanagan · · Score: 0

      Clearly doing this is a good idea, rather than just paranoia, but you shouldn't have to do it. It's insane that Valve is so incompetent with Linux that they'd code something like this. I've never seen a system-wiping bug like this in Windows, where it can happen much more easily.

  12. Dodged that bullet. by Anonymous Coward · · Score: 0

    Super glad I didn't let KSP distract me and got some work done instead.

  13. Not the first time by Rick+Zeman · · Score: 4, Informative

    Apple had a bug like that in the iTunes installer sometime back that did exactly that: a rm -rf from root as root. Theirs came from if you had a space in your hard drive name.

    1. Re:Not the first time by kthreadd · · Score: 1

      Ohh, and isn't "Macintosh HD" the default name? Ouch!

    2. Re:Not the first time by sootman · · Score: 4, Informative

      It was in the updater for iTunes 2, and if you a) had your library on a second hard drive and b) if the hard drive had a space for the *first character* of the name (eg, " Music") it would erase the drive.

      http://www.xlr8yourmac.com/OSX...

      --
      Dear Slashdot: next time you want to mess with the site, add a rich-text editor for comments.
  14. Re:unexpected deletion by tnk1 · · Score: 4, Funny

    They need to have system administrators working for them, apparently. Not using that command is so ingrained, that I have the nightmare where I type "rm -rf /" in a console instead of the dream where you are naked in front of the class, or the one where you didn't study for finals.

    I also have the one where I run the endless loop of opening more and more xterms until my SPARCstation falls over.

  15. Lessons learned by Anonymous Coward · · Score: 0

    Let this be a lesson to you boys and girls. This is what happens when you install a rootkit to your computer. Steam is manythings including spyware, malware, and even a rootkit.

    Keep control over your computer, and don't ever let others control it in any way; either fool them into thinking they have it when they don't, or completely block them or simply do not use their products or services.

    1. Re:Lessons learned by Lab+Rat+Jason · · Score: 1

      Steam is manythings including spyware, malware, and even a rootkit.

      [Citation Needed]

      --
      Which has more power: the hammer, or the anvil?
    2. Re:Lessons learned by drinkypoo · · Score: 1

      Steam is manythings including spyware, malware, and even a rootkit.

      [Citation Needed]

      It's really not true. Steam is not a rootkit.

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    3. Re:Lessons learned by cbhacking · · Score: 1

      It does install a service on Windows that runs with elevated privileges, allowing Steam to do admin-y stuff at will, though. Not a rootkit because it isn't hidden and doesn't resist removal, but still sketchy. I disable this service; it means I have to put up with a UAC prompt on the rare occasion I need to run a Steam game for the first time, but I'm OK with that.

      I haven't tried it on Linux, yet. Due to the DRM nature of Steam, I avoid buying from them. The DRM-free games from Humble Bundle and GOG work fine on Linux without requiring that I install Valve's crap.

      --
      There's no place I could be, since I've found Serenity...
  16. A few if statements needed... by rklrkl · · Score: 5, Informative

    Something like this might have helped:

    if [ "$STEAMROOT" != "" -a "$STEAMROOT" != "/" ]
    then
              if [ -d "$STEAMROOT" ]
            then ...do your evil deletion of $STEAMROOT here
            fi
    fi

    Should avoid at least a full deletion traversal of the filestore, but it's still got a risk that $STEAMROOT might be ~username (or /tmp, which is less critical).

    1. Re:A few if statements needed... by Anonymous Coward · · Score: 0

      Or even better $STEAMROOT should only be the destination dir for where to put the Steam directory, not the directory where you should put the Steam files.

      STEAMDIR=

      if [ "$STEAMROOT" != "" -a "$STEAMROOT" != "/" ]
      then
                          if [ -d "$STEAMROOT/$STEAMDIR" ]
                      then ...do your evil deletion of $STEAMDIR here
                      fi
      fi

    2. Re:A few if statements needed... by null+etc. · · Score: 1

      #!/bin/bash

      function getSedExtRegexArg()
      {
              if isMacOsX
              then
                      # All I want to do is echo '-E', but echo is too clever for that.
                      printf '%s' '-E'
              else
                      echo '-r'
              fi
      }

      function isMacOsX()
      {
              [[ "$( uname )" == 'Darwin' ]]
      }

      function normalizePath()
      {
              echo "${1}" | sed "$( getSedExtRegexArg )" \
                      -e 's:[/][.][/]([.][/])*:/:g' \
                      -e 's:[/][.]$:/:' -e 's:^[.][/]+::' -e 's:[/][/]+:/:g'
      }

      echo "/ is '$( normalizePath '/' )'"
      echo "// is '$( normalizePath '//' )'"
      echo "//root// is '$( normalizePath '//root//' )'"

    3. Re:A few if statements needed... by phantomfive · · Score: 1

      If they'd just left the * off, the problem would have been solved.

      --
      "First they came for the slanderers and i said nothing."
    4. Re:A few if statements needed... by Anonymous Coward · · Score: 0

      Your code fails for everyone who installs steam in /. Unlikely but possible. Far too many programmers assume too much.

  17. At least they're trying by sansprivacy · · Score: 0

    To bring the steam platform to Linux ... How long have people been asking for this? Pretty sure the details of the release would have eluded to the quality of it ... Folks should have been wary, but it does suck.

  18. Serious question by Anonymous Coward · · Score: 0

    I am not trolling -- this is a serious question: What is the right way of doing something like this? I am not a *NIX h4x0r but at least I know that you should drop the -f in any case. But other than checking for the value of $STEAMROOT... how would one do it the right way?

    1. Re:Serious question by ssam · · Score: 1

      "set -o nounset" at the top of your bash script. Then bash acts a bit more like a real programming language, and gives an error if a variable is not set. More tips (and by 'tip' i mean pretty much essential knowledge) at http://www.davidpashley.com/ar...

  19. Shell by Anonymous Coward · · Score: 0

    Good thing nothing important is written in shell nowdays, like init for example.

  20. Re:arguably steam isnt for linux. by Anonymous Coward · · Score: 0

    If software has to share the "ethos" of the host OS the software (and users) will go somewhere else

    LIkewise Steam as a walled garden of its own also has an ethos by which software is hosts must comply with, but that doesn't mean you can't just buy those games and install them without Steam

    Steam just makes things easy for lazy people, hence it's popularity

  21. Simple fix by rickb928 · · Score: 1

    They just left out the ampersand.

    Easy fix.

    --
    deleting the extra space after periods so i can stay relevant, yeah.
  22. Re:arguably steam isnt for linux. by Kjella · · Score: 1

    yet as a proprietary application expects in this case to invoke the GPL mantra of usability without warranty

    If you think the GPL invented that mantra, you must be smoking the good stuff. All (normal COTS) software comes with the "we take as little legal responsibility as at all possible" and it's because of crackpot legal systems like the US. Be glad that you can just throw software out there, otherwise writing software would be high liability sport only for those with deep pockets or nothing to lose.

    --
    Live today, because you never know what tomorrow brings
  23. selinux by CoderFool · · Score: 1

    you mean the Linux that your friendly, neighborhood, NSA so graciously helped secure?

  24. --no-preserve-root by achacha · · Score: 1

    I would figure that --no-preserve-root would be required to delete root directory?

    1. Re:--no-preserve-root by Anonymous Coward · · Score: 1

      It would be, but they are not trying to remove the root directory. They are deleting everything under the root directory. Basically, they are doing this:

      rm -rf /*

      Rather than this:

      rm -rf /

      So the preserve-root flag, which is enabled on Ubuntu by default, is not triggered.

    2. Re:--no-preserve-root by Anonymous Coward · · Score: 0

      Not with the /*

      rm -rf / requires the --no-preserve-root option, but the Bash shell helpfully expands "rm -rf /*" to "rm -rf /bin /boot /dev /etc /home ..." and rm -rf will delete whatever it can in those dirs.

    3. Re:--no-preserve-root by Anonymous Coward · · Score: 0

      Except that they didn't try to delete the root path

      They tried to recursively delete everything in the root path, but leave the path itself intact.

    4. Re:--no-preserve-root by cbhacking · · Score: 1

      First of all, this command doesn't remove the root directory, just everything inside it.
      Second, you need root privileges to remove the root directory. However, you don't need root privileges to enumerate the root directory, find all children of it that you can delete, and delete them.

      --
      There's no place I could be, since I've found Serenity...
  25. Shades of Sierra by Slamtilt · · Score: 2

    Remember back in the day when the Sierra uninstall utility could accidentally delete all your files? I think that was a result if you put it in a non-standard location, too.

    1. Re:Shades of Sierra by Anonymous Coward · · Score: 1

      I remember uninstalling some software long, long ago, on what might have been 98/2000 Windows. The uninstaller had a button that allowed you to preview everything that it would do from that point on.

      How awesome! It shows you all the files and registry keys it deletes! It even deletes it's own folder! And then I had a near seizure when I saw the list of to-delete files included the entire Program Files folder and everything in it.

    2. Re:Shades of Sierra by Anonymous Coward · · Score: 0

      That was only if you had installed your games to C:\ Instead of installing them to C:\OTHERDIR

    3. Re:Shades of Sierra by Anonymous Coward · · Score: 0

      ah yes back when we used to ride on our triceratops

  26. just as bad as eve online boot.ini issue by Anonymous Coward · · Score: 0

    just as bad as eve online boot.ini issue.

    How can they be that dumb?

    1. Re:just as bad as eve online boot.ini issue by ihtoit · · Score: 1

      wait... someone had the bright idea of having an application (a game, no less!) overwrite a vital system file??

      That is just fucking insane if I read that correctly.

      --
      Political debates have me rolling my eyes so much I think I got optical whiplash. I should sue. - Foamy The Squirrel
  27. Re:unexpected deletion by Anonymous Coward · · Score: 1

    They need to have system administrators working for them, apparently. Not using that command is so ingrained, that I have the nightmare where I type "rm -rf /" in a console instead of the dream where you are naked in front of the class, or the one where you didn't study for finals.

    I also have the one where I run the endless loop of opening more and more xterms until my SPARCstation falls over.

    Your classroom fail wasn't a dream. People are still talking about it.

  28. Taking lessons from Intuit, I see by RogueWarrior65 · · Score: 2

    A few years ago, Inuit released an online update to Quickbooks for Mac that effed your entire partition. I happened to be away on a business trip when this happened and I had to have my backup drive FedExed to me. Did Intuit offer to pay for that? Hell no. Did anyone file a class action suit? Who knows, but even if they did, I'd have gotten discounts for coupons for cellphone cases or something equally useless.

    1. Re:Taking lessons from Intuit, I see by ihtoit · · Score: 1

      if you're talking about 2009, yes there was a class action that was settled with a free product upgrade and partial reimbursement of data recovery costs: http://www.lieffcabraser.com/C...

      --
      Political debates have me rolling my eyes so much I think I got optical whiplash. I should sue. - Foamy The Squirrel
    2. Re:Taking lessons from Intuit, I see by Anonymous Coward · · Score: 0

      Many years ago this happened to a friend of mine. It was back in the day of dial up internet connections. He tried the free 30 day trial of AOHELL (AOL). It was very hard to get AOHELL to cancel an account, they just did not want to take NO for an answer. Then when uninstalling the AOHELL software, his hard drive was scrambled. This was pretty common, and why many learned to hate AOHELL!

  29. Re:arguably steam isnt for linux. by DRJlaw · · Score: 3, Insightful

    [Steam] as a proprietary application expects in this case to invoke the GPL mantra of usability without warranty.

    I could have sworn that that mantra appeared in BSD licenses well before the GPL was a twinkle in RMS' eye. Yep.

    If I cared to research it, I'm certain I would find similar language in proprietary licenses which predate even that.

    Your distinction between "on" and "for" is equally myopic and artificial. Binaries "for" an operating system is used so commonly it is only questioned by ideological zealots, which most of us are not.

  30. Re:unexpected deletion by _xeno_ · · Score: 2

    Not using that command is so ingrained, that I have the nightmare where I type "rm -rf /" in a console instead of the dream where you are naked in front of the class, or the one where you didn't study for finals.

    You could also do what I did once, and accidentally hit space in the command and not notice.

    rm -rf a/bunch/of/local/junk /

    Except that's not quite right. What I actually did was:

    sudo rm -rf /usr/local/dontremember /bin

    --
    You are in a maze of twisty little relative jumps, all alike.
  31. man rm by shess · · Score: 4, Interesting

    From the rm(1) man page on most Linux distros:
                  --no-preserve-root do not treat '/' specially (the default)

                  --preserve-root
                        fail to operate recursively on '/'

    Why --preserve-root isn't the default is beyond me, since it would be generally faster to re-create the filesystem if that's what you _really_ wanted.

    1. Re:man rm by Z00L00K · · Score: 2

      From Fedora 20:

      --preserve-root
                                  do not remove '/' (default)

      --
      If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
    2. Re:man rm by Anonymous Coward · · Score: 0

      According to the rm manual page that ships with Ubuntu, the --preserve-root option is the default. So does this mean people who are running Steam on a supported platform are protected from the bug? So far as I know, Steam is only officially supported on recent releases of Ubuntu and other Linux platforms are officially unsupported.

      --preserve-root
                                  do not remove '/' (default)

    3. Re:man rm by Anonymous Coward · · Score: 3, Insightful

      That doesn't matter in this case, since "rm -rf /*" is trying to delete all the subdirectories of /, not / itself.

      The rm command sees the command as this (for my machine):

      rm -rf /bin /boot /dev /etc /home /initrd.img /initrd.img.old /lib /lib32 /lib64 /libx32 /lost+found /media /mnt /opt /proc /root /run /sbin /srv /sys /tmp /usr /var /vmlinuz /vmlinuz.old

    4. Re:man rm by steelfood · · Score: 4, Informative

      Not that it would've helped in this case.

      rm -rf $var/* has two flaws. The first is if $var is blank or undefined. The second is the extra unnecessary /* that circumvents --preserve-root.

      --
      "If a nation expects to be ignorant and free in a state of civilization, it expects what never was and never will be."
    5. Re:man rm by Anonymous Coward · · Score: 0

      No. This gets around that protection.

      Try running this and see what you get: echo /*

      That's what rm is trying to delete here. Not / itself, but its subdirectories.

      However, not running Steam as root should protect you.

    6. Re:man rm by Anonymous Coward · · Score: 0

      It didn't remove "/".

      It wasn't running as root, so it couldn't. It just recursively descended from there removing anything it could ... meaning everything owned by the user running it.

    7. Re:man rm by xfurious · · Score: 1

      What distribution actually has --no-preserve-root as default!?!!

      On CentOS:
      # man rm
      ...
      --no-preserve-root
      do not treat ‘/’ specially

      --preserve-root
      do not remove ‘/’ (default)

    8. Re:man rm by xfurious · · Score: 1

      Yeah, this is the perfect storm of stupidity. As a system administrator, I feel like I cannot have Steam on my machine anymore.

    9. Re:man rm by Goonie · · Score: 1

      As a system administrator, I presume you don't have Steam on anything other than your personal desktop or a dedicated game machine...

      --

      Any sufficiently advanced technology is indistinguishable from a rigged demo
      --Andy Finkel (J. Klass?)
  32. Not a bug by Anonymous Coward · · Score: 0

    I frankly don't get the obsession some have for customizing things, especially perfect ones. Take things as they are and expect the tree to fall when you cut its STEAMROOT.

  33. Re:arguably steam isnt for linux. by Anonymous Coward · · Score: 0

    its on linux. If it were for linux it would have maintained at least a shred of hackers ethos. Instead its binaries that require patent encumbered libraries and a carefully controlled deployment. Steam violates rule 0, yet as a proprietary application expects in this case to invoke the GPL mantra of usability without warranty. Steam will be "for linux" when it can be endorsed on more than one flavor without a laundry list of legal disclaimers and warnings. Currently it exists to run with the aid of the Linux kernel, GNU userspace be damned.

    Someone should have warned them that most Linux users are far too busy smelling the sweet fragrance of their own farts to play games anyway.

  34. Oooh, I almost caused this in a product once too. by Anonymous Coward · · Score: 2, Interesting

    I had a similar situation in a product I was working on once where it was a PHP script with an undefined variable. It was the exactly same result: rm -rf /

    Fortunately a QA guy caused it while testing. It was hell to figure out what happened because it was running as room and had wiped the entire system.

  35. I need ask some one who used to work there and now by Anonymous Coward · · Score: 0

    I need ask some one who used to work there and now works at (withheld) next time I see him. As they have a new (withheld) that runs Linux now.

  36. A lesson. by fuzzyfuzzyfungus · · Score: 1

    Exception handling. No exceptions. Now go.

  37. Re:arguably steam isnt for linux. by fuzzyfuzzyfungus · · Score: 4, Insightful

    Aside from areas where it's legally unavoidable(medical devices, avionics, probably some nuclear applications), applications that take the slightest responsibility for their actions are virtually unheard of, under any license. On a good day, a proprietary application might accept liability up to the value of a refund; but not further, if it fucks up really egregiously; but that's about the extent of it.

    You can get software that promises more; but it will cost you mightily.

  38. Backup drive by roc97007 · · Score: 2

    > 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.

    All together now: This is why we disconnect our backup drive when we're not backing up the system!

    --
    Oliver's law of assumed responsibility: If you're seen fixing it, you will be blamed for breaking it.
    1. Re:Backup drive by fnj · · Score: 1

      That's not necessary. My backup is mounted read-only via nfs, and when I am running backups they are done by rsync via ssh. Actually I have two backups on two separate hosts and only one is nfs mounted, but that is a detail.

  39. Truly... by Anonymous Coward · · Score: 1

    ...the year of linux on the desktop.

  40. Deja vu by operagost · · Score: 1

    This reminds me of a game from something like 10 years ago that would delete everything from Program Files if you uninstalled it. I can't remember which one that was.

    --

    Gamingmuseum.com: Give your 3D accelerator a rest.
    1. Re:Deja vu by Anonymous Coward · · Score: 1

      Ironically, it was Half Life. It deleted one more directory than it should've. So uninstalling c:\games\halflife would also wipe out c:\games.

    2. Re:Deja vu by tlhIngan · · Score: 1

      This reminds me of a game from something like 10 years ago that would delete everything from Program Files if you uninstalled it. I can't remember which one that was.

      I think World or Warcraft had a bug that deleted boot.ini, which on NT/XP was what the boot loader read to figure out how to boot Windows. (Vista onwards made that file a binary one instead).

      End result was a bunch of people had their boot.ini files wiped. XP had a recovery mode where if it doesn't find boot.init, it checks the first partition on the first hard disk - if it finds ntldr, it'll use that. If not (you installed Windows on another drive, or another partition), you get the "cannot find ntldr" error.

      So it affected everyone but Windows was working in a back up mode.

  41. Re:arguably steam isnt for linux. by Anonymous Coward · · Score: 0

    Actually, Steam works great on my Arch system. I've been playing Witcher 2, Borderlands 2, XCOM, and about 60 other games without complaint since October. Ubuntu isn't the only flavor Steam runs on.

  42. Re:unexpected deletion by kenaaker · · Score: 4, Funny
    Or, there's this variation I used while trying to remove a bunch of . (hidden) directories from a user directory. As root of course, otherwise it's not nearly as funny.

    rm -rf .*

    The key fact is that .. matches .*

  43. Arggh! by Anonymous Coward · · Score: 0

    There goes my production DB server!

    1. Re:Arggh! by Anonymous Coward · · Score: 0

      Well why else do you think there's a monitor and keyboard (and a door that locks) in the server room? I'll get caught if I play games on my own machine!

  44. Arggh! by Anonymous Coward · · Score: 0

    Anyone running steam on a production DB server kinda deserves it.

  45. set -o nounset by ssam · · Score: 1

    This is why you should have
    set -o nounset
    set -o errexit
    at the top of every bash script. Also no one should be allowed to write a bash script unless they have read http://www.davidpashley.com/ar...

    1. Re:set -o nounset by un1xl0ser · · Score: 1

      This.

      While others have noted that the asterisk circumvents appropriate use of globbing, there are really three fixes.

      1. Defensively check the setting of the variable and presence of the directory to print reasonable error messages.
      2. Use 'set -u' or 'set -o nounset' to avoid any unset variables.
      3. Do not include the unnecessary astersisk to avoid globbing and fall back on modern operating system safe defaults when a bare / is specified.

      I only include #1 because when using set -e and set -u as recommended by Pashley (among others), you should probably handle the things explicitly and gracefully for something to be run by an end user.

      --
      v4sw6PU$hw6ln6pr4F$ck 4/6$ma3+6u7LNS$w2m4l7U$i2e4+7en6a2X h
  46. Re:Oooh, I almost caused this in a product once to by Anonymous Coward · · Score: 2, Informative

    Rule #1, don't run as room. Room contains all the stuff.

  47. How the tides have turned!!! by Anonymous Coward · · Score: 0

    A year ago Steam was going to be the mighty hand that put Linux on every desktop in the world and make Linux the OS for the most popular game console EVVVAHH!!!
     
    Today Steam is the target of Linux fanboy rage... pelted with dungballs and cursed as a plague to all that was once right and good in the world.
     
    Anyone have any questions as to why no serious software publishers want to get caught up in such a quagmire?

  48. We own your hardware by Terry95 · · Score: 1

    This is the classic 2 year old mine mine mine mentality. Surely the user would not have ANYTHING other than our software on any system. There is no point in any software other than ours. THIS is why people hate overbearing companies like M$ and rottenapple.

    So Valve, are you A) evil or B) criminally incompetent?

    1. Re:We own your hardware by azav · · Score: 1

      My comment that addresses point B seems to be right below this one.

      I vote B.

      --
      - Zav - Imagine a Beowulf cluster of insensitive clods...
  49. Why is this not surprising? by azav · · Score: 1

    When TF2 has critical bugs that are still in it after 7 years and issues like the Strange PDA Engie Upgrade Bug that has been in the product for over a year, it amazes me that these guys are still going.

    It just looks like they are running by the skin of their teeth since there are FREQUENT issues that are dangerous as hell or that stay in the product for ages.

    Every new release of TF2 seems to add new bugs and they spend more time putting in new hats than fixing outstanding issues. This reeks of shitty software development.

    --
    - Zav - Imagine a Beowulf cluster of insensitive clods...
  50. What's a good approach... by Ghjnut · · Score: 1

    This seems like a common issue in Linux, particularly for people using it as a desktop environment. What would be the preferred method to limit access? Dedicated user/group with filesystem perms, cgroups, ACLs, chrooting, security modules (AppArmor/SELinux)?

    --
    MouseClass extends ScrollClass, which extends TabClass, which extends SidebarClass, which extends PowerClass, w
    1. Re:What's a good approach... by Anonymous Coward · · Score: 0

      This seems like a common issue in Linux, particularly for people using it as a desktop environment. What would be the preferred method to limit access?

      I don't know what the best option would be for limiting access, but it would be great if companies stopped rolling out obviously broken software.

  51. Another reason to create a separate user for Steam by Anonymous Coward · · Score: 0

    Not only is it better (somewhat) for security, it minimizes the damage caused by bugs like this one.

  52. OMG! by 140Mandak262Jamuna · · Score: 1

    Is there a way to mount a disk in a "Add only no delete" mode? If not, why not?

    --
    sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
    1. Re:OMG! by ledow · · Score: 1

      Files can be opened append only.

      This involves writes on the underlying device.

      Files can be deleted.

      This involves writes on the underlying device.

      Files can be overwritten with junk content.

      This involves writes on the underlying device.

      The underlying device has no concept of what it's actually DOING with the data it's given. That's up to the filesystem. So devices have precisely two "permissions". Read. Write.

      The safeguards should be in the filesystem, but the filesystem people will tell you "That's what filesystem permissions are for." And they're right.

      Notice that the flaw only allows you to remove files OWNED by the same user as the Steam client is run. Past that, you need SELinux, or some form of container to isolate files you own that are data you've created, and files you own that are parts of your games.

      Honestly, the facilities are there to lock this stuff down (why is it not run as a special use "user_steam" where "user_" is the name of the user running it?)... we just don't use them as they hinder "desktop" use, same as Vista UAC, etc.

      Steam no more needs access to your LibreOffice-created office files in /home than it does the root. But nobody partitions their systems that finely, except system administrators (hence why all your services run as their own users so that, even if they run amok, they can only damage their own service and not others).

    2. Re:OMG! by 140Mandak262Jamuna · · Score: 1
      We can think of a file system where a file once written will not be modified. I am thinking of pure back up applications and audit trail applications. We had it with WORM disks, write-once-read-many times optical disks that supported multi session writing.

      We could think of a backup disk where the command \rm -rf / will simply write a fresh empty table of linked inodes on /.

      When the "oops" moment comes, we will have tools that will go and find the previous versions of the inodes table for / and restore the files. We have developed very sophisticated back up tools, time-machine in MacOS comes to my mind, and version control suites. So it should not be difficult to come up with a "safe back up volume that never deletes anything". It will be very good to comply with audit trails etc.

      --
      sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
    3. Re:OMG! by ledow · · Score: 1

      And no desktop user will deploy it as when they delete their 20Gb games folder, it'll still be in the history on the disk taking up space. Even Windows has "Shadow Copies", but you can't keep everything around forever.

      WORM disks are used for backup for a reason. And, again, we're pushing this to the filesystem layer, where permissions can already prevent any kind of deletion if you want. But nobody does that.

      When a home user deletes files, they expect them to be deleted. When you remove your root folder, chances are whatever percentage of space you allocated to history will mean you've wiped out most of your files anyway, even with it enabled.

    4. Re:OMG! by chmod+a+x+mojo · · Score: 1

      Yet you don't address why we can't have a -o "nodelete" mount option at all.

      It's been years since I have done any filesystem digging, but don't most FSs mark a file as available space and not actually "delete" the file until it is written over? Why would it be so hard to have a mount option that forbids marking used space as free... other than possibly SSD trim / automatic fragmentation control maybe?

      That way you could add files to the FS but not remove them.
      You couldn't easily use this as a single partition / FS obviously, at least /tmp would have to be a standard mount, and updates to the system would require a remount. But I could see it being quite a nice thing to have, especially for non-tape backups.....

      --
      To err is human; effective mayhem requires the root password!
    5. Re:OMG! by 140Mandak262Jamuna · · Score: 1

      This volume is not meant for regular use, It would be mounted as a back up volume, written by backup software at scheduled intervals and it should be configured to save only important files. But a single \rm -rf /* would not destroy home disk and the mounted backup disk too.

      --
      sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
    6. Re:OMG! by azav · · Score: 1

      That approach makes temp files pretty impossible to use.

      --
      - Zav - Imagine a Beowulf cluster of insensitive clods...
  53. some poor person... by s1d3track3D · · Score: 1

    I bet someone is going through the blame diff's hoping they don't see their name... (2:03 https://www.youtube.com/watch?...)

  54. Re:unexpected deletion by Anonymous Coward · · Score: 0

    oh, that would be a good one for the obfuscated evil programming competitions...

    create a bunch of .files to store intermediate work, then...
    rm -rf .* // remove temp hidden files.

  55. Re:Oooh, I almost caused this in a product once to by xfurious · · Score: 1

    Yeah, you might not want to tell people that story. If the hard drive was empty afterwards, your PHP was running as root... sure hope that PHP wasn't being run from the web server.

  56. This looks like a job for... by Minwee · · Score: 1

    $ man rm

    Where's "rm --preserve-root" when you need it?

    1. Re:This looks like a job for... by Anonymous Coward · · Score: 0

      It would not have worked with 'rm -rf $STEAMROOT/*', because /* expands to /boot, /dev, /etc, and everything else under /, and --preserve-root does not protect those.

    2. Re:This looks like a job for... by cbhacking · · Score: 1

      Wouldn't help. This commend (see the * on the end?) deletes everything in root, but doesn't delete root itself. Just as dangerous, but harder to detect. Use this coding pattern today!

      --
      There's no place I could be, since I've found Serenity...
  57. Folder issue on OS X by Bender+Unit+22 · · Score: 1

    I had a problem with th OS X version of steam. Client updates failed when placing the program in a different folder than applications.

  58. Re: When I see that [literaly] textbook mistake... by Anonymous Coward · · Score: 0

    User level chroot?

  59. My hack to rm.c by John+Allsup · · Score: 2

    while ((c = ...
    {
        ...
    }

    /* INSERT THIS */

        if( x.interactive == RMI_NEVER && x.ignore_missing_files == true && x.recursive == true ) {
            char *mayi = getenv("RM_ALLOWRF");
            if(mayi && strcmp(mayi,"YES")) {
                printf("rm -rf allowed\n");
            } else {
                printf("rm -rf not allowed (set RM_ALOWRF=YES to enable)\n");
                exit(EXIT_FAILURE);
            }
        }

    /* END INSERT */

    if (argc <= optind)
        {
    ...

    --
    John_Chalisque
    1. Re:My hack to rm.c by brantondaveperson · · Score: 1

      Great. More weird environment-dependant behaviour.

  60. Damn... by jddj · · Score: 1, Funny

    GAME OVER

  61. Sandbox by iamacat · · Score: 1

    Android enhancements have been merged into Linux kernel, and it had solution to this problem for years. Time to support sandboxing in userland of mainstream Linux distributions. Then Steam can reset its own data all it wants, but can not harm the rest of the system. Nobody is taking away your freedom to give appropriate permissions to system administration tools, but you don't usually want games to administer your system.

  62. Re:unexpected deletion by HappyDrgn · · Score: 1

    I'm a long time system engineer. I use that command in scripts fairly often. It's not necessarily ingrained to not use it, just to use it with extreme care, which didn't happen in this case.

  63. One file tree under / by Hattmannen · · Score: 1

    And that's one reason I don't like the structure of *nix file systems.
    One false move and you can erase everything you have plugged into your system, including, but not limited to, all your hard drives, external hard drives, network mounts, memory cards, USB sticks etc.
    Sure, there's a good chance you can recover the lost data, but rebuilding a file system on one disk is painful enough, let alone all of your disks plus your NAS and it's even worse if just some of the files had their records deleted. At least in my experience.

    --
    People are not wearing enough hats.
    1. Re:One file tree under / by Anonymous Coward · · Score: 0

      Yes, instead lets just cram everything into a C: directory by default and surf some porn to get f'd in more way than one, not to mention craming files next to each other making need for defrag while at the same time wearing out a hard drive quicker.

  64. Re: When I see that [literaly] textbook mistake... by Trepidity · · Score: 4, Interesting

    That tends to be too restricted for things to actually run, alas. For example, something in a chroot can't even see libc or use standard Unix utilities on its own files, because /lib and /bin are outside of the chroot. You end up having to install a whole second copy of Linux inside the chroot...

  65. Re: When I see that [literaly] textbook mistake... by Anonymous Coward · · Score: 0

    Or use ACLs, which offer fine-grained permissions.

  66. Windows installer has a similar "feature" by janoc · · Score: 3, Insightful

    The Windows installer has a similar issue and apparently it is not even considered as a problem (red box):

    https://support.steampowered.c...

    This reeks of serious incompetence or negligence, in my opinion - writing installers that blindly mass-erase files instead of tracking which files did the software actually install and erase only those on uninstall/move is not acceptable in my book. Whether or not it is documented in some disclaimer that nobody reads or not is irrelevant. This really is asking for a lawsuit if someone gets seriously bitten by it.

    I really wonder what the devs at Valve were smoking when they consider this as acceptable.

  67. but why? by Anonymous Coward · · Score: 0

    why add the / and * to this command, valve? you can easily recreate the folder again later.

      [[ $STEAMROOT ]] && rm -rf $STEAMROOT

      mkdir $STEAMROOT

  68. Re:unexpected deletion by fnj · · Score: 1

    Bourne sh, POSIX sh, and bash globbing all suck because, while handy in very simple situations, they are not REs, not very versatile/capable, and not very intuitive. It's not that you CAN'T DO what you need to do; it's that you have to approach the problem uniquely.

    To match via globbing any file or directory starting with one or more dots, but exclude dot and dot-dot standalone pseudo-links, I believe the most efficient recourse is the somewhat perverse:
    ls -d1 .[^.]* ..?*

    which is quite an indictment of obstinate design stupidity. REs are better, but still a minefield. The best I can come with using REs are:
    ls -a | grep '^\..*[^.][^.]*$'

    and the slightly more concise
    ls -a | egrep '^\.+[^.]+$'

    I will leave it as an exercise to ponder why you need the -d but not the -a in the first form, but must use the -a and NOT the -d in the last two forms. It's pretty disgusting when you work out EXACTLY how those options work. The -1 is not necessary in the second two cases because the pipeline magically changes the output format.

  69. UNIX hater's handbook by Dekonega · · Score: 1

    Wasn't this almost same thing talked about in UNIX hater's handbook almost two decades ago? Why this is still an issue? Especially in a software like Steam?

  70. shell scripts by ssam · · Score: 3, Funny

    And yet some people still cling on to shell scripts for their boot system.

    1. Re:shell scripts by Anonymous Coward · · Score: 0

      And yet some people still cling on to shell scripts for their boot system.

      C and C++ are great for shooting yourself in the foot, too, and yet people still cling to them for kernels and other important software. What's your point?

      Thing is, you're making a faulty assumption, hopefully just for a joke and not because you think it's a valid argument. People aren't clinging to the shell scripts, they're clinging to the init system, because it's simple, mature, and stable. All it does is run other files according to some simple rules, and those files can be anything you want, which makes it flexible, too.

      Of course, as far as I know, init scripts don't have to be shell scripts. There's no reason you can't replace some (or all) of those scripts with small programs written in your language of choice, compiled or not, instead. It would be interesting to see a sysv-init setup where all the scripts are done with Perl or Python, which are already present in distros by default. You could do more robust checking for things while still keeping everything clean and readable. (Especially Python, though I'm not really a fan.)

  71. This is why you run Steam as sand boxed user. by Anonymous Coward · · Score: 0

    I thought everybody did that with huge lumps of alpha software?

  72. Re: When I see that [literaly] textbook mistake... by ganjadude · · Score: 4, Funny

    yo dawg, I heard you liked linux, so we are putting linux in yo linux!....

    --
    have you seen my sig? there are many others like it but none that are the same
  73. Re:unexpected deletion by Anonymous Coward · · Score: 0

    Suck they may, but when I need to operate on a set of files, or do any other thing I have needed to do with text as input/output in the world of the shell, I seem to *always* be able to get these things done.

    I mean, what i am saying is for selecting/deselecting files, operating on text for log file processing, data analysis, minor utilities, other mundane tasks, I don't seem to have any trouble.

    If the task is too big for the shell, then I go to the database.

    And yea, been doing this for years.

    I am thinking for the perfect, you are missing the good. But you sure sound smart!

    I suppose they suck, if by suck you mean work. Because for me, these things work.

  74. Old is new again by Anonymous Coward · · Score: 0

    Half-life (1) on Windows 9x did the same with the "program files"-directory.

  75. Re:unexpected deletion by Anonymous Coward · · Score: 0

    Suck they may, but when I need to operate on a set of files, or do any other thing I have needed to do with text as input/output in the world of the shell, I seem to *always* be able to get these things done.

    I mean, what i am saying is for selecting/deselecting files, operating on text for log file processing, data analysis, minor utilities, other mundane tasks, I don't seem to have any trouble.

    If the task is too big for the shell, then I go to the database.

    And yea, been doing this for years.

    I am thinking for the perfect, you are missing the good. But you sure sound smart!

    I suppose they suck, if by suck you mean work. Because for me, these things work.

    Some people call letting you shoot yourself "stupid".

    Others call it freedom.

  76. Re: When I see that [literaly] textbook mistake... by corychristison · · Score: 3, Interesting

    From what I understand, this is how Android works. Every app gets its own user and group.

    It is also, sort of, how Docker works. Each app gets its own container, the app is completely bound to that container. Docker manages access to outside resources (like the network) for you, utilizing cgroups, and kernelspace drivers.

  77. Re: When I see that [literaly] textbook mistake... by Anonymous Coward · · Score: 0

    This issue is old and solved. See, for instance, FreeBSD jails and unionfs.

  78. Whoops by ememisya · · Score: 1

    Somebody didn't have their coffee that morning XD Hahahaha

  79. Re:unexpected deletion by Anonymous Coward · · Score: 0

    Um, you have provided so little information, I can't even tell if you are agreeing with me or disagreeing.

    I mean, you may as well have posted "I'm not going to say anything.".

    Anyway, as much as the shell may be flawed in these respects, there is another benefit of the shell that isn't addressed in fnj's comment - and purposefully so I will add, because this was not his point. But - as a shell user responding, it is mine.

    With the shell and ten fingers, I can do things orders of magnitide faster than any windowing system + mouse could ever even think to do. Copy files, move files, write code, delete code, create directories, move directories, create reports, print reports, access databases, I could go on and on and on. If it's a text based activity - and most all useful programming when you look at it underneath the gui, is text based activities, then nothing at all beats using the shell.

    A mouse and a gui makes you slow.

    And yes, it's Emacs for me.

    That's all I have to say about that.

  80. as a windows user by Anonymous Coward · · Score: 0

    tell me again how much time/money/effort you have saved with linux ?

  81. Re: When I see that [literaly] textbook mistake... by hattable · · Score: 1

    That's the eternal problem though. The balance between power necessary and acceptable user/program hindrance.

    --
    OMG facts!
  82. Steam and LXC, or how to run it in a sandbox by Foresto · · Score: 1

    I don't trust Steam, so I run it in an unprivileged linux container. This way, it can't do too much damage and can't spy on my system so easily.

    Setting up LXC in such a way that games still work is not trivial, but also not terribly difficult if you know your way around the OS and are willing to do some reading and learning. Here are some tips to get you started.

  83. Re:unexpected deletion by Conley+Index · · Score: 1

    Bourne sh, POSIX sh, and bash globbing all suck because, while handy in very simple situations, they are not REs, not very versatile/capable, and not very intuitive. It's not that you CAN'T DO what you need to do; it's that you have to approach the problem uniquely.

    To match via globbing any file or directory starting with one or more dots, but exclude dot and dot-dot standalone pseudo-links, I believe the most efficient recourse is the somewhat perverse:
    ls -d1 .[^.]* ..?*

    Is this example supposed to be Bourne sh, POSIX sh, or bash globbing? Bourne sh is rather weakly defined, it is not POSIX, and who cares for bash...

    The description of basic regular expression bracket expressions in the Base Definitions volume of IEEE Std 1003.1-2001, Section 9.3.5, RE Bracket Expression shall also apply to the pattern bracket expression, except that the exclamation mark character ( '!' ) shall replace the circumflex character ( '^' ) in its role in a "non-matching list" in the regular expression notation. A bracket expression starting with an unquoted circumflex character produces unspecified results.

    Moreover, ls -d1 .[!.]* ..?* will probably give you ls: ..?*: No such file or directory and a non-zero exit status. And if you get .]: Event not found., you accidentally put it into a csh.

    And if you use for FILE in * .[!.]* ..?*, you cannot simply disregard [ "$FILE" = "..?*" ], because there can be a file with that name.

    I had more examples of great shell programming here, but could not get them through the junk character filter.

  84. Re:unexpected deletion by Conley+Index · · Score: 1

    Now, is this correct and portable?

    for FILE in * .[!.]* ..?* ; do [ "x$FILE" = "x*" -o "x$FILE" = "x.[!.]*" -o "x$FILE" = "x..?*" ] && [ ! -e "$FILE" ] && continue ; echo "$FILE" ; done

    I am not sure. That is the true beauty of shell programming.

  85. Re: When I see that [literaly] textbook mistake... by Wootery · · Score: 1

    People do that: virtualisation.

    In a sense it indicates that the OS has failed...

  86. Re: When I see that [literaly] textbook mistake... by Wootery · · Score: 3, Interesting

    I was hoping someone would mention Android.

    Just a pity Android doesn't let you do anything meaningful with that well-designed permissions infrastructure...

    For instance, you either trust an app with your entire contacts-list, or your contacts-list is out-of-bounds entirely. There no way to 'Add contact to app', and have that launch a trusted contact-selector utility.

  87. Serves him right by Anonymous Coward · · Score: 0

    Linok is shit for pedophiles. Repeat after me: Linok == pedophile.

  88. I don't buy it by barbariccow · · Score: 1

    What? preserving root is default. From rm man page: --no-preserve-root do not treat `/' specially --preserve-root do not remove `/' (default) So, is this a "generalization" that it did "rm / -Rf" ? I can't imagine a world they would specify the non-default flag of --no-preserve-root. Seems BS to me.

  89. This happened to bungie a long time ago by subanark · · Score: 1

    A very similar bug happened in one of Bungie's software (back when they made mac games) where an uninstall would delete more than just the game files. In response, they reissued new CDs and it was a massive cost to do so. This required they take out a loan and sell some stock, which ultimately resulted in Microsoft being able to buy them latter on.

  90. malicious: incompetent = venomous : poisonous by 140Mandak262Jamuna · · Score: 1

    The code was not malicious, It was incompetent. It is the difference between venomous and poisonous. Snake fangs are venomous, designed to kill. Arsenic is poisonous, it kills but not designed to.

    --
    sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
    1. Re:malicious: incompetent = venomous : poisonous by Richy_T · · Score: 1

      He didn't protect himself against malicious code and got caught by incompetent code.

  91. Order of typing by phorm · · Score: 1

    It's why I really prefer
        rm [path] -rf

    Linux allows this, but the last BSD I used required me to put the arguments before the path
        rm -rf [path]

    Why is this bad? Well, if accidentally tap enter or something akin to that while partway through typing a path, say goodbye to anything that's along the way!

  92. Citrix had the "//" bug to log in as admin by Anonymous Coward · · Score: 0

    This was many years ago. They had this "feature" where you could change your password while logging in. Just enter your username, then (IIRC) the password, and if there's a "/" after your password, then the new password, then another "/", it would log you in and change the password (or, perhaps, change the password and then log you in, for ownership issues etc).

    However, it didn't check whether the password was empty! So the first check, "is it current password" somehow succeeded when the data between the slashes was the empty string.

    So put the admin (or any user) in the username field, "//" in the password, and you've owned the (OS/2-based) system.

    This seems like a similar junior-level mistake.

  93. Re: When I see that [literaly] textbook mistake... by angel'o'sphere · · Score: 1

    Or you could hardlink to the originals before you call the chroot program (*facepalm*) ... ofc for that you need root permissions and it does not work on *all* unixes.

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  94. Re: When I see that [literaly] textbook mistake... by Richy_T · · Score: 1

    That is a different permission system to the one under discussion.

  95. Re: When I see that [literaly] textbook mistake... by Anonymous Coward · · Score: 0

    ...so you can Linux while you Linux!

    At least finish the quote dawg...

  96. Re:unexpected deletion by Richy_T · · Score: 1

    You don't even have to typo. There's a nasty bug in Konsole where if you're typing under load, it will get characters out of order. So rm -rf /var/tmp/x /var/tmp/y becomes rm -rf /var /tmp/x/var/tmp/y (or something like that). That was fun to recover from.

  97. Re:arguably steam isnt for linux. by david_thornley · · Score: 1

    I noticed long ago that the typical EULA guaranteed that the media would remain media for 90 days, and put severe restrictions on what I could do with any software I happened to find on it.

    --
    "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
  98. Re:unexpected deletion by ArsenneLupin · · Score: 1

    ls -a | grep '^\..*[^.][^.]*$'

    Misses files such as .a.b.

    ls -a | egrep '^\.+[^.]+$'

    Misses files such as .a.b. and .a.b. Try the following instead:
    ls -a | egrep '^\.([^.]|\..)' (a string starting with a dot, then either a non-dot or a dot followed by any character)

  99. Solaris rm -rf / by jgotts · · Score: 1

    There was a Solaris patch that did the equivalent of rm -rf /. I couldn't find a link, but I may have read about it on the RISKS Digest.

  100. Re:When I see that [literally] textbook mistake... by Lorens · · Score: 2

    The better system is called capabilities. Think "everything is a file descriptor". You want to create a file, you get a file descriptor. You want to run most programs, you give them read-write scratch space, a place to find common library routines (that don't carry any rights by themselves), and probably a read-write access to some graphical interface window. You're a browser, your user clicks on a java applet? You download the applet into a descriptor from your scratch space, you run it, giving it a read-write descriptor to some user interface sub-window created from your own window, read-write to a descriptor of some scratch space created from you scratch space, and read-execute of some descriptor containing a library, probably the same one you got from your parent. You have a video with a proprietary codec? You run the proprietary program as above with read-only to the video. You're a word processor? You get a RW descriptor to the file you're editing, and a call-back to your parent if your user requests an "open file" dialog, which returns a RW (or maybe RO) descriptor to the file the user indicated. See a pattern? See KeyKOS, which actually worked for years, and followers EROS, CapROS, Coyotos, which none got to to any useful status. There was a guy who rewrote libc on these principles, IIUC so that you'd only have to change file-handling logic in classical programs and recompile. But I get the impression that most people working on these things are security and OS researchers in academia (sincerely sorry if someone feels insulted, I'm not helping out and if you weren't working on it I wouldn't even know about these things), and not people saying OK, I have a generous budget, I have excellent developers and excellent team leads and stellar project managers, now I want a timeline and then a product.

    For other non-OS projects see Plash, Capsicum, Tahoe-LAFS, E-Lang, CapDesk...

  101. Re:unexpected deletion by Anonymous Coward · · Score: 0

    Yes, and so does . (current directory), but newer versions of rm won't obey that command:

    $ rm -rf .*
    rm: refusing to remove '.' or '..' directory: skipping '.'
    rm: refusing to remove '.' or '..' directory: skipping '..'

  102. Seems weird.. by brantondaveperson · · Score: 1

    ..but since '/' is owned by root (isn't it?) and isn't writeable by the user in question (presumably) then shouldn't the "rm -rf /*" stop at root and proceed no further? That would seem sensible to me.

    I mean, I know that's not now it works (obviously, since the problem occurred) - but why?

  103. Re:arguably steam isnt for linux. by Anonymous Coward · · Score: 0

    FYI BSD license was also the result of Richard Stallman (RMS). He wasn't completely happy about it, he was trying to get the folks at Berkley to use a license closer to the GPL. But, RMS very much influenced the BSD folks to release under a free license at all. Without RMS, you might not have access to BSD, so, stop hating.

    http://www.oreilly.com/openboo...

    Hired in 1986, Bostic had taken on the personal project of porting BSD over to the Digital Equipment Corporation's PDP-11 computer. It was during this period, Bostic says, that he came into close interaction with Stallman during Stallman's occasional forays out to the west coast. "I remember vividly arguing copyright with Stallman while he sat at borrowed workstations at CSRG," says Bostic. "We'd go to dinner afterward and continue arguing about copyright over dinner."
    .
    .
    .
    "I think it's highly unlikely that we ever would have gone as strongly as we did without the GNU influence," says Bostic, looking back. "It was clearly something where they were pushing hard and we liked the idea."

  104. Re:unexpected deletion by peppepz · · Score: 1

    If you were using coreutils in your nightmare, you would actually have no problem:
    (guys, don't do this at home, your rm implementation could differ)
    # rm -rf /
    rm: it is dangerous to operate recursively on '/'
    rm: use --no-preserve-root to override this failsafe
    # rm --version
    rm (GNU coreutils) 8.23
    You wouldn't enjoy such protection if you typed rm -rf /*, however.

  105. They are called directories on Unix by Anonymous Coward · · Score: 0

    Can we stop using the word that Microsoft invented for Windows ("Folder")?

  106. Re: When I see that [literaly] textbook mistake... by Anonymous Coward · · Score: 0

    With all the nice scripting languages out there, it's odd that anyone still uses bash.

  107. CCP has been there before, and survived by gutoandreollo · · Score: 1

    CCP's EVE Online once accidentally erased user's boot.ini file during a major patch.. http://community.eveonline.com... They survived, and there is even a commemorative item in-game in remembrance of the event. I think Steam will work this out, too. Any word on how many were affected?

  108. Re: When I see that [literaly] textbook mistake... by Wootery · · Score: 1

    You mean that it's a UI issue, rather than an issue of support existing in the OS?

  109. easy to prohibit by Anonymous Coward · · Score: 0

    `set -u' and you're done if using {,ba}sh

  110. Whoever in the right mind would use "rm -R"? by Anonymous Coward · · Score: 0

    Reminds me of actual scenario. True story. Well, I'm making up some details, like the name of the command and the precise source code, but this account does match the details that were given to me.
    The guy who owned local ISP made script named killuser
    #!/bin/sh
    rm -R /home/$1

    New employee with root access was reading procedures. Was told to run killuser. He decided to run it without parameters to get online help.

    Employee started to ask questions when he was surprised at just how long the killuser command was taking. Company fared okay because issue was discovered quickly and they got an opportunity that day to prove that backups were indeed functioning correctly. Truthfully, since this was a somewhat small local ISP, I find it rather unlikely that any of their customers noticed a thing.

  111. Not just every file you own... by Gallomimia · · Score: 1

    This command erases every file in every directory which your username is allowed write permissions. That's a lot of files.

    I guess I'll be setting up separate users for my gaming versus other usecases of the computer.

    --
    Sadly, a Libertarian cannot force his views on another, and freedom cannot spread as does the cancer known as religion.
  112. Re:arguably steam isnt for linux. by metrix007 · · Score: 1

    I could have sworn that that mantra appeared in BSD licenses well before the GPL was a twinkle in RMS' eye.

    BSD license was 88, GPL 89. Hardly that far apart.

    --
    If you ignore ACs because they are anonymous - you're an idiot.
  113. Re: When I see that [literaly] textbook mistake... by Richy_T · · Score: 1

    Not really. What you are talking about is capabilities provided by the Dalvik VM whereas what was being discussed was unix-style filesystem permissions.