Feature #1575: untangle libmlrpc from SMB server
SMB domain logon fails with I18N user name
From Gordon Ross:
The key to this is login where some of the AD-provided strings (i.e. user full name)
contain characters that expand when converted from UTF-16 to UTF-8.
Updated by Andy Fiddaman about 2 years ago
- File snoopFail.txt snoopFail.txt added
- File snoopOK.txt snoopOK.txt added
- File traceFail.txt traceFail.txt added
- File traceOK.txt traceOK.txt added
Attaching four files. snoopOK and traceOK which were taken when the share is accessed from Windows 7 client, which works ok.
snoopFail and traceFail were taken when the share was accessed from Windows 10 client, which fails. Both files in each set were taken simultaneously.
Updated by Gordon Ross about 2 years ago
When un-marshaling an MS-RPC string, libmlrpc converts it from UTF-16 ("wire" form) to UTF-8 ("local" form) using the function ndr__wcstombs(). The conversion is failing when the converted string is longer than the wire form, as can happen when the user name has unicode symbols higher than 256.
The output buffer passed to ndr_s_wchar is actually large enough, but the output buffer size passed to ndr__wcstombs() is incorrect (it's passing the number of UTF-16 characters).
The fix is to pass the actual allocated size of the output buffer (less the null, which this function adds).
BTW, this was a regression from #1575 where the function ndr_s_wchar was redesigned to do u16/u8 conversions
without depending on the libsmb, introducing ndr_wchar.c in its place.
Updated by Electric Monk about 2 years ago
- Status changed from In Progress to Closed
- % Done changed from 80 to 100
commit d1855c8182d5cf1cd290336767a7c8e7537c13a2 Author: Gordon Ross <firstname.lastname@example.org> Date: 2018-08-19T06:44:21.000Z 9769 SMB domain logon fails with I18N user name 9774 libmlrpc changes in 1575 missed some things Reviewed by: Toomas Soome <email@example.com> Reviewed by: Andy Fiddaman <firstname.lastname@example.org> Approved by: Robert Mustacchi <email@example.com>