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
Dragoș Haiduc
OpenLDAP
Commits
ced4c772
Commit
ced4c772
authored
23 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
Import single-value check
parent
1a895e67
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
servers/slapd/modify.c
+1
-1
1 addition, 1 deletion
servers/slapd/modify.c
servers/slapd/schema_check.c
+28
-8
28 additions, 8 deletions
servers/slapd/schema_check.c
with
29 additions
and
9 deletions
servers/slapd/modify.c
+
1
−
1
View file @
ced4c772
...
...
@@ -423,7 +423,7 @@ int slap_modlist2mods(
"%s: multiple value provided"
,
ml
->
ml_type
);
*
text
=
textbuf
;
return
LDAP_
INVALID_SYNTAX
;
return
LDAP_
CONSTRAINT_VIOLATION
;
}
}
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/schema_check.c
+
28
−
8
View file @
ced4c772
...
...
@@ -33,10 +33,33 @@ entry_schema_check(
Attribute
*
a
,
*
aoc
;
ObjectClass
*
oc
;
int
i
;
int
ret
;
AttributeDescription
*
ad_objectClass
=
slap_schema
.
si_ad_objectClass
;
int
extensible
=
0
;
/* check single-valued attrs for multiple values */
for
(
a
=
e
->
e_attrs
;
a
!=
NULL
;
a
=
a
->
a_next
)
{
/* there should be at least one value */
assert
(
a
->
a_vals
);
assert
(
a
->
a_vals
[
0
]
!=
NULL
);
/* if single value type, check for multiple values */
if
(
is_at_single_value
(
a
->
a_desc
->
ad_type
)
&&
a
->
a_vals
[
1
]
!=
NULL
)
{
char
*
type
=
a
->
a_desc
->
ad_cname
->
bv_val
;
snprintf
(
textbuf
,
textlen
,
"attribute '%s' cannot have multiple values"
,
type
);
Debug
(
LDAP_DEBUG_ANY
,
"Entry (%s), %s
\n
"
,
e
->
e_dn
,
textbuf
,
0
);
return
LDAP_CONSTRAINT_VIOLATION
;
}
}
if
(
!
global_schemacheck
)
return
LDAP_SUCCESS
;
*
text
=
textbuf
;
...
...
@@ -88,13 +111,10 @@ entry_schema_check(
return
LDAP_SUCCESS
;
}
/* optimistic */
ret
=
LDAP_SUCCESS
;
/* check that each attr in the entry is allowed by some oc */
for
(
a
=
e
->
e_attrs
;
a
!=
NULL
;
a
=
a
->
a_next
)
{
ret
=
oc_check_allowed
(
a
->
a_desc
->
ad_type
,
aoc
->
a_vals
);
if
(
ret
!=
0
)
{
int
ret
=
oc_check_allowed
(
a
->
a_desc
->
ad_type
,
aoc
->
a_vals
);
if
(
ret
!=
LDAP_SUCCESS
)
{
char
*
type
=
a
->
a_desc
->
ad_cname
->
bv_val
;
snprintf
(
textbuf
,
textlen
,
...
...
@@ -105,11 +125,11 @@ entry_schema_check(
"Entry (%s), %s
\n
"
,
e
->
e_dn
,
textbuf
,
0
);
break
;
return
ret
;
}
}
return
(
ret
)
;
return
LDAP_SUCCESS
;
}
static
char
*
...
...
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