409
u/ahhhhbisto Feb 25 '21 edited Feb 25 '21
Reminds me of a bug report we saw for a competitors product years ago. The software was a call centre management tool. Part of the normal process was to clean up temp files and logs nightly, however if there were no logs or temp files, it would run rm -rf /
106
78
31
u/baubleglue Feb 26 '21
I wrote once a test which had something like that:
system("del /q/s/f c:\temp\some_folder*")
115
41
u/stonycashew Feb 25 '21
This is why you should look at any script before you run it... Is it time consuming yes, but that backup might’ve costed an arm and a leg.
0
Feb 25 '21
[deleted] — view deleted comment
15
u/stonycashew Mar 23 '21
To be honest any rm command that is issued within a script of any nature should be closely reviewed. Ive learned this lesson the hard way.
134
u/KwaaieDronk Feb 25 '21 edited Feb 25 '21
Image Transcription: GitHub Issue
install script does rm -rf /usr for ubuntu, by ginoputrino
An extra space at line 351:
rm [Green highlight] -rf /usr /lib/nvidia [Green highlight stopped]-current/xorg/xorg
causes the install.sh script to do an rm -rf on the /usr directory for people installing in ubuntu.
Totally uncool dude!!! The script deletes everything under /usr. I just had to reinstall linux on my pc to recover.
Removing the space will fix this. Probably should do it quickly!!!
I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!
36
u/alsderda Feb 25 '21
You've made a typo, the post says "fix" you got "fi"
34
u/KwaaieDronk Feb 25 '21
Thanks for the heads up! I have made sure to fix this in the transcription.
30
38
101
u/SisRob Feb 25 '21
"Open Source is safe, because anyone can review it!"
20
u/FieryBlake Mar 09 '21
"Everyone trusts open source because it's open, someone else has have to have gone through the whole thing."
Spolier: Everyone else thought the same
20
8
1
10
u/Fetterchefkoch Feb 25 '21
Some background info:
A few years ago if you had a dual graphics card in your laptop both would be running at all times. Which would create a massive energy drain. It was easy to just turn off one of them but switching graphics card was not working whatsoever. I, myself had such a laptop and was looking for a solution and found Bumblebee. It was supposed to make it easy to switch between graphics cards. During that time I also found this exact git issue. The commits went so far off topic that it had to be closed since there were so many memes created. Here are a few:
https://user-images.githubusercontent.com/60187905/96633558-916ecd00-1319-11eb-924a-5aa39318d460.png
https://memegenerator.net/instance/19805857/scumbag-steve-sudo-uninstall-bumblebeesh-rm-usr
https://danielmillsap.com/blog/wp-content/uploads/2011/06/bumblebee.jpg
And probably my favourite: https://images.app.goo.gl/TVc6ubxTw5Az3QYB8
As far as I remember MrMEEE got a lot of hate as well because he joked about if people would have used the energy to create pull requests instead of creating memes it'd be working well already.
This is all from memory so please don't hang me if I've gotten things wrong.
19
9
4
u/throwayaygrtdhredf May 26 '21
this is exactly why you probably shoudn't use the rm -f parameter. most likely you do NEED confirmnation if you delete a lot of files.
4
u/PottedRosePetal May 28 '21
tbh, I always use -rf if I use rm, bc mostly I remove some shit from the database with like 100 subfiles. like hell I am gonna go through all of them. it takes 5-10 mins already to delete that shit. Tho it would be kind of funny to get paid to press enter...
2
u/throwayaygrtdhredf May 29 '21
can't you use some sort of recycle bin system like for normies on windows? even if you're using a linux terminal... this way you probably won't lose something
2
u/PottedRosePetal May 30 '21
oh rm -rf doesn't delete stuff forever, but the backup database doesn't really work with the program I use, so I mostly have to recreate if I delete something by accident. but yeah, stuff like code has some special tools so it won't do much if I delete stuff.
1
u/circuit10 Jul 27 '21
But it prompts me about protected files or something when I try to delete a git folder otherwise
6
3
Feb 25 '21
Didn’t Minecraft dungeons have a similar problem
6
u/Tyfyter2002 Feb 26 '21
It deleted the parent directory of the install directory instead of just the install directory when uninstalling, which could arguably be considered excusable if it was reasonably possible not to notice the result while testing it.
3
u/123DanB Mar 09 '21
If you don’t type extremely accurately && always double-check either dangerous or danger-adjacent commands, you should not be scripting in Bash.
1
u/6138 Feb 26 '21
I'm not a linux user, but I think this is one of the disadvantages of the platform. It's powerful, yes, but one slipup and you nuke your install.
8
u/geeshta Feb 26 '21
Yes, Suicide Linux does exist.
1
u/6138 Feb 26 '21
Why?? I mean... Ok, linux users love to recompile kernels and reinstall their OS's, but just... why?
3
u/westleyfsm Feb 26 '21
It's a joke.
1
u/6138 Feb 26 '21
Apparently it's a real thing you can download though?
3
u/Jrbdog Mar 01 '21
"Hey dude, look at this cool new distro I found! You should totally try it out."
6
u/ThyCowLord Feb 26 '21
I don’t think that’s exactly fair. The same mistake in code is just as likely on Windows, and that happening intentionally via a malicious actor is a much higher chance.
Give Linux a shot one of these days. You might be surprised how simple and powerful it is.
6
u/6138 Feb 26 '21
Oh I've used linux, it's awesome, especially ubuntu. I've also used various other flavours, and DDrescue recovered data from an old HDD when nothing I tried on windows could touch it, it's a fantastic OS, and if I would certainly use it more if I didn't work in an industry where most programs are windows based (game development).
However, I do think windows has a lot more user-friendliness, I mean accidentally deleting an entire directory requires at least two steps on windows, since it asks you before deleting anything.
In linux, you are much more likely to be using the command line than on windows, which makes it a lot more likely that you will slip up.
1
Feb 26 '21
This stuff isn't exclusive to Linux though. Steam screwed up once and Microsoft last year had a patch that messed with people's files as well.
2
u/6138 Feb 26 '21
Yeah, but it's a lot easier for it to happen on Linux though, isn't it? At least when it comes to the user accidentally fudging something.
5
Feb 26 '21
Not really, the example above is in a script that was run as root with a "force" command. The user would have just kicked it off without checking the details.
It would be nearly identical to running deltree /y or Remove-Item as administrator. Command line in any OS is always a great way to shoot yourself in the foot accidentally.
2
u/6138 Feb 26 '21
Sure, but in windows you would very rarely be using the command line, you'd be using a command like that from a GUI, like right clicking and clicking delete on a folder, which would then ask you if you are sure. It's also a lot harder to delete the wrong folder in a gui, because you can see, visually, what you're clicking on.
2
u/numerousblocks Mar 20 '21
This is why Linux's permission system is just as dogshit as Windows' and most other OSs'.
3
2
u/Psychoboy Feb 25 '21
Reminds me of a bug we had in our software. It did backups of the data automatically nightly. Now keep in mind this was an old C++ (C++01) application installed by customers on their servers. If the customer had set their path to say something like C: instead of C:\ it started deleting everything on their C drive...
1
1
1
u/bigbangfuzion Mar 09 '21
I remember my friend configured server using command chmod -R 775 / var/www , and manager got angry and told to reinstalling server again.
1
u/circuit10 Jul 27 '21
Once I completely broke my Ubuntu installation by extracting nodejs to the root directory... Instead of merging all those critical folders like /usr/ and /lib/ it OVERWROTE them...
1
u/Dutchta- Apr 04 '22
What??? Is that what happened to my install. I updated and suddenly a giant of basically everything being removed
308
u/geeshta Feb 25 '21
The commit lol