Many software bugs are merely annoying or inconvenient, but some can have extremely serious consequences—either financially or as a threat to human well-being.[1] The following is a list of software bugs with significant consequences.
STEAMROOT="$(cd "${0%/*}" && echo $PWD)"
# Scary!
rm -rf "$STEAMROOT/"*
$0
. It would also fail if $0
contained no slash character, or contained a broken symlink, perhaps mistyped by the user. The way it would fail, as ensured by the &&
conditional, and not having set -e
cause termination on failure, was to produce the empty string. This failure mode was not checked, only commented as "Scary!". Finally, in the deletion command, the slash character takes on a very different meaning from its role of path concatenation operator when the string before it is empty, as it then names the root directory.See also Category:Computer security exploits
{{cite web}}
: CS1 maint: unfit URL (link)
{{cite web}}
: CS1 maint: unfit URL (link)