Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
openldap
OpenLDAP
Commits
c1da50a4
Commit
c1da50a4
authored
May 24, 2000
by
Kurt Zeilenga
Browse files
SLAPD_SCHEMA_NOT_COMPAT: equality filters
(2.5.4.0=2.5.6.0) works! ie: (objectclass=top)
parent
522761dc
Changes
6
Hide whitespace changes
Inline
Side-by-side
servers/slapd/attr.c
View file @
c1da50a4
...
...
@@ -223,7 +223,7 @@ attrs_find(
)
{
for
(
;
a
!=
NULL
;
a
=
a
->
a_next
)
{
if
(
is_ad_subtype
(
a
->
a_desc
,
desc
)
==
0
)
{
if
(
is_ad_subtype
(
a
->
a_desc
,
desc
)
)
{
return
(
a
);
}
}
...
...
servers/slapd/filterentry.c
View file @
c1da50a4
...
...
@@ -253,34 +253,39 @@ test_ava_filter(
#endif
for
(
i
=
0
;
a
->
a_vals
[
i
]
!=
NULL
;
i
++
)
{
int
r
c
;
int
r
et
;
#ifdef SLAPD_SCHEMA_NOT_COMPAT
int
rc
;
const
char
*
text
;
rc
=
value_match
(
a
->
a_desc
,
mr
,
rc
=
value_match
(
&
ret
,
a
->
a_desc
,
mr
,
a
->
a_vals
[
i
],
ava
->
aa_value
,
&
text
);
if
(
rc
!=
LDAP_SUCCESS
)
{
return
rc
;
}
#else
r
c
=
value_cmp
(
a
->
a_vals
[
i
],
&
ava
->
ava_value
,
a
->
a_syntax
,
r
et
=
value_cmp
(
a
->
a_vals
[
i
],
&
ava
->
ava_value
,
a
->
a_syntax
,
3
);
#endif
switch
(
type
)
{
case
LDAP_FILTER_EQUALITY
:
case
LDAP_FILTER_APPROX
:
if
(
r
c
==
0
)
{
if
(
r
et
==
0
)
{
return
LDAP_COMPARE_TRUE
;
}
break
;
case
LDAP_FILTER_GE
:
if
(
r
c
>=
0
)
{
if
(
r
et
>=
0
)
{
return
LDAP_COMPARE_TRUE
;
}
break
;
case
LDAP_FILTER_LE
:
if
(
r
c
<=
0
)
{
if
(
r
et
<=
0
)
{
return
LDAP_COMPARE_TRUE
;
}
break
;
...
...
servers/slapd/proto-slap.h
View file @
c1da50a4
...
...
@@ -686,6 +686,7 @@ LIBSLAPD_F (int) value_normalize LDAP_P((
struct
berval
**
out
,
const
char
**
text
));
LIBSLAPD_F
(
int
)
value_match
LDAP_P
((
int
*
match
,
AttributeDescription
*
ad
,
MatchingRule
*
mr
,
struct
berval
*
v1
,
...
...
servers/slapd/schema_init.c
View file @
c1da50a4
...
...
@@ -307,30 +307,35 @@ IA5StringNormalize(
static
int
caseExactIA5Match
(
int
*
match
,
unsigned
use
,
Syntax
*
syntax
,
MatchingRule
*
mr
,
struct
berval
*
value
,
void
*
assertedValue
)
{
return
strcmp
(
value
->
bv_val
,
*
match
=
strcmp
(
value
->
bv_val
,
((
struct
berval
*
)
assertedValue
)
->
bv_val
);
return
LDAP_SUCCESS
;
}
static
int
caseIgnoreIA5Match
(
int
*
match
,
unsigned
use
,
Syntax
*
syntax
,
MatchingRule
*
mr
,
struct
berval
*
value
,
void
*
assertedValue
)
{
return
strcasecmp
(
value
->
bv_val
,
*
match
=
strcasecmp
(
value
->
bv_val
,
((
struct
berval
*
)
assertedValue
)
->
bv_val
);
return
LDAP_SUCCESS
;
}
static
int
objectClassMatch
(
int
*
match
,
unsigned
use
,
Syntax
*
syntax
,
MatchingRule
*
mr
,
...
...
@@ -340,7 +345,8 @@ objectClassMatch(
ObjectClass
*
oc
=
oc_find
(
value
->
bv_val
);
ObjectClass
*
asserted
=
oc_find
(
((
struct
berval
*
)
assertedValue
)
->
bv_val
);
return
oc
==
NULL
||
oc
!=
asserted
;
*
match
=
(
oc
==
NULL
||
oc
!=
asserted
);
return
LDAP_SUCCESS
;
}
struct
syntax_defs_rec
{
...
...
servers/slapd/slap.h
View file @
c1da50a4
...
...
@@ -191,6 +191,7 @@ typedef int slap_mr_normalize_func LDAP_P((
/* Match (compare) function */
typedef
int
slap_mr_match_func
LDAP_P
((
int
*
match
,
unsigned
use
,
struct
slap_syntax
*
syntax
,
/* syntax of stored value */
struct
slap_matching_rule
*
mr
,
...
...
servers/slapd/value.c
View file @
c1da50a4
...
...
@@ -177,15 +177,27 @@ value_normalize(
#ifdef SLAPD_SCHEMA_NOT_COMPAT
int
value_match
(
int
*
match
,
AttributeDescription
*
ad
,
MatchingRule
*
mr
,
struct
berval
*
v1
,
/* (unnormalized) stored value */
struct
berval
*
v2
,
/* (normalized) asserted value */
const
char
**
text
)
{
/* not yet implemented */
return
0
;
int
rc
;
int
usage
=
0
;
if
(
!
mr
->
smr_match
)
{
return
LDAP_INAPPROPRIATE_MATCHING
;
}
rc
=
(
mr
->
smr_match
)(
match
,
usage
,
ad
->
ad_type
->
sat_syntax
,
mr
,
v1
,
v2
);
return
rc
;
}
#else
int
value_cmp
(
...
...
@@ -256,7 +268,11 @@ value_find(
for
(
i
=
0
;
vals
[
i
]
!=
NULL
;
i
++
)
{
#ifdef SLAPD_SCHEMA_NOT_COMPAT
if
(
value_match
(
ad
,
mr
,
vals
[
i
],
val
,
text
)
==
0
)
int
rc
;
int
match
;
rc
=
value_match
(
&
match
,
ad
,
mr
,
vals
[
i
],
val
,
text
);
if
(
rc
==
LDAP_SUCCESS
&&
match
==
0
)
#else
if
(
value_cmp
(
vals
[
i
],
v
,
syntax
,
normalize
)
==
0
)
#endif
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment