Padding byte in cifs readx response

Jeremy Allison jra at samba.org
Wed Jul 30 18:09:45 MDT 2014


On Wed, Jul 30, 2014 at 04:34:01PM -0700, Christof Schmitt wrote:
> It was pointed out to me that a padding byte in the readx response is
> missing:
> 
> http://msdn.microsoft.com/en-us/library/ee441872.aspx
>  Pad (1 byte): This field is optional. When using the NT LAN Manager
> dialect, this field can be used to align the Data field to a 16-bit
> boundary relative to the start of the SMB Header. If Unicode strings are
> being used, this field MUST be present. When used, this field MUST be
> one padding byte long.
> 
> I wrote a simple test for this, and it succeeds against a Windows 7 and
> fails in
> make test TESTS=raw.read
> 
> UNEXPECTED(failure): samba3.raw.read.readx(s3dc)
> REASON: _StringException: _StringException:
> ../source4/torture/raw/read.c:441: data not 16 bit aligned
> envlog: SMBD LOG of: LOCALS3DC2

Probably missing in smbd in order to make the sendfile
code easier....

I'm guessing the Windows client works fine without it,
but probably a good thing to fix so long as it doesn't
make smbd horribly slower in this case.

Jeremy.


More information about the samba-technical mailing list