How do you handle while(1) fork(); ?

Guy Harris guy at auspex.auspex.com
Sun Jul 15 04:17:45 AEST 1990


>Under System V, running "kill -9 -1" will send the kill to all processes
>belonging to the invoking user.

As long as the invoking user isn't the super-user; to quote the SunOS
4.0.3 manual page (yes, 4.0.3 supports this in an S5-compatible
fashion, except that it doesn't deliver the signal to the sending
process; dunno why it does so in S5, it seems kind of dumb to me):

     If pid is -1 and the effective user ID of the sender is  not
     super-user, the signal is sent to all processes, except sys-
     tem processes, process 1, and the process sending  the  sig-
     nal,  whose  real  or  saved set-user ID matches the real or
     effective ID of the sender.

     If pid is -1 and the effective user  ID  of  the  sender  is
     super-user,  the signal is sent to all processes except sys-
     tem processes, process 1, and the process sending  the  sig-
     nal.

So if you become "root" and run this, you will kill just about every
process on the system....

You probably don't want to do this.



More information about the Comp.unix.questions mailing list