* De: [EMAIL PROTECTED] [ Data: 2002-12-24 ]
        [ Subjecte: Re: revoke(2) redux... ]
> 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.

Don't the chmod hacks performed on TTYs to essentially go from "this is
free" to "this is mine" close that race more or less?  I understand from
watching xpty discussion that if a tty matches certain mode/... requirements
then one should try to chown it and chmod it appropriately to themselves,
and if that fails, go back to looking for one (aquiring a lock on the tty
essentially) then do a revoke on it, because it's now really ours, and then
go on to open it...  Kicking people off only once the open works is an
interesting idea (wrt frevoke), but by then we've already trashed the perms...
I'm not sure whether there's a meaningful race in that (though of course
there are lots of races in that, especially if not appropriately coded)
and how much of a bad window exists wrt revoke/frevoke, and whether it is
really solved by fvrevoke.

juli.
-- 
Juli Mallett <[EMAIL PROTECTED]>
OpenDarwin, Mono, FreeBSD Developer.
ircd-hybrid Developer, EFnet addict.
FreeBSD on MIPS-Anything on FreeBSD.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to