SUMMARY vhangup() broken

From: beig@FRULM63.BITNET
Date: Thu Feb 13 1992 - 15:56:08 CST


From: beig@FRULM63.BITNET

 
It seems that vhangup(2) is effectively broken.
So you have to modify the idle.users program:
using ioctl(2) and killpg(2) instead of vhangup(2).
 
Here are the differences between the two programs:
 
***************
*** 203,208 ****
--- 206,212 ----
 
                        /* write out the logout message */
                        write(tfd, message, strlen(message));
+ ioctl(tfd, TIOCGPGRP, &tgrp);
 
                        /* flush it out for safety's sake */
                        (void) ioctl(tfd, TIOCFLUSH, (char *)0);
***************
*** 210,216 ****
                alarm(0);
                (void) close(tfd);
                /* kill off the offender's login and exit */
! if (!warn) vhangup();
                exit(0);
        }
        /*parent: wait for the forked process*/
--- 214,220 ----
                alarm(0);
                (void) close(tfd);
                /* kill off the offender's login and exit */
! if (!warn) killpg(tgrp, SIGHUP);
                exit(0);
        }
        /*parent: wait for the forked process*/
 
 
Thanks to scott@gso.saic.com
                tanida@forseti.css.gov
for the workaround.
 
Jacques Beigbeder | Internet: beig@ens.fr
Service de Prestations Informatiques | Bitnet : beig@frulm63
Ecole Normale Superieure | Tel : (33-1) 43-26-61-33
F75230 Paris Cedex 05 | Fax : (33-1) 46-34-05-31



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:06:36 CDT