[Date Prev][Date Next] [Chronological] [Thread] [Top]

(ITS#5731) Don't rewrite filter when it is undefined



Full_Name: Kostantinos Koukopoulos
Version: 2.4.11
OS: Solaris
URL: ftp://ftp.openldap.org/incoming/kostantinos-koukopoulos-0811009.patch
Submission from: (NULL) (195.134.100.30)


When a client provides a search filter which turns out to be undefined (for
example if the assertion value doesn't conform to the syntax) then the rwm
overlay will try to map the value without knowing if it's normalized or not. In
one case this caused an assertion failure. The following is the backtrace when
searching with '(entryUUID=123)':

Assertion failed: val->bv_len == 16, file schema_init.c, line 2539
t@3 (l@3) signal ABRT (Abort) in _lwp_kill at 0xfe29fc54
0xfe29fc54: _lwp_kill+0x0008:   bgeu,a  _lwp_kill+0x1c
Current function is map_attr_value
  426                                   NULL, NULL, value, &vtmp, NULL ) )
/opt/OpenLdap>where
current thread: t@3
  [1] _lwp_kill(0x0, 0x6, 0x0, 0xfe2bc000, 0x0, 0x0), at 0xfe29fc54
  [2] raise(0x6, 0x0, 0xfcfff168, 0x0, 0x0, 0x0), at 0xfe250c48
  [3] abort(0x43, 0xfcfff1f8, 0x43, 0x7efefeff, 0x81010100, 0xff00), at
0xfe236d50
  [4] __assert(0x258080, 0x258094, 0x9eb, 0x0, 0x0, 0x0), at 0xfe236ff0
  [5] UUIDNormalize(0x4001, 0x0, 0x0, 0x700598, 0xfcfff504, 0x0), at 0xd3d8c
=>[6] map_attr_value(dc = 0xfcfff6f8, adp = 0xfcfff5e0, mapped_attr =
0xfcfff5d8, value = 0x700598, mapped_value = 0xfcfff5d0, remap = 0), line 426 in
"rwmmap.c"
  [7] rwm_int_filter_map_rewrite(op = 0x3885d8, dc = 0xfcfff6f8, f = 0x7005ac,
fstr = 0xfcfff6f0), line 500 in "rwmmap.c"
  [8] rwm_filter_map_rewrite(op = 0x3885d8, dc = 0xfcfff6f8, f = 0x7005ac, fstr
= 0xfcfff6f0), line 759 in "rwmmap.c"
  [9] rwm_op_search(op = 0x3885d8, rs = 0xfcfffcb0), line 765 in "rwm.c"
  [10] overlay_op_walk(0x3885d8, 0xfcfffcb0, 0x2, 0x33cea8, 0x33cfb0, 0xff00),
at 0x121b70
  [11] 0x121ecc(0x3885d8, 0xfcfffcb0, 0x2, 0xfcfff1e4, 0x2fc920, 0x2902d8), at
0x121ecb
  [12] 0x121ff8(0x3885d8, 0xfcfffcb0, 0x3886d8, 0x70052c, 0xfcfff9ec, 0x7005bc),
at 0x121ff7
  [13] do_search(0x388608, 0xfcfffcb0, 0xfcfffca0, 0x1, 0x0, 0x0), at 0x7791c
  [14] 0x73968(0xfcfffe0c, 0x3885d8, 0xfe2d0400, 0x0, 0x0, 0x0), at 0x73967
  [15] 0x7406c(0xfcfffe0c, 0xd, 0x0, 0x0, 0x0, 0x0), at 0x7406b
  [16] ldap_int_thread_pool_wrapper(xpool = 0x3038f8), line 663 in "tpool.c"

In this case the function 'map_attr_value' believes that the value is normalized
and tries to de-normalize it. 

I have included a patch which skips rewriting of a filter when it is undefined.