From owner-freebsd-current Tue Dec 24 6:43:59 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8BEA737B401 for ; Tue, 24 Dec 2002 06:43:58 -0800 (PST) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id B2CB543EC2 for ; Tue, 24 Dec 2002 06:43:57 -0800 (PST) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.6/8.12.6) with ESMTP id gBOEhuIn001732; Tue, 24 Dec 2002 15:43:56 +0100 (CET) (envelope-from phk@critter.freebsd.dk) To: "Paul A. Scott" Cc: current@freebsd.org Subject: Re: revoke(2) redux... From: phk@freebsd.org In-Reply-To: Your message of "Tue, 24 Dec 2002 06:31:59 PST." Date: Tue, 24 Dec 2002 15:43:56 +0100 Message-ID: <1731.1040741036@critter.freebsd.dk> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message , "Paul A. Scott" writes: >> I think you missed the fine point in the "kick everybody *else* >> off" comment. > >Ahhh. I guess you mean that revoke() would change to do that. You're right, >I did miss your point. > >> The point is you cannot serialize against other processes. > >But that's the point of serialization. Anyway, if init is the only process >opening a tty, revoke is used in most "login daemons", telnetd, getty and elsewhere. There is no way you can close the race between: revoke("/dev/ttyfoo"); and open("/dev/ttyfoo"); Not even in init(8). There is always the risk that another process opens the device between the two. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message