Messages in this thread | | | From | (Linus Torvalds) | Subject | Re: Serious flaw in glibc ? | Date | 13 Oct 1998 22:11:25 GMT |
| |
In article <m0zSPSN-0007U9C@the-village.bc.nu>, Alan Cox <alan@lxorguk.ukuu.org.uk> 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 > > stat > if(directory) > { > open > fstat > >Otherwise consider what happens backing up /dev to tape...
Yes, ugly. However, the other alternative (that doesn't work with some 2.1.x kernels, but they are broken, so you can just blame the kernel in that case) is to just append a '/' to the end of the name. That way the kernel will not allow you to open the file unless it's a directory.
Finally, I should probably just add a "opendir()" system call. That way I could return EISDIR for normal open() calls some day in the future when we can drop the old binary support. Consider it done.
Linus
- 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/
| |