From owner-freebsd-hackers Tue Oct 31 0:30:59 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from smtp03.primenet.com (smtp03.primenet.com [206.165.6.133]) by hub.freebsd.org (Postfix) with ESMTP id 2976B37B4CF for ; Tue, 31 Oct 2000 00:30:57 -0800 (PST) Received: (from daemon@localhost) by smtp03.primenet.com (8.9.3/8.9.3) id BAA24376; Tue, 31 Oct 2000 01:29:07 -0700 (MST) Received: from usr02.primenet.com(206.165.6.202) via SMTP by smtp03.primenet.com, id smtpdAAA1gaOIV; Tue Oct 31 01:28:57 2000 Received: (from tlambert@localhost) by usr02.primenet.com (8.8.5/8.8.5) id BAA27815; Tue, 31 Oct 2000 01:30:41 -0700 (MST) From: Terry Lambert Message-Id: <200010310830.BAA27815@usr02.primenet.com> Subject: Re: Logging users out To: andrew@ugh.net.au Date: Tue, 31 Oct 2000 08:30:41 +0000 (GMT) Cc: ryan@sasknow.com (Ryan Thompson), freebsd-hackers@FreeBSD.ORG In-Reply-To: from "andrew@ugh.net.au" at Oct 30, 2000 08:53:27 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > Why not just kill their controlling shell? > > I believe that what I'm doing...the "controlling shell" would be the > session leader. The question is how to get its PID. Grovel the tty structure using libkvm. You want to look for: (struct tty *)->t_pgrp->pg_id Which is the process ID of the group leader of the foregroun group. Or you could just make revoke do its thing in the right order instead of the wrong order, since a program with non-blocking fds (read: any threads program) would have to be clairvoyant (or check every time by trying to open /dev/tty, and noting when that failed). Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message