Re: Serious flaw in glibc ?

Pavel Kankovsky (peak@kerberos.troja.mff.cuni.cz)
Mon, 12 Oct 1998 19:46:03 +0200 (MET DST)


On Sun, 11 Oct 1998, Alan Cox wrote:

> The glibc method is buggy. If ls rewinds my tapes even as root its bad
> dangerous and unexpected behaviour. I hope someone will fix glibc to at
> least do

The real bug is the lack of means to get a reliable race-condition-free
pointer at the file without actually opening it.

What about something like this?

fd = open(path, O_RDONLY | O_DEFEROPEN);
fstat(fd, ...);
if (directory) {
fcntl(fd, F_DEFERREDOPEN, ...);
...
}

--Pavel Kankovsky aka Peak [ Boycott Microsoft--http://www.vcnet.com/bms ]
"You can't be truly paranoid unless you're sure they have already got you."

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/