In message <[EMAIL PROTECTED]>, Garrett Wollman
 writes:
><<On Tue, 24 Dec 2002 12:40:25 +0100, Poul-Henning Kamp <[EMAIL PROTECTED]> said:
>
>> Isn't there a pretty obvious race between the revoke() and the open() ?
>
>To the extent that the race matters, it is obviated by making sure
>that only the current user has permission to open the device.  If the
>user somehow manages to open a device that he owns anyway, it's his
>problem if doing so screws it up.
>
>revoke() was a POSIX invention; it replaces the older vhangup().

But I can't find mention of it in SUS ?

>AIX has an extension such as you suggest (they call it frevoke()).

I think we should implement that in the kernel instead of revoke(2)
because it is actually a lot simpler to implement correctly.

We can then provide revoke(2) as a wrapper:

        revoke(const char *name)
        {
                int fd, e;

                fd = open(name, O_RDONLY);
                if (fd < 0)
                        return (fd);
                e = frevoke(fd);
                close(fd);
                return (e);
        }

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED]         | 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 [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to