You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Moved ~/.local/share/steam. Ran steam. It deleted everything on system owned by user. #3671
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.
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.
Line 468: rm -rf "$STEAMROOT/"*
Reacted by Aaron Franke, Matti Schneider, Parker Reed, jasonszhao, Alex O'leary, catsocks, Niklas, Diego Peixoto, ikbenlike, Alisa Sireneva and 18 more
Reacted by vantroy, Matthis Kruse, Siarhei Krukau, Luke Nelson, Gaurav Kumar, Pieter Vantorre, Parker Reed, geeknik, Jeyfel Brandauer M, Daniel Aleksandersen and 41 more
Reacted by Paul "Joey" Clark, Fanfan54 and Tommy Vercety
Reacted by xyang, Aleksandar Puharic, Jonas Stein, Kyrylo V. Polezhaiev and Safin Singh
Reacted by Harry Newsome, pizzanfruit, Paul, Torbjørn Viem Ness, Jonas Stein, Rakin Rahman and VasiliiGeneralov
rm -rf "$STEAMROOT/"* could be evaluated as rm -rf "/"* if $STEAMROOT is empty
but what exactly caused this? i've symlinked ~/.local/share/steam to, so i am a bit afraid to start steam :/
Reacted by Shaun Henderson, Barry Haertel, Agustín Covarrubias and Eddie Antonio Santos
Reacted by Andrew Vorobyov, Pharap, Catalin Gheonea, Deri Herdianto, Mijyuoon, Marvin Cai, Maor Kadosh, pito-svk, Joanna Adeele Siig, Umedzhon Abdumuminov and 13 more
# figure out the absolute path to the script being run a bit
# non-obvious, the ${0%/*} pulls the path out of $0, cd's into the
# specified directory, then uses $PWD to figure out where that
# directory lives - and all this in a subshell, so we don't affect
# $PWD
STEAMROOT="$(cd "${0%/*}" && echo $PWD)"
STEAMDATA="$STEAMROOT"
This probably returns as empty which mean: rm -rf "$STEAMROOT/"* is the same ass rm -rf "/"*.
Reacted by J.M. Janzen, Felix Uhl, Parker Reed, Gerard Madorell, ikbenlike, Mikko Vedru, Giyas Umarov and Łukasz Drukała
Reacted by Andy, vantroy, Parker Reed, hintss, Gerard Madorell, Pharap, Mijyuoon, Di, Stanislaw Halik, pito-svk and 27 more
Reacted by Ruan, Alexander and Sockie
Reacted by Gerard Madorell
Reacted by Mikko Vedru and Tommy Vercety
Reacted by Harry Newsome, Torbjørn Viem Ness, Mikko Vedru, Anderson Marques and Manuel Maute
I encountered Steam behaviour like with «--reset» for several times:
when I added «--reset» AND when I didn't. So — not «only if», can
confirm this, even having not deleted ~/.steam/ dir, too.
Can confirm; I have Steam bounded in an SELinux context ("Steam") and SELinux spits out:
Context violation: process /home/indrora/.local/share/Steam/ubuntu12_32/steam is only allowed in context steam_context, attempted to remove /boot/efi/grub/efistub
@craig-sanders Since you posted some cleaned-up code from the script and some good Bash scripting advice, a note: Always use the [[ ]] test syntax in Bash-specific scripts. It's safer and cleaner in all cases.
@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.
Activity
doofy commentedon Jan 15, 2015
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.
Line 468: rm -rf "$STEAMROOT/"*
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...)
Tele42 commentedon Jan 15, 2015
I agree, that line minimally requires an exists and not null check for $STEAMROOT
keyvin commentedon Jan 15, 2015
#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?
CamilleScholtz commentedon Jan 15, 2015
This also happened to me a few weeks ago, my entire home was deleted by the steam.sh script.
pythoneer commentedon Jan 15, 2015
introduced here Sep 10, 2013 https://github.com/indrora/steam_latest/commit/21cc14158c171f5912b04b83abf41205eb804b31 line 359
rm -rf "$STEAMROOT/"*could be evaluated asrm -rf "/"*if$STEAMROOTis emptybut what exactly caused this? i've symlinked ~/.local/share/steam to, so i am a bit afraid to start steam :/
TcM1911 commentedon Jan 15, 2015
pythoneer,
I believe the issue starts on line 19:
This probably returns as empty which mean:
rm -rf "$STEAMROOT/"*is the same assrm -rf "/"*.pythoneer commentedon Jan 15, 2015
TcM1911,
that's my guess, too.
jthill commentedon Jan 15, 2015
Yeah, they kinda need a readlink in there.
jthill commentedon Jan 15, 2015
@minio Not "only if".
reset_steamis also invoked by removing your.steamdirectory, since that setsINITIAL_LAUNCHsoren121 commentedon Jan 15, 2015
@minio A script accidentally running
rm -rf /*is unacceptable in any scenario.gtmanfred commentedon Jan 15, 2015
it is like bumblebee all over again!
MrMEEE/bumblebee-Old-and-abbandoned#123
Plaque-fcc commentedon Jan 15, 2015
I encountered Steam behaviour like with «--reset» for several times:
when I added «--reset» AND when I didn't. So — not «only if», can
confirm this, even having not deleted ~/.steam/ dir, too.
prometheanfire commentedon Jan 15, 2015
wonder what the code path is to hit that rm without --reset
indrora commentedon Jan 15, 2015
Can confirm; I have Steam bounded in an SELinux context ("Steam") and SELinux spits out:
Context violation: process /home/indrora/.local/share/Steam/ubuntu12_32/steam is only allowed in context steam_context, attempted to remove /boot/efi/grub/efistubOoops. I'll write a patch and PR it 🍺
248 remaining items
user15177 commentedon Nov 28, 2017
Has this problem been fixed? I really want to play the metro series, but this scares the crap out of me.
alphapapa commentedon Jan 1, 2018
@craig-sanders Since you posted some cleaned-up code from the script and some good Bash scripting advice, a note: Always use the
[[ ]]test syntax in Bash-specific scripts. It's safer and cleaner in all cases.dev.sh: remove files carefully
dev.sh fixups (#2114)
aviwad commentedon Mar 17, 2019
Is this fixed? xD
aviwad commentedon Mar 17, 2019
whoa what the heck does the unassigned message mean
aaronfranke commentedon Mar 17, 2019
@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.
nicklleite commentedon Apr 30, 2021
Its still happening. It deleted almost everything on my Ubuntu.
kisak-valve commentedon Apr 30, 2021
Hello @nicklleite, the investigation of the issue in this issue report concluded several years ago. Please open a new issue report.
antdude commentedon Jun 2, 2021
?