APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

Really bad programming

I know, I'm no one to talk. I make dumb coding mistakes too, but recently I ran across a classic.

I was just finishing up a Linux server install for Counterpoint ( /Linux/cp.html). All users had been created, all minor configuration details tweaked, and the system was in the process of doing it's first DVD-RAM backup ( /Reviews/dvdram.html).

It was then that we remembered that the UPS software hadn't been configured. This particular UPS communicated by a USB port, and had Linux software which had already been downloaded. So, while the DVD-RAM backup was running, I installed the downloaded software, but it didn't seem to recognize the possibility of communicating by way of USB. Thinking that perhaps I had missed something or had made some mistake, I decided to run the uninstall script so thoughtfully included with the software.

I was prompted "Do you really want to remove the Belkin Bulldog Plus:!y|n] "

Sure I did. I answered "Y" and just a moment later I saw a rather odd message from rm complaining that it couldn't remove /boot. Huh? What the..

Ayup. This uninstall script had started at / and removed EVERYTHING. I powered off the machine the second I saw that, hoping that disk buffers hadn't yet been flushed, but I was too late: all our hard work was gone. Had the backup perhaps finished? I hoped it had, but no printout had come out yet, so it certainly wasn't completely finished. Ever the optimist, I booted from the DVD and let t restore. Unfortunately, it hadn't even completely finished the base OS stuff, so I had to start over from scratch: reinstall, reconfigure everything. Two extra hours of work and then some.

Later, I looked at the script to see how it screwed up. The basic problem was that it did a

        rm -rf $path/*
 

but unfortunately $path was NOT set, so that ends up as

        rm -rf /*
 

A silly mistake, but one that could have been very costly. Imagine if this server were actually in use when this happened!



Got something to add? Send me email.





(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> -> Really bad programming




Increase ad revenue 50-250% with Ezoic


More Articles by

Find me on Google+

© Tony Lawrence



I downloaded the Bulldog program & when I tried to uninstall it all I got were error messages. Now I am getting a ton of pop-up & I know that somehow this program has created them & there is nothing I know of to get rid of it. I have tried repeatedly to uninstall the thing & even delete the envelope with the programs in it but nothing works. Please help!! e-mail me at: [email protected]


--

No idea what "Bulldog" is.. sounds like a virus to me..

--TonyLawrence

---November 17, 2004

Man, I'm glad to know I'm not the only one. I had *exactly* the same experience on my Debian system last night. I tried to uninstall the Bulldog software and the uninstall program had my entire filesystem for high tea.

This was, inarguably, bad programming. It was dumb of me, though, not to check for the latest software update. The latest version (3.01.18, as of this date) has recognized and fixed the bad programming of the earlier version. The script now starts out,

path=/usr/local/bulldog

if [ "${path}="" ]
then
exit

All I can say is, thank heaven for Mondo Rescue software. I popped in the Mondo/Mindi CD, booted from CD, and 20 minutes later I was back up & running, in precisely the same configuration as before the incident, with all data restored.

Mondo Rescue is free software. I've used it with RedHat and Debian. Itz da bomb.

---November 17, 2004



Kerio Samepage


Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us





An editor is a person who knows precisely what he wants, but isn't quite sure. (Walter Davenport)

Java is C++ without the guns, knives, and clubs. (James Gosling)







This post tagged: