Spoiler: due to a forgotten space the entire /usr folder was deleted
Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user
61–70 of 280 posts
Re: Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user
#62Re: Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user
#63Earlier quoted context omitted.
"rm -df /" does nothing. "rm -df" does not remove non-empty directories.
That's awesome, I didn't catch the s/r/d/.
Note also that putting a "*" in the MANIFEST doesn't do anything either, as neither xargs nor rm expands wildcards (only bash does).
Re: Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user
#64Earlier quoted context omitted.
Yep, my thought exactly. My standard bash header is #!/bin/bash set -eu IFS=$'\n\t' (Wish there was a shorthand version of pipefail, then I'd always use that too.)
You can save a line by doing #!/bin/bash -eu
Re: Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user
#65Earlier quoted context omitted.
There are, it's called users, and groups, and file permissions. Applications like steam should really be running under a separate user so they can't write to personal files (and maybe just have read permissions). But of course proper application isolation and file permissions is something few people do correctly on their personal machines, let alone know about. Window managers don't make it any easier, and I put a lo…
It seems like the direction Linux is going (albeit slowly) is to use selinux instead of different users for this type of isolation.
Re: Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user
#66Here'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…
Re: Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user
#67Many of the comments mentioned this should have been caught in the code review. I suspect they don't perform code reviews. Makes me wonder, is there a tool, system, service for auditing how many 'pair of eyes' have reviewed a given line of code. This would be hard to determine, but could be useful. I am envisioning a heatmap bar or overlay that indicates the number of reviews a line of code has received.
Re: Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user
#68# Scary! rm -rf "$STEAMROOT/"* Anybody who writes a line like this deserves their software engineer license revoked. This isn't the first time I've seen shit like this (I've seen it in scripts expected to be run as root, no less); it makes my blood boil. Seriously. "xargs rm -df -- EDIT: I shouldn't be so harsh, if it weren't for the comment admitting knowing how poor an idea this line is.
Of course once it was a identified a concerted effort could have been made to rectify the situation.
Sometimes a problem is identified working on some unrelated aspect of the software and the developer does not have time or scope to change the offending piece of code but wants to place a red flag.
Of course this example does not appear to be systematic approach to marking "fixme", unless of course their fixme tag is actually #scary.
Edit: Of course one would hope they have raised a rather high priority work item for this.
Re: Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user
#69For those of you worried about important files, chattr +i is a useful defence. No easy way of applying this automatically. Long ago I had a kernel hack that would kill any process that attempted to delete a canary file. Worked OK but no chance of it ever going mainstream.
Re: Moved ~/.local/share/steam. Ran steam. It deleted everything owned by user
#70If you're curious about who the "Scary!" guy is, someone pointed to where the code was checked in: https://github.com/lrusak/steam_latest/commit/21cc14158c171f...