.comment-link {margin-left:.6em;}

I Hate Linux

Thursday, July 29, 2004

/bin/bash self

While doing some testing of an installable package on his Mandrake 10 based laptop, an intern at my company by the name of Brandon hosed his system quite bad.

I watched him run the package that he’d used not minutes before and received a few error messages, a moment later he went to do an ls and was greeted with an error saying the file could not be found. Long story short, somehow his entire /bin directory was deleted, effectively eliminating his ability to use such useful Linux commands as ls, cp, or mv that may just be needed to fix what is about to be broken.

Of course the same goes for glibc, try to install a newer version of it on an older system and you can end up with a case where none of your binaries function. If you're lucky you can use export to no longer use the newer glibc, but even then things can get rather bad.

I find it rather amazing that the system and/or the shell permits the removal of key system files which would almost certainly be needed to undo any mistakes unless other back ups exist.

When Brandon told me of the cause of his pains, I laughed and promptly ran cmd.exe on my Windows 2000 machine, I then proceeded to type things such as...

del copy
del copy.exe
del copy.com
del del
del del.exe
del move
del move.exe

At the end of it I laughed and said “Ahh yes, the good old Windows command processor... unable to directly neuter its self and help prevent you from doing horrible things you may not be able to undo later that could break your system.” And yes... he was logged in as root, and not being root could have saved him the evening of time he spent rebuilding his system... however there are something’s you should make it very difficult to do, even when you are root or administrator. Do you think you should be able to format your system drive just because you are root or administrator?

“But Linux is better because you can do what ever you want with it, you aren’t restricted by any arbitrary boundaries” some would say... but just because you have all of this power does not mean you need it... or even will use it. I guess I have delusions of easy to use computers that almost anyone can use with out needing to know the ins and outs of it, but then... that is much of what Windows is, much like a previous commenter said here, and I think he summed it up perfectly:

Linux is like a Playboy centerfold: a great idea, but when you start to see the reality of it, not quite as enchanting. Windows is like your mom: maybe not pretty, but you can almost always predict how she's going to behave. And since I don't want to marry my computer, I'll take my mom over a Playboy centerfold any day.

The moral of today’s story...
System File Protection and heavy restriction of cataclysmic powers... Good!
Linux... HAHAHAHA!


  • I find it rather amazing that your intern (and you, effectively) blamed the rope for the tightening sensation around your neck. I’m not sure of the particulars of your intern deleting /bin (you should have come over to my desk, I’d have gotten a good laugh out of that one ;), but if your MO is going to be lambasting Linux for being too powerful, I’ll just have to shake my head and hope you never convince management to see things your way.

    There’s a reason the rootprompt on my home servers is “DO NOT FUCK UP # ”. A computer is a tool; like any tool, it’s important to learn to use it properly, hopefully lessening your propensity to remove limbs. You don’t blame the chainsaw for being too sharp or too good at chopping shit off; why then would you blame an OS for allowing you enough rope to hang yourself?

    “but just because you have all of this power does not mean you need it... or even will use it.” That’s not the point. The point is that the power if available; just because you can’t foresee a need to delete /bin doesn’t mean the need will never come up, and frankly, I’d rather not be that protected from myself. Yours is a uniquely American attitude, in that anything that you can use to “neuter” yourself should be regulated into oblivion, whereas more forward thinking societies allow average people to run laps at the Nürburgring for a modest fee; after all, if you kill yourself in turn three, you obviously overestimated your skill, and it’s your own damn fault.

    Your intern deleted /bin; that’s unfortunate, but he was running as root. There’s a good reason running regularly as root is NOT RECOMMENDED: it’s one of the built-in safeguards akin to the ones you love so much in Windows. You wouldn’t deploy an Internet-facing Windows box without a virus scanner or firewall, would you? In the same way, if you’re going to interact with a system, you should be taking all possible precautions against slamming headlong into a concrete wall at 150 MPH.

    “I guess I have delusions of easy to use computers that almost anyone can use with out needing to know the ins and outs of it, but then... that is much of what Windows is.” I don’t think you’re really looking for an “easy to use computers that almost anyone can use with out needing to know the ins and outs”; if you really were, you’d be running an iBook for everything that isn’t development work (I do, and I love it). Windows has plenty of hidden “gotchas” and “ins and outs” to come to terms with; every OS does.

    If I want to run a different browser on my iBook, it’s easy. Once I delete Safari, it’s completely gone; the Finder hasn’t had pieces of Safari shoehorned into it, dragging the entire system down with it. Microsoft, on the other hand, is so concerned with maintaining market share that THEY BUILT A BROWSER INTO THEIR OS. Let me say that again: they inserted completely unnecessary code into the kernel to make their market share look better. What a bullshit idea that was; if there’s one thing that pisses me off about Microsoft, it’s their ability to ruin a perfectly good product by doing monumentally stupid shit at every opportunity.

    I think part of the problem is that, given that Windows caters to the “least common denominator” of the computing populace, people have lost the fear/respect that should be afforded anything as technically complex as an entire OS. People expect to be protected, coddled, and have a nice, shiny “Finish” button to push. I, on the other hand, relish the more-difficult-but-technically-superior approach that lets me nuke my boot drive without a second thought (for the most part – see previous paragraph). Having that power has made me better at all aspects of my job (you know, your friendly local Mordac), and I wouldn’t trade it for anything.

    By Anonymous Anonymous, at 9:04 AM  

  • Except that windows is supposed to be the sexy looking OS so windows would be the centerfold and linux your mom ;)

    By Anonymous Anonymous, at 8:27 AM  

  • Log into any Linux system and type "rm ls", "rm cp", "rm rm", etc. Nothing will happen.

    By Anonymous Anonymous, at 1:25 PM  

  • While ‘rm ls’ may not directly work, adding the path in does work...

    [root@RH62 lib]# rm /bin/ls
    rm remove '/bin/ls'? y
    [root@RH62 lib]# ls
    bash:/bin/ls: No such file or directory

    Yes, having to type in the path offers can act as a safety mechanism, however my initial point is still valid that it is so easy to break it.

    Now if you’ll excuse me, I need to re ghost the machine as I also hosed cp and rm.

    By Blogger Brendan, at 2:26 PM  

  • "Microsoft, on the other hand, is so concerned with maintaining market share that THEY BUILT A BROWSER INTO THEIR OS. Let me say that again: they inserted completely unnecessary code into the kernel to make their market share look better."
    You've been spending too much time on Slashdot, my friend. IE is not built into the Windows kernel. I can only assume your odd obsession with kernels has to do with spending too much time on Linux.
    If MS's market share got better after they integrated IE it's for one reason - the market likes the idea and finds it useful.
    The real difference is that if you do something stupid (and we all do sometimes) Linux just goes ahead and does it. Windows has the manners to ask if you're really sure you want to stuff your system. And for really critical files (the ones protected by System File Protection) it makes you perform an extra step (turning off SFP). The well mannered equivalent of asking if you're really, really, really sure.

    By Anonymous Anonymous, at 8:16 AM  

  • You're right, IE is not part of the kernel. I misspoke. IE is part of explorer, the only usable Windows interface (unless there’s a “boot to cmd” option I’ve been missing). Which is great, because instead of annihilating your kernel, IE will hose the only interface to the machine. In the end, it’s a six of one/half-dozen of the other kind of situation.

    My “odd obsession with kernels” comes from the same place as my love of the ability to delete /bin/ls – interest in a stable, minimalist system that goes down for no man. Why in God’s name a server needs a web browser built into its interface is beyond me. My servers do what I tell them to – nothing more, nothing less. The only browser they’ve got installed if lynx, which, if I remember correctly, isn’t built into bash… nope, just double-checked, no browser in my shell of choice.

    “If MS's market share got better after they integrated IE it's for one reason - the market likes the idea and finds it useful.”

    Right, it has NOTHING to do with users accepting the “good enough” solution already present and being too lazy to use a superior alternative. No, it was THE MARKET™ that bestowed upon Microsoft its >90% share in browsers. That pesky market, always defying logic and rewarding the worst possible solution to a given problem!

    ”The real difference is that if you do something stupid (and we all do sometimes) Linux just goes ahead and does it. Windows has the manners to ask if you're really sure you want to stuff your system. And for really critical files (the ones protected by System File Protection) it makes you perform an extra step (turning off SFP). The well mannered equivalent of asking if you're really, really, really sure.“

    That’s absolutely correct, it does. I find it interesting, however, that in the original post, each of the examples of a user doing something stupid relied upon that user running as root. If you turn off SFP and Windows doesn’t chide your deleting a system file, do you blame Windows? I sure hope not. How is defying common sense and doing everything as root the fault of the OS? Oh, right, Windows makes EVERY user an admin by default. Does this mean THE MARKET likes the idea? Because that’s just stupid.

    By Anonymous Anonymous, at 8:57 AM  

  • Brendan:

    Would you please log onto your windows 2000 machine as an administrator, bring up a command prompt and type "del c:\winnt\system32\*.*" and then reboot? If you do this and find that your system fails to boot, as mine just did, saying:

    Windows 2000 could not start because the following file is missing or corrupt: <windows 2000 root>\system32\ntoskrnl.exe.

    will you then post a message in your blog saying windows i a poor operating system because it allowed you to do this?

    By Anonymous Anonymous, at 10:41 AM  

  • Actually, it's more the other way around: with Linux, you can predict how the OS will respond - you try and delete a file, it gets deleted if you have the permissions.

    With Windows, things are not so certain: there are files that are impossible to move or delete, files that you can move/delete but that mysteriously reappear seconds later*, and odd corners of the OS and Registry which are inaccessible to users but occasionally decide not to function for some strange reason.

    That said, both Windows and Linux have situations where things that previously Just Worked, Just Break.


    * including some of the most stupid file protection I've seen: under XP, you can't delete Outlook Express. Sure, I understand IE being protected - it's used to display an awful lot of internal stuff - but OE?

    By Anonymous Anonymous, at 6:10 PM  

  • What does this problem have to do with Linux? The same could have been done in Mac OS X, *BSD, Solaris etc... Catch my drift? You seem to not like the way unix systems handle. This is because you're used to Windows. I don't really like Windows too much 'cause I'm more used to my Mac and Linux.

    By Anonymous Anonymous, at 6:54 PM  

  • I'd like to disagree once more on IE. There was a time not so long ago when most people installed Netscape Navigator, despite IE being integrated in the OS. That's changed because the relative merits of competing browsers has changed. IE got a lot better from V3 to V4 and Netscape didn't. Computer users liked what MS did with IE, and still do. IE's got competition this year for the first time in many. I'm confident it will rise to the challenge - and already has somewhat with pop up blacking and plug in control. If it falls behind, I and others will switch but for the moment it's on most desktops because it's the best browser available.
    As well I disagree with your assertion re SFP not providing a substantial benefit over Linux. When installing and application (by necessity as root or administrator) Windows protects critical system files against a rogue package. Linux does not.

    By Anonymous Anonymous, at 10:36 PM  

  • Try deleting the content of winnt or system32. I'm pretty sure you will thouroughly mess up your windows box.

    The simplicity an power of linux lies in the recoverability. Just mount the disk on another system (Or use a boot CD) and copy back the files. Presto! Fixed. Now that wasn't so hard... Was it?

    In all fairness this will probably work pretty well on a windows box too as long as you don't delete the registry hives.

    By Anonymous Anonymous, at 2:31 AM  

  • Ok. I have used Windows when I used to work at Microsoft. Otherwise, I have always preferred to work with Linux.

    The concept of preferring one's mother to a playboy centerfold brings up somewhat disturbing images of incest. I won't go there.

    Regarding the integration of IE and its subsequent popularity-- it is true that innovation died in Netscape shortly after Microsoft entered the field with a browser. They dumped a browser on the market in clear violation of US antitrust law as has been decided by the court. The result of course was that Netscape could simply not afford to continue to innovate and they dropped off the face of the Earth...

    Strangely, now the reverse is happening. Mozilla is gaining marketshare precisely because IE is not being developed as a separate product and is the greatest target for spyware and adware syndicates. This is largely due to Microsoft's concept of security, and I do not believe that the history of brittle security on Windows platforms (particularly IE. ActiveX security signing is a perfect example of brittle security) will be reversed anytime soon. Maybe many people still need Windows, but for the moment, at least installing Mozilla and using it as much as possible is a start.

    Indeed according to http://www.w3schools.com/browsers/browsers_stats.asp
    we have seen a 3% jump in Mozilla marketshare over the last month and a half (Linux itself has remained roughly constant). This is highly significant. Internet Explorer 6.0 has even been losing market share since May.

    I have an interesting question. Why does Brendon hate Linux? I mean, you don't have to hate a product you believe is inferior. Are you just trying to get people to collect their thoughts regarding why Linux is good? Personally, I think that Linux is more technologically sound than Windows (and the patch cycle is often much easier to maintain with distros like Fedora or Debian) but there are still some issues, and although I think it is a better product others might disagree. But that doesn't come down to hate. Why hate Linux?

    By Blogger Einhverfr, at 5:31 PM  

  • you should just use freebsd and forget about shitty OS's completely.

    By Anonymous Anonymous, at 11:43 PM  

  • OK, I know anyone who's new to Linux (or any UN*X-like system) gets far too many comments on the lines of "If you'd only done xyz, you'd've been fine", but ... seriously, /bin and /usr/bin should be write-protected whenever you're not installing software

    By Anonymous Anonymous, at 11:58 AM  

  • they are protected when you're not doing system administration, as normal users do not have write access to /bin and /usr/bin. however, some people still run as root unnecissarily

    By Anonymous Anonymous, at 11:32 AM  

  • $ rm /bin/ls
    Access denied.
    $ rm /bin/cp
    Access denied.

    Methinks you have a configuration error if your system allows you to delete programs in /bin at will.

    By Anonymous Anonymous, at 6:53 PM  

  • erm, yes, I do think you should be able to format your system drive.

    I must be odd.

    By Anonymous Anonymous, at 7:36 PM  

  • I'm a happy linux user, and I agree with you that it is a little wrong to allow easy deletion of essential utilities. Is there not a shell that has built-in ls and mv?

    For the same reason I wonder why rm -rf / doesn't ask you to verify the root password or something before it proceeds.

    Still, I love linux - despite its many flaws. On the other front, I find Window quite usable, just no fun, and certainly not stress or trouble-free.

    By Anonymous Anonymous, at 6:45 PM  

  • Actually, "copy" and "del" are built into command.com (in the good old DOS days) which in the NT ages have been replaced by cmd.exe .. if you tell Windows to delete cmd.exe, yes it will kick up System File Protection, which is nice, but I still think of it as a hack which tries to keep the system safe against idiot users which are logged in God-mode as default and a hack which annoy the real experts who for some reason don't need it.

    By Anonymous Anonymous, at 3:14 PM  

  • In response to an earlier poster, you actually can use cmd.exe as your shell rather than explorer.exe, though it's a bitch to get things usable.

    By Blogger effigies, at 3:15 PM  

  • And we all know how totally awesome and useful the windows command prompt is...

    By Anonymous Anonymous, at 5:57 AM  

  • It's a lot harder to cripple the Windows command prompt from the Windows command prompt than it is to do the same under Linux. That was my whole point.

    More importantly, yes, the Windows command prompt is awesome, at least the one that will be shipping with Longhorn, currently known as Monad, or simply MSH.

    By Blogger Brendan, at 6:54 AM  

  • Yea, Get a virus on that win machine and see how it 'replaces' those files when you try to delete them then. Oh, and leave system restore turned on while you do it. Whats that? System restore is already turned on? By default? You are already Administrator? And you can't delete them? Dang, that windows is really a suck-ass OS.

    Windoze... HAHAHAHAH!

    By Anonymous Anonymous, at 6:45 PM  

  • side by side comparision, linux wins in all but one category... market share. The reason I have to use WinBlose is because my boss uses it for our vpn, I use both now. Windows wouldn't have a chance in a real market economy.

    By Anonymous Anonymous, at 11:06 PM  

  • I’m sorry but the idea that linux wins in a side by side comparison in everything but market share sounds... a bit delusional and like wishful thinking… or, those studies that ‘prove’ that argument must be in short supply as I’ve seen many that go either way, but for the most part Windows does win out for far more reasons than market share.

    By Blogger Brendan, at 4:19 AM  

  • I find it interesting that people have never had to use Unix without /bin (or /sbin) in a professional working environment. The only command that is very difficult to survive without is 'mount' - with some of the networking commands coming a close second (if you are mounting your discs from over the network). Admittedly typing 'echo *' instead of 'ls' and creating files using shell output redirection ('>') is trying, but you can get from there to workable system remarkably easily. Unix always boots from a simple root partition and a set of shell scripts (although normally not with a trashed or missing /bin). I have never had to do similar recovery work with Windows but it can probably be done. Sometimes a clean install or recovery from backup are not options.

    By Anonymous Anonymous, at 1:43 PM  

  • Hi I typed 'grant usr permissions for netscape 9 on debian' in google ansd found this blog that is not even remotely related to the search terms.

    So can you tell me where the words 'grant usr permissions for netscape 9 on debian' are located on this page ?

    I am at david frankie dis tri bution at yahoo.

    By Anonymous Anonymous, at 4:35 AM  

  • I am a very beginner in Linux... I hate that I had the power to distroy Linux only by typing rm -rfv /bin/. I actually was in my home directory and wanted to delete the bin folder of a software in MY HOME directory...
    I cannot comment more on Linux... I have never distroyed Windows, even when I was a very beginner... I guess Linux is not for beginners :-)

    By Anonymous Anonymous, at 9:19 AM  

Post a Comment

<< Home