Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Barchiesi
OpenLDAP
Commits
30c43c30
Commit
30c43c30
authored
24 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
SLAPD_SCHEMA_NOT_COMPAT: working modify? need additional match
routines, such as distinguishedNameMatch, to be sure.
parent
3e3acf87
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
servers/slapd/attr.c
+2
-2
2 additions, 2 deletions
servers/slapd/attr.c
servers/slapd/back-ldbm/modify.c
+50
-15
50 additions, 15 deletions
servers/slapd/back-ldbm/modify.c
servers/slapd/mr.c
+5
-1
5 additions, 1 deletion
servers/slapd/mr.c
servers/slapd/value.c
+2
-2
2 additions, 2 deletions
servers/slapd/value.c
with
59 additions
and
20 deletions
servers/slapd/attr.c
+
2
−
2
View file @
30c43c30
...
...
@@ -290,10 +290,10 @@ attr_delete(
*
a
=
(
*
a
)
->
a_next
;
attr_free
(
save
);
return
0
;
return
LDAP_SUCCESS
;
}
}
return
1
;
return
LDAP_NO_SUCH_ATTRIBUTE
;
}
This diff is collapsed.
Click to expand it.
servers/slapd/back-ldbm/modify.c
+
50
−
15
View file @
30c43c30
...
...
@@ -60,6 +60,8 @@ int ldbm_modify_internal(
err
=
add_values
(
e
,
mod
,
op
->
o_ndn
);
if
(
err
!=
LDAP_SUCCESS
)
{
Debug
(
LDAP_DEBUG_ARGS
,
"ldbm_modify_internal: %d %s
\n
"
,
err
,
text
,
0
);
*
text
=
"modify: add values failed"
;
}
break
;
...
...
@@ -69,6 +71,8 @@ int ldbm_modify_internal(
err
=
delete_values
(
e
,
mod
,
op
->
o_ndn
);
assert
(
err
!=
LDAP_TYPE_OR_VALUE_EXISTS
);
if
(
err
!=
LDAP_SUCCESS
)
{
Debug
(
LDAP_DEBUG_ARGS
,
"ldbm_modify_internal: %d %s
\n
"
,
err
,
text
,
0
);
*
text
=
"modify: delete values failed"
;
}
break
;
...
...
@@ -78,6 +82,8 @@ int ldbm_modify_internal(
err
=
replace_values
(
e
,
mod
,
op
->
o_ndn
);
assert
(
err
!=
LDAP_TYPE_OR_VALUE_EXISTS
);
if
(
err
!=
LDAP_SUCCESS
)
{
Debug
(
LDAP_DEBUG_ARGS
,
"ldbm_modify_internal: %d %s
\n
"
,
err
,
text
,
0
);
*
text
=
"modify: replace values failed"
;
}
break
;
...
...
@@ -95,6 +101,8 @@ int ldbm_modify_internal(
}
if
(
err
!=
LDAP_SUCCESS
)
{
Debug
(
LDAP_DEBUG_ARGS
,
"ldbm_modify_internal: %d %s
\n
"
,
err
,
text
,
0
);
*
text
=
"modify: (soft)add values failed"
;
}
break
;
...
...
@@ -104,6 +112,8 @@ int ldbm_modify_internal(
mod
->
sm_op
,
0
,
0
);
*
text
=
"Invalid modify operation"
;
err
=
LDAP_OTHER
;
Debug
(
LDAP_DEBUG_ARGS
,
"ldbm_modify_internal: %d %s
\n
"
,
err
,
text
,
0
);
}
if
(
err
!=
LDAP_SUCCESS
)
{
...
...
@@ -331,34 +341,50 @@ add_values(
Attribute
*
a
;
#ifdef SLAPD_SCHEMA_NOT_COMPAT
AttributeDescription
*
desc
=
mod
->
sm_desc
;
/* 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
;
}
#else
char
*
desc
=
mod
->
mod_type
;
/*
char *desc = mod->mod_type;
*/
#endif
a
=
attr_find
(
e
->
e_attrs
,
desc
);
a
=
attr_find
(
e
->
e_attrs
,
mod
->
sm_
desc
);
/* check if the values we're adding already exist */
if
(
a
!=
NULL
)
{
for
(
i
=
0
;
mod
->
sm_bvalues
[
i
]
!=
NULL
;
i
++
)
{
#ifdef SLAPD_SCHEMA_NOT_COMPAT
if
(
value_find
(
desc
,
a
->
a_vals
,
mod
->
sm_bvalues
[
i
]
)
==
0
)
int
j
;
for
(
j
=
0
;
a
->
a_vals
[
j
]
!=
NULL
;
j
++
)
{
int
match
;
const
char
*
text
=
NULL
;
int
rc
=
value_match
(
&
match
,
mod
->
sm_desc
,
mr
,
mod
->
sm_bvalues
[
i
],
a
->
a_vals
[
j
],
&
text
);
if
(
rc
==
LDAP_SUCCESS
&&
match
==
0
)
{
return
LDAP_TYPE_OR_VALUE_EXISTS
;
}
}
#else
if
(
value_find
(
a
->
a_vals
,
mod
->
sm_bvalues
[
i
],
a
->
a_syntax
,
3
)
==
0
)
#endif
{
a
->
a_syntax
,
3
)
==
0
)
{
return
(
LDAP_TYPE_OR_VALUE_EXISTS
);
}
#endif
}
}
/* no - add them */
if
(
attr_merge
(
e
,
desc
,
mod
->
sm_bvalues
)
!=
0
)
{
return
(
LDAP_CONSTRAINT_VIOLATION
);
if
(
attr_merge
(
e
,
mod
->
sm_desc
,
mod
->
sm_bvalues
)
!=
0
)
{
/* this should return result return of attr_merge */
return
LDAP_OTHER
;
}
return
(
LDAP_SUCCESS
)
;
return
LDAP_SUCCESS
;
}
static
int
...
...
@@ -372,6 +398,11 @@ delete_values(
Attribute
*
a
;
#ifdef SLAPD_SCHEMA_NOT_COMPAT
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
;
}
#else
char
*
desc
=
mod
->
mod_type
;
#endif
...
...
@@ -399,7 +430,7 @@ delete_values(
int
match
;
const
char
*
text
=
NULL
;
int
rc
=
value_match
(
&
match
,
mod
->
sm_desc
,
m
od
->
sm_desc
->
ad_type
->
sat_equality
,
m
r
,
mod
->
sm_bvalues
[
i
],
a
->
a_vals
[
j
],
&
text
);
if
(
rc
==
LDAP_SUCCESS
&&
match
!=
0
)
...
...
@@ -441,7 +472,7 @@ delete_values(
}
}
return
(
LDAP_SUCCESS
)
;
return
LDAP_SUCCESS
;
}
static
int
...
...
@@ -451,13 +482,17 @@ replace_values(
char
*
dn
)
{
(
void
)
attr_delete
(
&
e
->
e_attrs
,
mod
->
sm_desc
);
int
rc
=
attr_delete
(
&
e
->
e_attrs
,
mod
->
sm_desc
);
if
(
rc
!=
LDAP_SUCCESS
&&
rc
!=
LDAP_NO_SUCH_ATTRIBUTE
)
{
return
rc
;
}
if
(
mod
->
sm_bvalues
!=
NULL
&&
attr_merge
(
e
,
mod
->
sm_desc
,
mod
->
sm_bvalues
)
!=
0
)
{
return
(
LDAP_
CONSTRAINT_VIOLATION
)
;
return
LDAP_
OTHER
;
}
return
(
LDAP_SUCCESS
)
;
return
LDAP_SUCCESS
;
}
This diff is collapsed.
Click to expand it.
servers/slapd/mr.c
+
5
−
1
View file @
30c43c30
...
...
@@ -176,12 +176,16 @@ register_matching_rule(
return
(
-
1
);
}
code
=
mr_add
(
mr
,
usage
,
convert
,
normalize
,
match
,
indexer
,
filter
,
&
err
);
code
=
mr_add
(
mr
,
usage
,
convert
,
normalize
,
match
,
indexer
,
filter
,
&
err
);
if
(
code
)
{
Debug
(
LDAP_DEBUG_ANY
,
"Error in register_syntax: %s for %s in %s
\n
"
,
scherr2str
(
code
),
err
,
desc
);
return
(
-
1
);
}
return
(
0
);
}
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/value.c
+
2
−
2
View file @
30c43c30
...
...
@@ -48,7 +48,7 @@ value_add(
}
(
*
vals
)[
n
+
j
]
=
NULL
;
return
(
0
)
;
return
LDAP_SUCCESS
;
}
#ifdef SLAPD_SCHEMA_NOT_COMPAT
...
...
@@ -289,7 +289,7 @@ value_find(
#ifdef SLAPD_SCHEMA_NOT_COMPAT
MatchingRule
*
mr
=
ad
->
ad_type
->
sat_equality
;
if
(
mr
==
NULL
)
{
if
(
mr
==
NULL
||
!
mr
->
smr_match
)
{
return
LDAP_INAPPROPRIATE_MATCHING
;
}
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment