Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nadezhda Ivanova
OpenLDAP
Commits
90e4c087
Commit
90e4c087
authored
Jun 15, 2000
by
Kurt Zeilenga
Browse files
Add logic to properly (per X.500 recommendations) handle attribute
types without equality matching rules.
parent
178dc1b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
servers/slapd/back-ldbm/modify.c
View file @
90e4c087
...
...
@@ -271,15 +271,16 @@ add_values(
/* char *desc = mod->sm_desc->ad_cname->bv_val; */
MatchingRule
*
mr
=
mod
->
sm_desc
->
ad_type
->
sat_equality
;
if
(
mr
==
NULL
)
{
return
LDAP_INAPPROPRIATE_MATCHING
;
}
a
=
attr_find
(
e
->
e_attrs
,
mod
->
sm_desc
);
/* check if the values we're adding already exist */
if
(
a
!=
NULL
)
{
/* do allow add of additional attribute if
no equality rule exists */
if
(
mr
==
NULL
)
{
return
LDAP_INAPPROPRIATE_MATCHING
;
}
for
(
i
=
0
;
mod
->
sm_bvalues
[
i
]
!=
NULL
;
i
++
)
{
int
rc
;
int
j
;
...
...
@@ -330,10 +331,6 @@ delete_values(
char
*
desc
=
mod
->
sm_desc
->
ad_cname
->
bv_val
;
MatchingRule
*
mr
=
mod
->
sm_desc
->
ad_type
->
sat_equality
;
if
(
mr
==
NULL
||
!
mr
->
smr_match
)
{
return
LDAP_INAPPROPRIATE_MATCHING
;
}
/* delete the entire attribute */
if
(
mod
->
sm_bvalues
==
NULL
)
{
Debug
(
LDAP_DEBUG_ARGS
,
"removing entire attribute %s
\n
"
,
...
...
@@ -342,6 +339,12 @@ delete_values(
LDAP_NO_SUCH_ATTRIBUTE
:
LDAP_SUCCESS
);
}
/* disallow specific attributes from being deleted if
no equality rule */
if
(
mr
==
NULL
||
!
mr
->
smr_match
)
{
return
LDAP_INAPPROPRIATE_MATCHING
;
}
/* delete specific values - find the attribute first */
if
(
(
a
=
attr_find
(
e
->
e_attrs
,
mod
->
sm_desc
))
==
NULL
)
{
Debug
(
LDAP_DEBUG_ARGS
,
"ldap_modify_delete: "
...
...
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