OT Operating System Design WAS RE: [thelist] RE: blaster worm punishment

Keith Gaughan keith at digital-crew.com
Wed Feb 2 09:08:52 CST 2005


Ken Schaefer wrote:
> 
> : From: thelist-bounces at lists.evolt.org
> [mailto:thelist-bounces at lists.evolt.org] On
> : Behalf Of Shawn K. Quinn
> : Subject: Re: [thelist] RE: blaster worm punishment
> : 
> : I disagree here. If anything he was punished too harshly. (And no, I
> : don't think he deserves a commendation.) Microsoft is the one getting
> : away with it here, as their shoddy operating system design allowed this
> : to happen to begin with. You don't hear about worms attacking other
> : operating systems, do you?
> 
> To Shawn:
> What exactly is "shoddy" about the design of the OS itself?

Amongst other things, I'll just mention my two joint pet hates: the
LocalSystem user, aka "uber-root", the WM_TIMER message. I'll say no
more 'cause Google is your friend.

And to make up for that, here's a tip

<tip title="JavaScript RPC without XMLHttpRequest">
Want to talk to the server? Don't want to or can't use XMLHttpRequest?
Have a thing for doing stuff ReSTfully? Well say no more! Here's your
answer:

function DoRPCRequest(responder, extra)
{
     var head = document.getElementsByTagName("body")[0];

     // Remove any existing RPC block, if possible.
     try
     {
         var old = document.getElementById("rpcScript");
         if (old)
             head.removeChild(old);
     }
     catch (e) {}

     // Build the call string, appending on any extra arguments.
     var call = responder;
     if (arguments.length > 1)
         call += (responder.indexOf("?") == -1 ? "?" : "&") + extra;

     // Build the new script element and put it in the head. The script
     // is automatically fetched and ran.
     var script   = document.createElement("script");
     script.src   = call;
     script.type  = "text/javascript";
     script.defer = true;
     script.id    = "rpcScript";
     head.appendChild(script);
}

What this bit of code does is fetch some JavaScript from the server and
put it in the document to be executed. Of course, this could be code
generated by a template (the responder) on the server, the arguments
string passed in the optional "extra" parameter.

There's a few enhancements that could be made to this. For instance, it
could check if the "extra" argument is an array and, if so, convert the
key/value pairs into an argument string.
</tip>


More information about the thelist mailing list