Steam has had a bit of embarrassment on Linux recently, as an oversight in one of their scripts will cause it to remove all your files, eeek!
The issue is being a bit overblown though, as you need to do some pretty specific stuff to make it happen, and it isn't just on Linux, the issue does exist in some form on Windows too. On Windows for example if you install Steam inside a folder with other data, it will remove that too:
QuoteThe uninstallation process deletes the folder Steam was installed to to ensure it is fully uninstalled. If you accidentally installed Steam to a folder containing other data, for example C:\Program Files\ instead of C:\Program Files\Steam\, STOP! Do not run the uninstaller and instead carefully follow the instructions below for Manually Removing Steam, except only delete Steam-related files in step 3.
Source
On Linux the issue has been tracked to being inside their "steam.sh" file, as it does no checking on the steam root folder.
Here is the part in question:
Quote# Scary!
rm -rf "$STEAMROOT/"*
It's amusing (in a bad way) that it even has a comment of "Scary!", so they probably knew they should have done some extra checks anyway. It's pretty basic in most languages to check something exists properly before trying to remove it.
It seems the issue arises if you move your Steam directory somehow, so if you aren't messing with moving it around and doing some linking, then you should be okay. Still, pretty scary stuff.
It should be sorted soon though, as "johnv-valve" is on the job and has plans for a fix already.
You can see the rather long bug report here. Sadly, the community seems to be quite silly and have started posting a lot of useless crap on the report, but it looks like Valve may have cleared the useless comments up.
Remember folks to keep bug reports clean as reports and feeback, don't go posting stupid memes.
Some you may have missed, popular articles from the last month:
It is already fixed in beta client.
These guys seem to be rather bad at bash. =/
if [ "$STEAMROOT" != "" ]; then
rm -rf "$STEAMROOT/"*
fi
0 Likes
I think there are more validation checks necessary instead of just checking if the variable is empty. At least check if it's actually a directory. If I used such a bad error handling on my clients' systems I'd be in huge trouble.
3 Likes, Who?
And thats why I have another user account for running proprietary apps...
0 Likes
Quoting: sonicAnd thats why I have another user account for running proprietary apps...It's impossible to close source in a shell script. So a complaint about proprietary software is completely invalid here.
0 Likes
Quoting: FlutterRageI think there are more validation checks necessary instead of just checking if the variable is empty. At least check if it's actually a directory. If I used such a bad error handling on my clients' systems I'd be in huge trouble.Yes, [[ -d "$STEAMROOT" ]] would have been a much better solution.
1 Likes, Who?
Quoting: sonicAnd thats why I have another user account for running proprietary apps...That is a smart idea.
0 Likes
Perhaps it's an incentive to stop people uninstalling Steam? j/k
1 Likes, Who?
Workaround :
set in your /etc/bash.bashrc :
alias rm='rm --preserve-root'
Anyway this is dangerous...
set in your /etc/bash.bashrc :
alias rm='rm --preserve-root'
Anyway this is dangerous...
0 Likes
No, --preserve-root doesn't help here (and it's enabled by default in many distributions already).
They're doing
Note the *. Which, when $STEAMROOT is empty, expands to
--preserve-root is completely okay with deleting that.
They're doing
rm -rf $STEAMROOT/*
Note the *. Which, when $STEAMROOT is empty, expands to
rm -rf /bin /boot /dev [...]
--preserve-root is completely okay with deleting that.
2 Likes, Who?
I create a special file called "-i" in directories I want to keep safe.
I do this by doing:
touch ./-i
forces rm to be interactive.
I do this by doing:
touch ./-i
forces rm to be interactive.
0 Likes
See more from me