-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Moved ~/.local/share/steam. Ran steam. It deleted everything on system owned by user. #3671
Comments
I am impressed how calm you stay about this. This is terrible. I just lost my home directory. All i did was start steam.sh with STEAM_DEBUG=1. I will investigate this and report back. edit1: I suspect steam.sh got some bugs(does not check own variables) and when it tried to do scary things it crapped himself. edit2: It gets better. Seems on windows Steam is overeager too! https://support.steampowered.com/kb_article.php?ref=9609-OBMP-2526 (The warning part is interesting. Because everybody reads this before uninstalling...) |
I agree, that line minimally requires an exists and not null check for $STEAMROOT |
#scary! As an ex programmer, that really makes me chuckle. Can I at least get an apology from whoever committed that comment without adding a fix? |
This also happened to me a few weeks ago, my entire home was deleted by the steam.sh script. |
introduced here Sep 10, 2013 https://github.com/indrora/steam_latest/commit/21cc14158c171f5912b04b83abf41205eb804b31 line 359
but what exactly caused this? i've symlinked ~/.local/share/steam to, so i am a bit afraid to start steam :/ |
pythoneer, I believe the issue starts on line 19:
This probably returns as empty which mean: |
TcM1911, that's my guess, too. |
@keyvin @d00fy : Did any of you deliberately invoked that script with that option? If yes, why did you do it? What were you trying to achieve? Removing user data is obviously wrong, no doubt about it. But if this happens only when user requests certain action, scope of that issue is somewhat limited. |
Yeah, they kinda need a readlink in there.
|
@minio Not "only if". |
@minio A script accidentally running |
it is like bumblebee all over again! |
I encountered Steam behaviour like with «--reset» for several times: |
wonder what the code path is to hit that rm without --reset |
Can confirm; I have Steam bounded in an SELinux context ("Steam") and SELinux spits out:
Ooops. I'll write a patch and PR it 🍺 |
Does anybody have reliable repro steps for this? I can easily add the checks for STEAMROOT being empty, but I would also like to fix the root cause if possible. |
It will definitely fail if you run steam.sh as |
Using (For those not familiar, |
Which is the same thing that would have happened had the unnecessary '/*' not been there anyway, it would have errored out. Its not necessary because the rm was set to recursive already...
|
Here is a patch which enables |
@rcxdude Come on. We are on github here. Do that in a PR please! Do not post whole patch files into issues... 👎 |
@mablae There is no code on this repo, there is nothing to send in a PR against. A gist wouldn't have gone astray though 😄 |
@rcxdude: Please link to a Gist. |
@johnv-valve regardless of tracking down the cause of this, this rm line must be protected from future accidental gremlins due to the severity of the fail scenario. |
@dannyfallon Oh, sorry then... |
Does it happen only if you move ~/.local/share/steam ? #scary! :s |
The idiomatic way to do this in Bash is to use default variables as in , |
@ju2wheels But a Half Life 3 talk didn't even have a chance to start! |
Has this problem been fixed? I really want to play the metro series, but this scares the crap out of me. |
@user15177 Set up a chroot for Steam and run it from there so it can do no harm to your actual system. |
@craig-sanders Since you posted some cleaned-up code from the script and some good Bash scripting advice, a note: Always use the |
When expanding variables to pass to `rm`, make sure that the path variable is set and fail if it is not. This prevents an `rm` from accidentally expanding to `rm ""/*` when the variable is unset: ValveSoftware/steam-for-linux#3671 Using `${FOO:?}` syntax will fail when `FOO` is unset.
* dev.sh: use dash instead of slash for msbuild Instead of switching between windows and non-windows to determine how to handle slashes for msbuild, use dashes instead of slashes to simplify the calling. * dev.sh: stop on errors Stop on errors, instead of continuing. This prevents us from failing to move through the directory space with `cd` / `pushd` / `popd` but still running commands. This is particularly dangerous when running commands like `rm`. * dev.sh: quote all filepaths Since directories may have a space in them, quote them to treat them as a single entity instead of wordsplitting on a space. Otherwise, if `FOO="a b c"` then `rm -rf $FOO` will remove files or folders named `a`, b`, and `c` instead of removing the single entity named `a b c`. * dev.sh: remove files carefully When expanding variables to pass to `rm`, make sure that the path variable is set and fail if it is not. This prevents an `rm` from accidentally expanding to `rm ""/*` when the variable is unset: ValveSoftware/steam-for-linux#3671 Using `${FOO:?}` syntax will fail when `FOO` is unset. * dev.sh: quote the `$` in `$LastExitCode` `$LastExitCode` is not a bash variable; to pass that string along to PowerShell, it needs to be quoted. * dev.sh: use $(cmd) syntax instead of backticks The $(cmd) execution syntax is preferred over the legacy backtick syntax. * dev.sh: quote variables * externals.sh: quote variables to cope with spaces Quote the variables for the directories so that we can properly work with directories with spaces in their names.
Is this fixed? xD |
whoa what the heck does the unassigned message mean |
@aviwad It's just something GitHub does automatically when the assigned person doesn't actually do anything about the issue and someone comments on it again. |
Its still happening. It deleted almost everything on my Ubuntu. |
Hello @nicklleite, the investigation of the issue in this issue report concluded several years ago. Please open a new issue report. |
This comment has been minimized.
This comment has been minimized.
? |
Edit: Please stop posting stupid image memes or unhelpful messages. This interferes with Valve's ability to sift through the noise and see if anyone can figure out what triggers it.
This may not be a common problem because I change all sorts of configuration about my system. The script in question does something in a really, really stupid way, but it probably doesn't trigger the fail scenario for every system because...
Original Bug:
I am not sure what happened. I moved the folder in the title to a drive mounted under /media/user/BLAH and symlinked /home/user/.local/steam to the new location.
I launched steam. It did not launch, it offered to let me browse, and still could not find it when I pointed to the new location. Steam crashed. I restarted it.
It re-installed itself and everything looked great. Until I looked and saw that steam had apparently deleted everything owned by my user recursively from the root directory. Including my 3tb external drive I back everything up to that was mounted under /media.
Everything important, for the most part, was in the cloud. It is a huge hassle, but it is not a disaster. If there is the chance that moving your steam folder can result in recursively deleting everything in the directory tree you should probably just throw up an error instead of trying to point to other stuff. Or you know, allow the user to pick an install directory initially like on windows.
My system is ubuntu 14.04, and the drive I moved it to was ntfs if its worth anything.
The text was updated successfully, but these errors were encountered: