Live data from Hacker News

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

github.com

151–160 of 280 posts

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

#151
post #113
post #55

Earlier quoted context omitted.

But why would the script prompt for user input unless something was awry? Presumably they control the contents of $STEAMROOT, so I don't see why rm -r should prompt unless it's about to do the wrong thing.

most systems have "alias rm='rm -i'" by default, so it would prompt on every single file regardless of ownership, etc.

Anyone considering putting customization like aliases where they'll execute even for non-interactive shells should go home and rethink their life. Thankfully, I've never encountered such a system.

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

#152

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.

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

#154
post #128
post #96

Why are we still running bash scripts? The only thing worse might be DOS batch files. It's not like python isn't available on every major linux distro. It's a little harder to ensure it's on windows, but when Steam is installing every point release of the Visual C++ runtime that has ever existed on my system, why not bundle python in there too?

And even if it isn't, modern perl would do as well as python for this case, with no language wars required.

Exactly. There are better options, that have more sane string and path handling. Much as I grumble about using Powershell on Windows, at least you've got the .Net framework underneath you that you can drop into relatively easily

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

#155

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…

How do you know it was?

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

#156

rm -rf "$STEAMROOT/"* This is why serious bash scripts use set -u # trap uses of unset variables Won't help with deliberately blank ones, of course. Scripting languages in which all variables are defined if you so much as breathe their names are such a scourge ... I did this once in a build script. It wiped out all of /usr/lib. Of course, it was running as root! That machine was saved by a sysadmin who had a similar…

rm --preserve-root -rf "$STEAMROOT/"* would have worked too.

Really? Have you tried it? If your shell expands globs and you have any directories below / (both very common conditions), rm will not receive any arguments that are the root directory, and your --preserve-root will not alter its behavior. --preserve-root would help if the author of this particular nugget hadn't made the additional mistake of inserting a needless /*, but with that there the root directory would never be an argument to the rm.

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

#157
post #150
post #136

Earlier quoted context omitted.

> Not on Debian or Ubuntu, and that's most of them Perhaps I should have said "sane systems" ;) Fedora ships with that alias by default FWIW.

I don't know why anyone would use Fedora by choice.

Frankly put, it's a fantastic development environment -- mostly because it's targeted at developers/power-users and not the average user.

It has the added benefit of being inside the "RHEL/CentOS" ecosystem (similar commands, structure, etc), provides a glimpse of what's-to-come in future releases of RHEL/CentOS, and since majority of servers in the enterprise are RHEL/CentOS based, it's a natural fit.

All that aside -- have you tried Fedora 21? It's a complete overhaul from previous Fedora releases and has a lot to like and offer.

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

#158

Earlier quoted context omitted.

There's nothing wrong with that line as long as you know "$STEAMROOT" contains a directory that you wish to nuke. The issue is that this particular script did not set up $STEAMROOT correctly.

The thing is, there are so many ways for STEAMROOT not to be set correctly in Bash. Just one typo in some future edit can bork everything if it's not tested thoroughly. Sure, you could somehow check that STEAMROOT is set to something resembling what you want to delete. But manifests are much more simple to get right. EDIT: Alternatively , pick a well-known UUID, and put everything under a directory with that name und…

I'm always annoyed when I see UUIDs in my directory structure, it's the same feeling I get when I see a big mac wrapper littered in my yard, or MSOCache in Windows system root for that matter.

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

#159

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…

> If a doctor accidentally removes the wrong organ

Incidentally, that sort of thing does happen sometimes.

http://www.cnn.com/2010/HEALTH/10/18/health.surgery.mixups.c...

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

#160
post #157
post #150

Earlier quoted context omitted.

I don't know why anyone would use Fedora by choice.

Frankly put, it's a fantastic development environment -- mostly because it's targeted at developers/power-users and not the average user. It has the added benefit of being inside the "RHEL/CentOS" ecosystem (similar commands, structure, etc), provides a glimpse of what's-to-come in future releases of RHEL/CentOS, and since majority of servers in the enterprise are RHEL/CentOS based, it's a natural fit. All that aside…

I guess I have always had ideological issues with RedHat, as a distribution. It doesn't surprise me that they would put the -i alias in Fedora; this kind of "helpful" addition that is actually totally annoying and inappropriate is, IMO, emblematic of the distro.

I'm sure it works for some but it's not for me.

Post reply on HN