
21 Jan
2015
21 Jan
'15
11:29 a.m.
On Sun, 18 Jan 2015 16:56:37 Lawrence D'Oliveiro wrote:
There’s a discussion currently raging <http://www.theregister.co.uk/2015/01/17/scary_code_of_the_week_steam_cleans _linux_pcs/> over a bug just like this in the Steam client for Linux. There is a script that contains the line
rm -rf "$STEAMROOT/"*
However, as a result of certain (unusual) user actions, the value of the STEAMROOT variable could end up empty, in which case the script proceeds to wipe out every file on the system that your userid has privilege over.
What’s the best way to handle this?
if [ -d "$STEAMROOT" ] ; then rm -rf "$STEAMROOT/"* else echo Steamroot directory "$STEAMROOT" does not exist or is not a directory exit 1 fi Wayne