Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15834/back-ldbm
Modified Files:
ldbm_attr.c
Log Message:
Bug(s) fixed: 165641
Bug Description: ./ns-slapd crashes on bind containing invalid dn and password
Reviewed by: Noriko (Thanks!)
Branch: HEAD
Fix Description: It's really crashing on the search request. The problem is that the
server assumes all strings are encoded in utf8 format, since that is the only encoding
allowed by the LDAP standards. Non-utf8 works in most places except the function
slapi_utf8StrToLower(), which returns NULL given a string of non-utf8 bytes. The fix for
this particular problem is to check for a NULL return value and handle accordingly.
The real solution to this problem would be for the server to check for valid utf8 strings
in _all_ LDAP data, according to the syntax of the attribute (e.g. for binary or octet
string syntax data, and other binary formats, all bets are off, but then we shouldn't
be doing strtolower on these blobs either).
And, while we're at it, add data validation based on syntax for _all_ attributes e.g.
in a pre-op.
Platforms tested: RHEL4
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none
Index: ldbm_attr.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldbm_attr.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ldbm_attr.c 19 Apr 2005 22:07:38 -0000 1.5
+++ ldbm_attr.c 30 Aug 2005 21:21:20 -0000 1.6
@@ -632,7 +632,7 @@
if ( NULL != fstr ) {
char *lc_fstr = (char *)slapi_utf8StrToLower( (unsigned char *)fstr );
- if (string_find(lc_fstr,"subordinates")) {
+ if (lc_fstr && string_find(lc_fstr,"subordinates")) {
Slapi_Filter *f = NULL;
/* Look for special filters we want to leave alone */
if (0 == strcmp(lc_fstr, "(&(numsubordinates=*)(numsubordinates>=1))"
)) {
Show replies by date