lkml.org 
[lkml]   [2012]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: compat: autofs v5 packet size ambiguity - update
On 02/22/2012 08:10 AM, Linus Torvalds wrote:
>
> But yeah, writing fixed-size data and then having a reader that reads
> fixed-size data is just not a very good approach. It's doubly bad when
> the "fixed size" isn't an explicit size that is documented in the
> protocol, but depends on data structures.
>

Incidentally, a valid user space workaround for this problem would be to
just read all the data off the pipe but consider the packet length to be
NAME_MAX rather than NAME_MAX+1; then simply discard all-zero ints
received on input since a packet always starts with the autofs version
number.

-hpa

--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.



\
 
 \ /
  Last update: 2012-02-22 18:49    [W:0.075 / U:0.900 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site