Bug in steam deletes everything owned by the user

A recent bug reported at steam-for-linux Github page shows that it might delete all the contents owned by the system user who is running it. That includes all the files owned by user in system hard disk and if there any external storage device connected then steam will remove all the files from it also. Comments in the bug report indicate that people are now scared to start Steam :).

Steam for Linux

As per the updates it all started from this commit. In which the developer added code to delete the directory stored in the variable $STEAMROOT without doing a sanity check on it.

A test script I created shows that if it is invoked using bash binary then the variable might get empty, resulting in deletion of everything under /.

Same kind of mistake happened recently with Bumblebee Project which provides NVIDIA optimus support in Linux. Bug in Bumblebee installer script caused deletion of whole /usr directory.