One little patch for samba libsmb

Shawn Pringle shawn.pringle at gmail.com
Thu Nov 7 06:47:33 MST 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.15 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSe5n1AAoJECW5B2lw+M7ePwUQAIz/w3eDTJkChAi7FpDfH871
IoaCfhLcabkj+/svpOu/Jas85pkzrEuS8M06PE/sxCgUEK3bKoaMIP+6YaxgwpUB
G4CHdyAphrpQ4EOrNpbQ/T3zmdKwHnf0XZgJkW92k4D45oQLNP1CV5AfDC4/P6WW
BCnLUPjmzNaLU9d0mqVcdfGe1uNRLl6SQdApcnZAAlm9HlL30/s1VnIG92vcoHIt
Mn16f7EcrW4N63mMH/ILsuxeE6dQ9I2IAaNnCOKm97bPL5RPAMjFaG+6vvEEDz2s
wLJHnPBwwA+RGZgT50/OShnBcBCd6kkd426358SoPrOf4Tl+qn56d54aFsPC/wS6
ChRZAEgU+kO79Ohb4PT8PXoaf96N7uRhl7O/su7Dm8DtDTvX/WdpcN+m/+AuHAm/
mlHEI7kp4Iow5sqq0t/DAWZxIUrrn13Aq6ZefGAbLXE2RsUM+ou5b4Y86VDxmmk2
HYqPWtuqbwk0di29ntUBUHNnwQjJrdfU6MYq65fd7wudQHzrtb4heTUMbDbveJuQ
SUQ8jhMEKtcSP/xFqN6yjPf8qarA49uBJijfr2bDaODAhZ5kEWcp1ZNf4MBNmM/G
TWSY34WoEaokHNUDTG+tMN1dZFTdKXVE1do/RaXlZ9UWuDO1P2thXaXyjwf7WQpt
zINx52IJquFnqupfSndr
=RbJh
-----END PGP SIGNATURE-----



More information about the samba-technical mailing list