lkml.org 
[lkml]   [2008]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 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


\
 
 \ /
  Last update: 2008-08-30 21:37    [W:0.038 / U:1.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site