Bug 189 - wrong strcasecmp call
Summary: wrong strcasecmp call
Status: CLOSED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: File Services (show other bugs)
Version: 3.0.0preX
Hardware: All All
: P2 normal
Target Milestone: none
Assignee: Gerald (Jerry) Carter (dead mail address)
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-25 10:51 UTC by TAKAHASHI Motonobu
Modified: 2005-08-24 10:21 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description TAKAHASHI Motonobu 2003-06-25 10:51:38 UTC
At smbd.trans2.c:329, strcasecmp() is called,
but this should be StrCaseCmp().
strcasecmp() does not care of multibyte characters,
for example it recognize a Japanese character 0x8141
and 0x8161 is same one, but they should be different.

This affects that the 0x8161's long name becomes 
0x8141 (0x8161 is correct). To replace strcasecmp() 
to StrCaseCmp() solves the problem. Here is a patch.

--- smbd/trans2.c.org	Sun Jun 22 20:09:02 2003
+++ smbd/trans2.c	Thu Jun 26 02:27:59 2003
@@ -326,7 +326,7 @@
 		return False;
 	if (case_sig)	
 		return strcmp(str,mask)==0;
-	return strcasecmp(str,mask) == 0;
+	return StrCaseCmp(str,mask) == 0;
 }
 
 /****************************************************************************

This patch is found by MORIYAMA Masayuki <msyk@mtg.biglobe.ne.jp>
Comment 1 Jeremy Allison 2003-07-01 15:07:41 UTC
Yes, this looks like the correct fix. Applied on 7/1/2003 to the SAMBA_3_0 tree.
Jeremy.
Comment 2 Gerald (Jerry) Carter (dead mail address) 2005-02-07 08:39:32 UTC
originally reported against 3.0.0beta1.  CLeaning out 
non-production release versions.
Comment 3 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:21:31 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.