[PATCH] Fix nasty vfs_fruit bug 13646

Jeremy Allison jra at samba.org
Wed Oct 31 19:50:21 UTC 2018


On Wed, Oct 31, 2018 at 08:48:06PM +0100, Ralph Böhme wrote:
> > 
> > Sorry Ralph but I think that this:
> > 
> > Subject: [PATCH 36/42] vfs_fruit: prepare fruit_pread_meta() for reading on fake-fd
> > 
> > is still wrong. In fruit_pread_meta() the requested
> > amount to be read is size_t n into void *data.
> > 
> > Inside fruit_pread_meta() we have:
> > 
> >        to_return = MIN(n, AFP_INFO_SIZE);
> > 
> > so to_return is now the correct amount to be
> > returned  - allowing for the fact the caller
> > might have asked for less than AFP_INFO_SIZE.
> 
> thanks! Let me check this. Afair this was already the behaviour before the
> patch and I was too scared it although it look wrong.

Ah, that behavior was wrong though - I'm guessing
we never ran accross it as MacOS clients who are
the only users of this will always ask for AFP_INFO_SIZE
value or greater - not less.

For strict correctness though we must never return
more than the client requested.

Jeremy.



More information about the samba-technical mailing list