CVS update: samba/source/lib

abartlet at samba.org abartlet at samba.org
Sat Jul 19 10:36:44 EST 2003


Date:	Sat Jul 19 00:36:44 2003
Author:	abartlet

Update of /home/cvs/samba/source/lib
In directory dp.samba.org:/tmp/cvs-serv4696/lib

Modified Files:
      Tag: SAMBA_3_0
	util_str.c 
Log Message:
Fix StrCaseCmp() to avoid calling smb_panic() on invalid multibyte strings.

This fix results in 
 - we no longer use fixed-size buffers in StrCaseCmp (previously limited to
   a pstring)
 - we return strcmp(s, t) if either of the strings is invalid
 - for non-ascii cases, we call iconv twice, not 4 times.

The basic idea with this fix is that if a string is not valid in the currnet
charset, then (unless it is byte-equivilant) it cannot be case-equivilant
to any other string.

This should address the majority of our smb_panic() cases on this matter.  It
will not fix them all - we still call unix_strupper(), aka strupper_m() 
elsewhere, but this was being called on every file in the directory when
we performed unix_convert().

Tested with the stf unit tests for this routine.

Andrew Bartlett


Revisions:
util_str.c		1.47.2.28 => 1.47.2.29
	http://www.samba.org/cgi-bin/cvsweb/samba/source/lib/util_str.c.diff?r1=1.47.2.28&r2=1.47.2.29



More information about the samba-cvs mailing list