MOO-cows Mailing List Archive

[Prev][Next][Index][Thread]

Re: temporary wizbit



On Tue, 16 Apr 1996, Seth I. Rich wrote:

> The way I intend to do this is to have a code segment (where #110 is
> our sample temporary wizard):
>   #110.wizard = 1;
>   set_task_perms(#110);
>   shutdown(); /* whatever, maybe a message here */
> 
> and, as the first line in $server_started:
>   #110.wizard = 0;
> 
> Does anyone see any security considerations, race conditions, anything
> which would make this a bad idea?  I don't think it's possible for any
> harm to come from this, but...

Yeah...

As the server is shutting down, it saves a list of active connections. 
When the server starts back up, it will call $user_disconnected for each
of the users, including #110, *before* calling $server_started. 
$user_disconnected typically calls the disfunc on the player and the room
the player is in, so #110's disfunc will be run with wizperms upon
restart. 


However, slayer@kaiwan.com suggests:

>why not put the .wizard = 0 in the same program as the shutdown()? I tried
>an eval that did that elsemoo and it worked fine.

This should be safe (at least in 1.8.0p2, which is the code I'm looking 
at.)  shutdown() doesn't cause the server to shutdown immediately; rather 
it sets a flag that tells the server to shut down "at its next available 
opportunity".  The current task finishes executing, and *then* the server 
shuts down (more or less; the server may execute more ready tasks, break 
dead network connections, etc., before shutting down.)

I can't guarantee that it works this way in all versions of the server.


  --Chris                           cunkel@engin.umich.edu
    ResComp Network Support Technician, Bursley Hall
    "Invisibility is in the eye of the beholder."
    Home Page: http://www-personal.engin.umich.edu/~cunkel/




References:

Home | Subject Index | Thread Index