Messages in this thread | | | Date | Sat, 30 Aug 2008 21:34:21 +0200 | From | "Vegard Nossum" <> | Subject | Re: buffer overflow in /proc/sys/sunrpc/transports |
| |
On Sat, Aug 30, 2008 at 9:21 PM, Cyrill Gorcunov <gorcunov@gmail.com> wrote: > | Hm. I think this is wrong. Shouldn't we copy as many bytes as the user > | indicated? > > Well, hard to say what user-space programmer is expecting from us. > I mean - maybe he (reader) wants only part of results not the whole > contents BUT by this way he never know what the whole conetnts would be > until trying to read more (ie to check if there no more data from > kernel side). What is preferred behaviour - i don't know :)
For any other file, read(1) + read(1) should be exactly equivalent to a read(2). What's the difference here?
(Btw, thanks for the quick reply :-))
Vegard
-- "The animistic metaphor of the bug that maliciously sneaked in while the programmer was not looking is intellectually dishonest as it disguises that the error is the programmer's own creation." -- E. W. Dijkstra, EWD1036
| |