Why 8+1 in SMB_QUERY_FILE_UNIX_BASIC?

Jeremy Allison jra at samba.org
Fri Jun 9 00:58:53 GMT 2006


On Thu, Jun 08, 2006 at 05:17:27PM -0700, Jeremy Allison wrote:
> On Thu, Jun 08, 2006 at 09:57:30AM +0200, Volker Lendecke wrote:
> > Hi, Jeremy!
> > 
> > Without
> > 
> > --- source/smbd/trans2.c                                                       
> > +++ source/smbd/trans2.c
> > @@ -3431,12 +3431,12 @@
> >  
> >                         SIVAL(pdata,0,sbuf.st_nlink); /* number of hard links */
> >                         SIVAL(pdata,4,0);
> > -                       pdata += 8+1;
> > +                       pdata += 8;
> >                         data_size = PTR_DIFF(pdata,(*ppdata));
> >  
> >                         {
> > 
> > Samba4 will not accept our UNIX_BASIC infolevel. Why the +1?
> > Even without it valgrind does not complain.
> > 
> > I'm playing with this because I want easy and direct remote
> > testing of 'hide unreadable' and 'hide unwritable', and I
> > did not want to mess with security descriptors :-)
> 
> It's to ensure the data is null terminated - doesn't actually
> matter I think as it's a binary field. We need to check this
> doesn't break CIFSFS first though...

SteveF - any comments ? (I'll look in the CIFSFS code but it
would seem ok to me).

Jeremy.


More information about the samba-technical mailing list