Live data from Hacker News

Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user

github.com

181–190 of 280 posts

Re: Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user

#181
post #3

Here's the offending shell script code: # figure out the absolute path to the script being run a bit # non-obvious, the ${0%/*} pulls the path out of $0, cd's into the # specified directory, then uses $PWD to figure out where that # directory lives - and all this in a subshell, so we don't affect # $PWD STEAMROOT="$(cd "${0%/*}" && echo $PWD)" [...] # Scary! rm -rf "$STEAMROOT/"* The programmer knew the danger and di…

Offending commit @ https://github.com/lrusak/steam_latest/commit/21cc14158c171f...

The reaction images/memes are priceless.

Re: Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user

#182

To those name-calling the author of the script: The product/update is hyped and the release date is set in stone. Tensions are high and your boss has already let you know that you're on thin ice and not delivering on the project goals. A last-minute showstopper bug comes in, caused by file leaks. Everyone is scrambling, and the file belongs to you so its on you to fix it alone. There is no time for code review, and d…

So I guess it's a choice between getting fired for not meeting a deadline, and getting fired for destroying customer data. I'd rather take the first option. At least my reputation will still be somewhat intact. And as a bonus, I can get out of that hostile environment earlier.

> I'd rather take the first option. At least my reputation will still be somewhat intact.

I'd take the same option, but for different reasons: the customer's data. Only pictures of e.g. a deceased wife, no backup, and you just deleted them. You can arm-wave all you like about backing up, but you deleted them.

Re: Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user

#183
post #40
post #3

Here's the offending shell script code: # figure out the absolute path to the script being run a bit # non-obvious, the ${0%/*} pulls the path out of $0, cd's into the # specified directory, then uses $PWD to figure out where that # directory lives - and all this in a subshell, so we don't affect # $PWD STEAMROOT="$(cd "${0%/*}" && echo $PWD)" [...] # Scary! rm -rf "$STEAMROOT/"* The programmer knew the danger and di…

I thought I was a bad programmer until I saw this thread. How did this make it to prod?

Tight deadlines, limited resources (programmers), limited budget, limited QA

Re: Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user

#184

To those name-calling the author of the script: The product/update is hyped and the release date is set in stone. Tensions are high and your boss has already let you know that you're on thin ice and not delivering on the project goals. A last-minute showstopper bug comes in, caused by file leaks. Everyone is scrambling, and the file belongs to you so its on you to fix it alone. There is no time for code review, and d…

Yes, that person is still an unprofessional idiot. If a doctor accidentally removes the wrong organ because administrators have overscheduled him, "whoopsie, not my fault" is not the appropriate answer. The same applies to engineers working on bridges. Professionals take responsibility for their working conditions. There is an enormous shortage of programmers right now. Anybody shipping stuff that is bad or dangerous…

It's hard to be professional if no one wants or values it but you. The word your manager would use is "obstinate."

If they have not internalized the consequences of the risks they're asking their subordinates to take, they'll weigh what look like vague misgivings about "mumble, should be better, dangerous, blah blah" against the better understood risk of their bonus disappearing if the product doesn't ship on time.

Even if you choose to sacrifice yourself, your reputation, and your future prospects--again, if almost no employer in your industry would value what you call professionalism over short-term profits--someone else will ship the code you wouldn't.

That isn't a defense of anything; it's just a fact. Taboos (e.g. against bad code) don't work if they're not shared by the majority.

Re: Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user

#185

Earlier 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…

[deleted]

Re: Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user

#186
post #21
post #3

Here's the offending shell script code: # figure out the absolute path to the script being run a bit # non-obvious, the ${0%/*} pulls the path out of $0, cd's into the # specified directory, then uses $PWD to figure out where that # directory lives - and all this in a subshell, so we don't affect # $PWD STEAMROOT="$(cd "${0%/*}" && echo $PWD)" [...] # Scary! rm -rf "$STEAMROOT/"* The programmer knew the danger and di…

Gotta question why they used -f.

Probably to delete subfolders.

Re: Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user

#187
post #19

Something like this with Steam happened to my friend not too long ago. It was very saddening because he literally lost years of files (including personal projects) and salvaged what he could. That was with the Steam Beta and I caught Steam doing this myself (after he told me what happened). I was lucky to stop the script and switched out of the beta. At the time he reported this to Valve themselves and said they were…

That is quite frustrating, and consumer vendors should be mindful of creating life-changing experiences. Also: backups. I know it sounds cliche, but look, if it has a mechanical hard drive, the manufacturer could have slightly mis-calibrated one of the mechanical assemblies, and this could have happened because the nature of digital storage is that it is essentially ephemeral. Protect yourself from things outside you…

But if that external usb drive is mounted at the time (as in the case of the user this thread is about), then all data on that drive will be deleted.

For this reason, the recommened way to use things like rsnapshot is to have your backup directories owned by root and with permissions masked to something like rwxr--r--. If you then want to read your backups easily, you do things like mount it under NFS as read-only.

Re: Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user

#188

To those name-calling the author of the script: The product/update is hyped and the release date is set in stone. Tensions are high and your boss has already let you know that you're on thin ice and not delivering on the project goals. A last-minute showstopper bug comes in, caused by file leaks. Everyone is scrambling, and the file belongs to you so its on you to fix it alone. There is no time for code review, and d…

> Tensions are high and your boss has already let you know that you're on thin ice and not delivering on the project goals.

Valve doesn't have bosses, remember?

Re: Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user

#189
post #21
post #3

Here's the offending shell script code: # figure out the absolute path to the script being run a bit # non-obvious, the ${0%/*} pulls the path out of $0, cd's into the # specified directory, then uses $PWD to figure out where that # directory lives - and all this in a subshell, so we don't affect # $PWD STEAMROOT="$(cd "${0%/*}" && echo $PWD)" [...] # Scary! rm -rf "$STEAMROOT/"* The programmer knew the danger and di…

Gotta question why they used -f.

That's normal, but why the trailing slash?! That's just pointless, and almost looks like an explicit deathtrap.

Without the slash, an empty variable would result in a command line of "rf -rf" which would simply fail due to the missing argument.

There is absolutely no need for having a trailing slash, it's not as if "rf -rf foo" and "rm -rf foo/" can ever mean two different things, there can be only one "foo" in the file system after all.

Very interesting way of introducing an epic fail with a single character, that really looks harmless.

Post reply on HN