One little patch for samba libsmb

Andrew Bartlett abartlet at samba.org
Thu Nov 21 21:20:23 MST 2013


On Thu, 2013-11-07 at 10:47 -0300, Shawn Pringle wrote:
> I've found a bug in samba-3.6.8.  Some file names will be missing the
> first letter when listing.  I traced the problem to a call to
> align_string() in source3/libsmb/clilist.c.
> 
> Now the issue seems to be some OSes align their strings on the two byte
> boundary where as others do not.  To reproduce the bug you must have a
> Windows 98 with long filenames in them and the strings allocated need to
> happen to be located at an odd numbered address in memory.  With two
> score file names you will likely see this problem occur.
> 
> I am not sure whether cli->win95 is the correct condition to test for by
> itself.  It is a starting point.
> 
> 89c89,94
> <             p += align_string(base_ptr, p, 0);
> ---
> >             /* The following align_string call would misalign the pointer
> >              * to file names listed from a Windows 98 machine.*/  
> >             if (!cli->win95)
> >                 p += align_string(base_ptr, p, 0);
> 
> Have a nice day.

Protocol sniffing for Windows 95/98 seems the wrong way to handle this.  Is there really no other way?


-- 
Andrew Bartlett
http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
Samba Developer, Catalyst IT                   http://catalyst.net.nz




More information about the samba-technical mailing list