version 1.140, 2007/01/02 19:01:04
|
version 1.141, 2007/02/20 22:08:09
|
Line 1
|
Line 1
|
/* filter.c - routines for parsing and dealing with filters */ |
/* filter.c - routines for parsing and dealing with filters */ |
/* $OpenLDAP: pkg/ldap/servers/slapd/filter.c,v 1.139 2006/12/28 09:32:46 ando Exp $ */ |
/* $OpenLDAP: pkg/ldap/servers/slapd/filter.c,v 1.140 2007/01/02 19:01:04 kurt Exp $ */ |
/* This work is part of OpenLDAP Software <http://www.openldap.org/>. |
/* This work is part of OpenLDAP Software <http://www.openldap.org/>. |
* |
* |
* Copyright 1998-2007 The OpenLDAP Foundation. |
* Copyright 1998-2007 The OpenLDAP Foundation. |
Line 618 simple:
|
Line 618 simple:
|
len = fstr->bv_len; |
len = fstr->bv_len; |
|
|
filter_escape_value_x( &f->f_sub_initial, &tmp, op->o_tmpmemctx ); |
filter_escape_value_x( &f->f_sub_initial, &tmp, op->o_tmpmemctx ); |
tmplen = tmp.bv_len ? tmp.bv_len : STRLENOF( "(null)" ); |
tmplen = tmp.bv_len; |
|
|
fstr->bv_len += tmplen; |
fstr->bv_len += tmplen; |
fstr->bv_val = op->o_tmprealloc( fstr->bv_val, |
fstr->bv_val = op->o_tmprealloc( fstr->bv_val, |
fstr->bv_len + 1, op->o_tmpmemctx ); |
fstr->bv_len + 1, op->o_tmpmemctx ); |
|
|
snprintf( &fstr->bv_val[len-2], |
snprintf( &fstr->bv_val[len - 2], |
tmplen + STRLENOF( /*(*/ "*)" ) + 1, |
tmplen + STRLENOF( /*(*/ "*)" ) + 1, |
/* "(attr=" */ "%s*)", |
/* "(attr=" */ "%s*)", |
tmp.bv_len ? tmp.bv_val : "(null)"); |
tmp.bv_len ? tmp.bv_val : ""); |
|
|
ber_memfree_x( tmp.bv_val, op->o_tmpmemctx ); |
ber_memfree_x( tmp.bv_val, op->o_tmpmemctx ); |
} |
} |
Line 639 simple:
|
Line 639 simple:
|
len = fstr->bv_len; |
len = fstr->bv_len; |
filter_escape_value_x( &f->f_sub_any[i], |
filter_escape_value_x( &f->f_sub_any[i], |
&tmp, op->o_tmpmemctx ); |
&tmp, op->o_tmpmemctx ); |
tmplen = tmp.bv_len ? tmp.bv_len : STRLENOF( "(null)" ); |
tmplen = tmp.bv_len; |
|
|
fstr->bv_len += tmplen + STRLENOF( /*(*/ ")" ); |
fstr->bv_len += tmplen + STRLENOF( /*(*/ ")" ); |
fstr->bv_val = op->o_tmprealloc( fstr->bv_val, |
fstr->bv_val = op->o_tmprealloc( fstr->bv_val, |
fstr->bv_len + 1, op->o_tmpmemctx ); |
fstr->bv_len + 1, op->o_tmpmemctx ); |
|
|
snprintf( &fstr->bv_val[len-1], |
snprintf( &fstr->bv_val[len - 1], |
tmplen + STRLENOF( /*(*/ "*)" ) + 1, |
tmplen + STRLENOF( /*(*/ "*)" ) + 1, |
/* "(attr=[init]*[any*]" */ "%s*)", |
/* "(attr=[init]*[any*]" */ "%s*)", |
tmp.bv_len ? tmp.bv_val : "(null)"); |
tmp.bv_len ? tmp.bv_val : ""); |
ber_memfree_x( tmp.bv_val, op->o_tmpmemctx ); |
ber_memfree_x( tmp.bv_val, op->o_tmpmemctx ); |
} |
} |
} |
} |
Line 659 simple:
|
Line 659 simple:
|
len = fstr->bv_len; |
len = fstr->bv_len; |
|
|
filter_escape_value_x( &f->f_sub_final, &tmp, op->o_tmpmemctx ); |
filter_escape_value_x( &f->f_sub_final, &tmp, op->o_tmpmemctx ); |
tmplen = tmp.bv_len ? tmp.bv_len : STRLENOF( "(null)" ); |
tmplen = tmp.bv_len; |
|
|
fstr->bv_len += tmplen; |
fstr->bv_len += tmplen; |
fstr->bv_val = op->o_tmprealloc( fstr->bv_val, |
fstr->bv_val = op->o_tmprealloc( fstr->bv_val, |
fstr->bv_len + 1, op->o_tmpmemctx ); |
fstr->bv_len + 1, op->o_tmpmemctx ); |
|
|
snprintf( &fstr->bv_val[len-1], |
snprintf( &fstr->bv_val[len - 1], |
tmplen + STRLENOF( /*(*/ ")" ) + 1, |
tmplen + STRLENOF( /*(*/ ")" ) + 1, |
/* "(attr=[init*][any*]" */ "%s)", |
/* "(attr=[init*][any*]" */ "%s)", |
tmp.bv_len ? tmp.bv_val : "(null)"); |
tmp.bv_len ? tmp.bv_val : ""); |
|
|
ber_memfree_x( tmp.bv_val, op->o_tmpmemctx ); |
ber_memfree_x( tmp.bv_val, op->o_tmpmemctx ); |
} |
} |