Serious flaw in glibc ?

Alan Cox (alan@lxorguk.ukuu.org.uk)
Sun, 11 Oct 1998 18:38:57 +0100 (BST)


> The glibc method is better since it can not be tricked into returning
> non-NULL for something that isn't a directory, but it does have the
> undesirable property that it opens everything in sight, possibly
> rewinding tape devices or setting your controlling terminal. IMO,
> opendir() should do a stat before opening the directory, as well as an
> fstat afterwards.

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

stat
if(directory)
{
open
fstat

Otherwise consider what happens backing up /dev to tape...

Alan

-
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/