How can I log a user out?

Rob Bernardo rob at ptsfa.UUCP
Tue Jun 25 05:37:14 AEST 1985


In article <440 at bu-cs.UUCP> root at bu-cs.UUCP (Barry Shein) writes:
>>From: david at muddcs.UUCP (David Goebel)
>>Subject: How can I log a user out?
>>Date: Wed, 19-Jun-85 19:17:08 EDT
>>
>>Does anyone out there know of a quick way to log a user out from a C 
>>program without rummaging through memory for the pid of the login shell?
>
>I'm not sure exactly what you are after but this is a program I
>often use that just toggles DTR on the terminal line.
		...
>	if(ioctl(fd,TIOCCDTR,0) < 0)
		...

This must be a BSD-ism as TIOCCDTR is NOT a possible argument to ioctl(2)
in SIII or SV. However, the good news is that you can drop DTR (and thereby
cause the line to be hanged up) by setting the baud rate to "zero", either
with the shell command 
	
	stty 0 < /dev/ttyXX

or by using ioctl(2) on the desired port.
-- 


Rob Bernardo, San Ramon, California
ihnp4!ptsfa!rob
{nsc,ucbvax,decwrl,amd,fortune,zehntel}!dual!ptsfa!rob



More information about the Comp.unix.wizards mailing list