• Man accidentally 'deletes his entire company' with one line of bad code
    48 replies, posted
his story doesnt really make sense to me if the variables are uninitialized then an error should have been thrown for trying to run rm -rf. plus, why the fuck would you [I]ever[/I] want to use rm -rf???
[QUOTE=aznz888;50135405]his story doesnt really make sense to me if the variables are uninitialized then an error should have been thrown for trying to run rm -rf. plus, why the fuck would you [I]ever[/I] want to use rm -rf???[/QUOTE] wouldn't "f" explicitly ignore all warnings and errors and just continue?
[QUOTE=aznz888;50135405]his story doesnt really make sense to me if the variables are uninitialized then an error should have been thrown for trying to run rm -rf. plus, why the fuck would you [I]ever[/I] want to use rm -rf???[/QUOTE] In shell, reading from uninitialized variables gives you empty string. As for the why, he wanted to remove a subdirectory from the current directory. To make this more safe he would have explicitly said a subdirectory by prepending a dot slash, like so: rm -rf [B]./[/B]${foo}/${bar}
[QUOTE=Qaus;50135502]wouldn't "f" explicitly ignore all warnings and errors and just continue?[/QUOTE] -f or --force explicitly ignores all Warnings and Errors, but will not ignore ALL Errors. If the user has no RW permission for a file or a folder, he can't delete it, even with rm -rf (Unless you run the command as root), and the rm command will fail with an error. Same goes for the Root Folder. Most if not all modern Linux distributions require you to pass the --no-preserve-root argument to the rm command in order for the command "rm -rf /" to not fail. In the most cases, -f is not needed and is more of a convenience argument for the person who writes the script, as he does not want to handle certain errors, and just tells the script to try it anyway.
[QUOTE=kaukassus;50135528]-f or --force explicitly ignores all Warnings and Errors, but will not ignore ALL Errors. If the user has no RW permission for a file or a folder, he can't delete it, even with rm -rf (Unless you run the command as root), and the rm command will fail with an error. Same goes for the Root Folder. Most if not all modern Linux distributions require you to pass the --no-preserve-root argument to the rm command in order for the command "rm -rf /" to not fail. In the most cases, -f is not needed and is more of a convenience argument for the person who writes the script, as he does not want to handle certain errors, and just tells the script to try it anyway.[/QUOTE] That's why you just alias RM to include all that
[QUOTE=dai;50135403]remember food fight[/QUOTE] You'd think after the film was stolen they wouldn't have continued with it.
Surely these arguments as to why it wouldn't have worked are null by virtue of the fact that we don't have all the info? I doubt the offending function was the only error - my understanding is that the rm -rf is just the final bit that did the damage - it's likely he set it up to fail earlier in the script
"accidentally" no way in hell this wasn't on purpose, at all. It's very obvious what's happening when you do it.
[QUOTE=phygon;50135949]"accidentally" no way in hell this wasn't on purpose, at all. It's very obvious what's happening when you do it.[/QUOTE] you can always CTRL + C but "terminal.so deleted"
well... if he deleted everything, couldn't he just recovered it using a specialist? As long as he doesn't overwrite stuff it should be okay.
[QUOTE=Orki;50136988]well... if he deleted everything, couldn't he just recovered it using a specialist? As long as he doesn't overwrite stuff it should be okay.[/QUOTE] Tricky - it's rarely going to be a perfect recovery. I'm not sure how web server files are generally organised, but I'd there's a lot of interdependency it might be bit of a mission to get it all working fine and dandy
Unless the data was zeroed out or otherwise overwritten then restoring it is a piece of cake honestly.
Confirmed as "publicity stunt" though: [url]http://www.repubblica.it/tecnologia/2016/04/15/news/cancella_l_azienda_per_sbaglio_la_disavventura_tecnologica_di_marco_marsala-137693154/[/url] relevant part: [QUOTE]Ma perché lo ha fatto? Si tratta di un'operazione di guerrilla marketing, un 'passo falso' inventato di sana pianta solo ''per pubblicizzare la mia startup dove offriamo servizi di gestione server in outsourcing'', questa la versione dell'autore che rivela[/QUOTE] [QUOTE=googletranslate]But why did I do? It is a task of guerrilla marketing, a 'faux pas' invented out of whole cloth just '' to advertise my startup where we offer outsourced server management services '', this is the author's version that reveals[/QUOTE]
I figured it would be. I was asking my friend about it last night.
How does painting yourself as a colossal fuckup help your brand?
[QUOTE=J!NX;50134705]what even is rm -rf[/QUOTE] Delete fucking everything.
[QUOTE=bitches;50138557]How does painting yourself as a colossal fuckup help your brand?[/QUOTE] Marketing is all about exposure. Oh and he didn't have to pay thousands to advertise too.
Sorry, you need to Log In to post a reply to this thread.