Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review 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
Christopher Ng
OpenLDAP
Commits
3bad06d5
Commit
3bad06d5
authored
24 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
entry_schema_check() rename
parent
2dc6185a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
servers/slapd/back-ldbm/add.c
+19
-17
19 additions, 17 deletions
servers/slapd/back-ldbm/add.c
servers/slapd/back-ldbm/modify.c
+8
-5
8 additions, 5 deletions
servers/slapd/back-ldbm/modify.c
servers/slapd/tools/slapadd.c
+4
-3
4 additions, 3 deletions
servers/slapd/tools/slapadd.c
with
31 additions
and
25 deletions
servers/slapd/back-ldbm/add.c
+
19
−
17
View file @
3bad06d5
...
...
@@ -29,7 +29,7 @@ ldbm_back_add(
Entry
*
p
=
NULL
;
int
rootlock
=
0
;
int
rc
;
char
*
text
;
#ifdef SLAPD_SCHEMA_NOT_COMPAT
static
AttributeDescription
*
children
=
NULL
;
#else
...
...
@@ -50,15 +50,17 @@ ldbm_back_add(
return
(
-
1
);
}
if
(
schema_check_entry
(
e
)
!=
0
)
{
rc
=
entry_schema_check
(
e
,
NULL
,
&
text
);
if
(
rc
!=
LDAP_SUCCESS
)
{
ldap_pvt_thread_mutex_unlock
(
&
li
->
li_add_mutex
);
Debug
(
LDAP_DEBUG_TRACE
,
"entry failed schema check
\n
"
,
0
,
0
,
0
);
Debug
(
LDAP_DEBUG_TRACE
,
"entry failed schema check
: %s
\n
"
,
text
,
0
,
0
);
entry_free
(
e
);
send_ldap_result
(
conn
,
op
,
LDAP_OBJECT_CLASS_VIOLATION
,
NULL
,
NULL
,
NULL
,
NULL
);
send_ldap_result
(
conn
,
op
,
rc
,
NULL
,
text
,
NULL
,
NULL
);
return
(
-
1
);
}
...
...
@@ -121,10 +123,10 @@ ldbm_back_add(
/* free parent and writer lock */
cache_return_entry_w
(
&
li
->
li_cache
,
p
);
Debug
(
LDAP_DEBUG_TRACE
,
"no access to parent
\n
"
,
0
,
Debug
(
LDAP_DEBUG_TRACE
,
"no
write
access to parent
\n
"
,
0
,
0
,
0
);
send_ldap_result
(
conn
,
op
,
LDAP_INSUFFICIENT_ACCESS
,
NULL
,
NULL
,
NULL
,
NULL
);
NULL
,
"no write access to parent"
,
NULL
,
NULL
);
entry_free
(
e
);
...
...
@@ -141,7 +143,7 @@ ldbm_back_add(
0
,
0
);
send_ldap_result
(
conn
,
op
,
LDAP_ALIAS_PROBLEM
,
NULL
,
NULL
,
NULL
,
NULL
);
NULL
,
"parent is an alias"
,
NULL
,
NULL
);
entry_free
(
e
);
return
-
1
;
...
...
@@ -223,8 +225,8 @@ ldbm_back_add(
entry_free
(
e
);
send_ldap_result
(
conn
,
op
,
rc
>
0
?
LDAP_ALREADY_EXISTS
:
LDAP_O
PERATIONS_ERRO
R
,
NULL
,
NULL
,
NULL
,
NULL
);
rc
>
0
?
LDAP_ALREADY_EXISTS
:
LDAP_O
THE
R
,
NULL
,
rc
>
0
?
NULL
:
"cache add failed"
,
NULL
,
NULL
);
return
(
-
1
);
}
...
...
@@ -240,8 +242,8 @@ ldbm_back_add(
if
(
index_add_entry
(
be
,
e
)
!=
0
)
{
Debug
(
LDAP_DEBUG_TRACE
,
"index_add_entry failed
\n
"
,
0
,
0
,
0
);
send_ldap_result
(
conn
,
op
,
LDAP_O
PERATIONS_ERRO
R
,
NULL
,
NULL
,
NULL
,
NULL
);
send_ldap_result
(
conn
,
op
,
LDAP_O
THE
R
,
NULL
,
"index generation failed"
,
NULL
,
NULL
);
goto
return_results
;
}
...
...
@@ -250,8 +252,8 @@ ldbm_back_add(
if
(
dn2id_add
(
be
,
e
->
e_ndn
,
e
->
e_id
)
!=
0
)
{
Debug
(
LDAP_DEBUG_TRACE
,
"dn2id_add failed
\n
"
,
0
,
0
,
0
);
send_ldap_result
(
conn
,
op
,
LDAP_O
PERATIONS_ERRO
R
,
NULL
,
NULL
,
NULL
,
NULL
);
send_ldap_result
(
conn
,
op
,
LDAP_O
THE
R
,
NULL
,
"DN index generation failed"
,
NULL
,
NULL
);
goto
return_results
;
}
...
...
@@ -261,8 +263,8 @@ ldbm_back_add(
Debug
(
LDAP_DEBUG_TRACE
,
"id2entry_add failed
\n
"
,
0
,
0
,
0
);
(
void
)
dn2id_delete
(
be
,
e
->
e_ndn
,
e
->
e_id
);
send_ldap_result
(
conn
,
op
,
LDAP_O
PERATIONS_ERRO
R
,
NULL
,
NULL
,
NULL
,
NULL
);
send_ldap_result
(
conn
,
op
,
LDAP_O
THE
R
,
NULL
,
"entry store failed"
,
NULL
,
NULL
);
goto
return_results
;
}
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/back-ldbm/modify.c
+
8
−
5
View file @
3bad06d5
...
...
@@ -36,7 +36,8 @@ int ldbm_modify_internal(
Entry
*
e
)
{
int
err
;
int
rc
,
err
;
char
*
text
;
Modification
*
mod
;
Modifications
*
ml
;
Attribute
*
save_attrs
;
...
...
@@ -105,11 +106,13 @@ int ldbm_modify_internal(
ldap_pvt_thread_mutex_unlock
(
&
op
->
o_abandonmutex
);
/* check that the entry still obeys the schema */
if
(
schema_check_entry
(
e
)
!=
0
)
{
rc
=
entry_schema_check
(
e
,
save_attrs
,
&
text
);
if
(
rc
!=
LDAP_SUCCESS
)
{
attrs_free
(
e
->
e_attrs
);
e
->
e_attrs
=
save_attrs
;
Debug
(
LDAP_DEBUG_ANY
,
"entry failed schema check
\n
"
,
0
,
0
,
0
);
return
LDAP_OBJECT_CLASS_VIOLATION
;
Debug
(
LDAP_DEBUG_ANY
,
"entry failed schema check: %s
\n
"
,
text
,
0
,
0
);
return
rc
;
}
/* check for abandon */
...
...
@@ -397,7 +400,7 @@ delete_values(
Debug
(
LDAP_DEBUG_ARGS
,
"could not find value for attr %s
\n
"
,
mod
->
mod_type
,
0
,
0
);
return
(
LDAP_NO_SUCH_ATTRIBUTE
)
;
return
LDAP_NO_SUCH_ATTRIBUTE
;
}
}
#endif
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/tools/slapadd.c
+
4
−
3
View file @
3bad06d5
...
...
@@ -69,9 +69,10 @@ main( int argc, char **argv )
if
(
!
noschemacheck
)
{
/* check schema */
if
(
schema_check_entry
(
e
)
!=
0
)
{
fprintf
(
stderr
,
"%s: schema violation in entry dn=
\"
%s
\"
(line=%d)
\n
"
,
progname
,
e
->
e_dn
,
lineno
);
char
*
text
;
if
(
entry_schema_check
(
e
,
NULL
,
&
text
)
!=
LDAP_SUCCESS
)
{
fprintf
(
stderr
,
"%s: dn=
\"
%s
\"
(line=%d): %s
\n
"
,
progname
,
e
->
e_dn
,
lineno
,
text
);
rc
=
EXIT_FAILURE
;
entry_free
(
e
);
if
(
continuemode
)
continue
;
...
...
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