Project

General

Profile

Bug #9769

Feature #1575: untangle libmlrpc from SMB server

SMB domain logon fails with I18N user name

Added by Andy Fiddaman about 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cifs - CIFS server and client
Start date:
2018-08-26
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

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.

Patch at https://github.com/omniosorg/illumos-omnios/issues/254#issuecomment-416011318


Files

snoopFail.txt (15.1 KB) snoopFail.txt Andy Fiddaman, 2018-08-26 07:47 PM
snoopOK.txt (8.93 KB) snoopOK.txt Andy Fiddaman, 2018-08-26 07:47 PM
traceOK.txt (332 KB) traceOK.txt Andy Fiddaman, 2018-08-26 07:47 PM
traceFail.txt (622 KB) traceFail.txt Andy Fiddaman, 2018-08-26 07:47 PM

History

#1

Updated by Andy Fiddaman about 2 years ago

  • Subject changed from libmlrpc cannot handle AD-provided strings that expand when converted from UTF-16 to UTF-8 to SMB domain logon fails with I18N user name
#2

Updated by Andy Fiddaman about 2 years ago

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.

#3

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.

#4

Updated by Electric Monk about 2 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 80 to 100

git commit d1855c8182d5cf1cd290336767a7c8e7537c13a2

commit  d1855c8182d5cf1cd290336767a7c8e7537c13a2
Author: Gordon Ross <gwr@nexenta.com>
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 <tsoome@me.com>
    Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk>
    Approved by: Robert Mustacchi <rm@joyent.com>

Also available in: Atom PDF