Earlier quoted context omitted.
While you're at it: set -e # exit on unchecked failure That way you don't trudge forward through an untested code path after a failure, you stop there and then.
I use this holy trinity in most of my scripts: set -o nounset # set -u set -o errexit # set -e set -o pipefail # I'm not sure this has a short form. I use the long forms for the option names because they're self documenting. If anyone has more suggestions, I'm all ears.
Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user
221–230 of 280 posts
Re: Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user
#222This seems like yet another good example of why robust application-level access control would be a helpful thing to build into modern operating systems, in addition to the typical user-based controls. This may have been both a rookie mistake and a regrettable failure of code review processes, but in any case it simply shouldn’t be possible for an application running on a modern system to wipe out all user data withou…
Re: Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user
#223Wow, an awful bug -- and brings back memories of a very similar bug that we had back in the late 1990s at Sun. Operating system patches on Solaris were added with a program called patchadd(1M), which, as it turns out, was actually a horrific shell script, and had a line that did this: rm -rf $1/$2 Under certain kinds of bad input, the function that had this line would be called without any arguments -- and this (like…
>A self-destruct button really doesn't make sense Bryan--you mean Star Trek didn't get it right? Well, at least they didn't allow shell scripts. It's an interesting philosophical question though. At what point do you decide that the user truly really can't want to do this even though they've said that they do?
A real self-destruct button would ensure you couldn't recover the data anymore.
So at least try "dd if=/dev/random of=/dev/sda" or more elegant when available, throw away the decryption key.
Re: Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user
#224Earlier quoted context omitted.
There are several problems with your ideas. The most important one is that programmers only call themselves engineers until it comes time to take legal responsibility for their work; then suddenly they're artists creating works for hire. Programmers have worked very hard through the years to create the current liability-free environment; people die because of health care programming bugs, pilots crash because of avio…
Can anyone design a safe and reliable bridge with a span of indeterminate length across unpredictable geography?
Re: Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user
#225Earlier quoted context omitted.
Not if the previous line was: STEAMROOT=$SOME_OTHER_UNSET_VARIABLE/ "rm -r " is a code smell, as much as "cc -o myprog .c" is. You should always know what files make up your system, and track them in a MANIFEST file. There's rarely a good reason to use wildcards when a program is dealing with its own files. xargs rm -df -- fixes this.
rm --preserve-root isn't a bad thing to have either. That way, even if you do screw up, you won't be able to run rm against '/', even with '-f'. It's one of the top aliases in my .bash_aliases file.
rm --preserve-root -rf /*
doesn't save you.Re: Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user
#226Since this kind of thing keeps happening, isn't there a need for a safer tool than shell scripts? Maybe with a little bit more safety around null/empty variables and not as stringly typed?
Re: Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user
#227Earlier quoted context omitted.
Steam is another category of application which wants to write to directories used by other applications...
Why? In my Windows VM, all Steam data lives in C:\Program Files\Steam. (Plus start menu entries etc.)
Re: Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user
#228Earlier quoted context omitted.
Just because you've invented solar panels does not mean that you've solved the energy crisis. Sometimes the implementation of technology is just as inventive as the invention itself.
lol, ok lets break this down Barney style: Converting sunlight to electricity is a solved problem. The "energy crisis" remains unsolved. Jailing processes is a solved problem. Preventing users from shooting themselves in the foot remains unsolved. Now let us reexamine the post: > ...would be a helpful thing to build into modern operating systems... Already built in. > Why can’t we also have something analogous where…
Some systems mentioned in this HN discussion are closer to the kind of model I had in mind. As other posters have pointed out, the difficulty is how you structure a system so that it is reasonably effective by default but still usable by non-experts. I believe we could achieve this — or at least get much closer than the typical security models we use at the moment — but it will surely take a lot more thought and experimentation than we have attempted as an industry so far. Microsoft’s UAC mechanism makes an interesting case study here: it was fundamentally a reasonable idea, but the first implementation proved too intrusive for average users to tolerate and lost much of its effectiveness as a result.
Re: Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user
#229Earlier quoted context omitted.
Why? In my Windows VM, all Steam data lives in C:\Program Files\Steam. (Plus start menu entries etc.)
Steam manages game installation and updates; those games are themselves separate applications. That's what I was referring to.
One would be analogous to an ACL arrangement rather than simple ownership. Steam applications could be installed with Steam also having permission to access their resources.
A second possibility would be to have the operating system provide dedicated services for installing and maintaining software. We’re already heading in that direction on some platforms anyway, and it would be useful generally given the kind of security model I suggested. Then software like installers/updaters or package managers can do their jobs in a tightly controlled way, without needing any general access or introducing the accompanying security risks.
Re: Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user
#230This seems like yet another good example of why robust application-level access control would be a helpful thing to build into modern operating systems, in addition to the typical user-based controls. This may have been both a rookie mistake and a regrettable failure of code review processes, but in any case it simply shouldn’t be possible for an application running on a modern system to wipe out all user data withou…
Like AppArmor, or SELinux, or any of the other applications which have their hooks in the LSM? They do a fantastic job of this, if you can figure out how to use them. The truth is that they are too hard for even your average Sysadmin to configure & manage, let alone your average desktop user. setenforce=1 (yeah, right).
I’d like to see the industry moving in that general direction, though. Even a much simpler model could bring real benefits relative to the status quo, where in application terms our current security model is analogous to everything being root.