From owner-freebsd-hackers Mon Oct 30 13: 2:30 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from aurora.sol.net (aurora.sol.net [206.55.65.76]) by hub.freebsd.org (Postfix) with ESMTP id DBEF437B479 for ; Mon, 30 Oct 2000 13:02:26 -0800 (PST) Received: (from jgreco@localhost) by aurora.sol.net (8.9.3/8.9.2/SNNS-1.02) id PAA81188; Mon, 30 Oct 2000 15:02:16 -0600 (CST) From: Joe Greco Message-Id: <200010302102.PAA81188@aurora.sol.net> Subject: Re: Logging users out To: gjb@gbch.net (Greg Black) Date: Mon, 30 Oct 2000 15:02:16 -0600 (CST) Cc: hackers@freebsd.org, ryan@sasknow.com, andrew@ugh.net.au In-Reply-To: from "Greg Black" at Oct 31, 2000 06:42:04 AM X-Mailer: ELM [version 2.5 PL3] 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 > > I wrote a little line program to do a revoke(), it was basically > > > > int main(int argc, char *argv[]) { revoke(argv[1]); } > > > > Now this doesn't kill a darn thing. And you should be aware of it! But it > > does forcibly "close" any open fd's pointing at the tty in question, and > > most programs will get the hint and go away. > > Not all programs, and that can lead to all sorts of problems > with processes that never die. There are many stories of this > happening with vi, for example. That's why I said, "most programs". > > For some uses, especially predictable uses, this is probably a lot simpler > > and a lot more foolproof. > > Simple: yes. Foolproof: definitely no. Uh, well, "foolproof" != "calling ps and awk and grep and looking for processes". For ANY definition of foolproof. And it is certainly foolproof from the point of view that there's no way in hell for the session not to be terminated, unlike some ps garbage I've seen. It's also an interesting way for a user without root permissions to "kill" a suid process of some sort that happens to be running on a tty owned by the user - which can happen. But, again, it relies on proper attention by programs to dying upon close of std{out,in}. -- ... Joe ------------------------------------------------------------------------------- Joe Greco - Systems Administrator jgreco@ns.sol.net Solaria Public Access UNIX - Milwaukee, WI 414/342-4847 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message