Bug 480 - Can not lookup SID for user names with UTF8 characters (WINBINDD_LOOKUPNAME)
Summary: Can not lookup SID for user names with UTF8 characters (WINBINDD_LOOKUPNAME)
Status: CLOSED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: winbind (show other bugs)
Version: 3.0.0preX
Hardware: All Solaris
: P3 normal
Target Milestone: none
Assignee: Jeremy Allison
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-19 07:46 UTC by Aleksey Studnev
Modified: 2005-11-14 09:28 UTC (History)
0 users

See Also:


Attachments
Patch to fix the problem (to rpc_parse/parse_lsa.c file from 3.0RC3 (806 bytes, patch)
2003-09-19 08:47 UTC, Aleksey Studnev
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aleksey Studnev 2003-09-19 07:46:07 UTC
I use code:
	 fstrcpy(request.data.name.name, state_.user);	 
	 fstrcpy(request.data.name.dom_name, state_.domain);	 
	 NSS_STATUS result = winbindd_request(WINBINDD_LOOKUPNAME, &request, 
&response);

to lookup SID of user. Here state_.user is null-terminated UTF8 string.
Defect happens when i try to lookup SID of user with i18n characters in the 
name. 
In traffic there is illegal length of UNICODE string transmitted over wire. The 
string itself is OK, but length is calculated wrong. It multiples any i18n 
character on 2. It may happen because of code like strlen(str)*2 under UTF8 
string which may do this result.
Comment 1 Aleksey Studnev 2003-09-19 08:47:51 UTC
Created attachment 154 [details]
Patch to fix the problem (to rpc_parse/parse_lsa.c file from 3.0RC3

I am not sure it completely resolves the problem but it works.
By the way i found numerous places where strlen(UTF8String) is multiplied by 2
and assumed to be the right length of UNICODE string.
Comment 2 Aleksey Studnev 2003-09-24 23:28:13 UTC
Probably bug#386 has the same reason.
Comment 3 Jeremy Allison 2003-09-25 14:27:01 UTC
I have fixed this in the current SAMBA_3_0 CVS. It will be fixed for 3.0.1.
Jeremy.
Comment 4 Gerald (Jerry) Carter (dead mail address) 2005-02-07 09:04:52 UTC
originally reported against one of the 3.0.0rc[1-4] releases.
Cleaning up non-production versions.
Comment 5 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:17:58 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.
Comment 6 Gerald (Jerry) Carter (dead mail address) 2005-11-14 09:28:17 UTC
database cleanup