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
James Lowden
OpenLDAP
Commits
8131410b
Commit
8131410b
authored
16 years ago
by
Quanah Gibson-Mount
Browse files
Options
Downloads
Patches
Plain Diff
ITS#5457 cleanup
parent
20736efd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
servers/slapd/back-bdb/add.c
+22
-13
22 additions, 13 deletions
servers/slapd/back-bdb/add.c
with
22 additions
and
13 deletions
servers/slapd/back-bdb/add.c
+
22
−
13
View file @
8131410b
...
...
@@ -50,7 +50,7 @@ bdb_add(Operation *op, SlapReply *rs )
#endif
Debug
(
LDAP_DEBUG_ARGS
,
"==> "
LDAP_XSTRING
(
bdb_add
)
": %s
\n
"
,
op
->
o
q_add
.
rs
_e
->
e_name
.
bv_val
,
0
,
0
);
op
->
o
ra
_e
->
e_name
.
bv_val
,
0
,
0
);
#ifdef LDAP_X_TXN
if
(
op
->
o_txnSpec
)
{
...
...
@@ -93,7 +93,7 @@ txnReturn:
ctrls
[
num_ctrls
]
=
0
;
/* check entry's schema */
rs
->
sr_err
=
entry_schema_check
(
op
,
op
->
o
q_add
.
rs
_e
,
NULL
,
rs
->
sr_err
=
entry_schema_check
(
op
,
op
->
o
ra
_e
,
NULL
,
get_relax
(
op
),
1
,
NULL
,
&
rs
->
sr_text
,
textbuf
,
textlen
);
if
(
rs
->
sr_err
!=
LDAP_SUCCESS
)
{
Debug
(
LDAP_DEBUG_TRACE
,
...
...
@@ -119,7 +119,7 @@ txnReturn:
goto
return_results
;
}
subentry
=
is_entry_subentry
(
op
->
o
q_add
.
rs
_e
);
subentry
=
is_entry_subentry
(
op
->
o
ra
_e
);
/* Get our reader TXN */
rs
->
sr_err
=
bdb_reader_get
(
op
,
bdb
->
bi_dbenv
,
&
rtxn
);
...
...
@@ -172,10 +172,10 @@ retry: /* transaction retry */
/*
* Get the parent dn and see if the corresponding entry exists.
*/
if
(
be_issuffix
(
op
->
o_bd
,
&
op
->
o
q_add
.
rs
_e
->
e_nname
)
)
{
if
(
be_issuffix
(
op
->
o_bd
,
&
op
->
o
ra
_e
->
e_nname
)
)
{
pdn
=
slap_empty_bv
;
}
else
{
dnParent
(
&
op
->
o
q_add
.
rs
_e
->
e_nname
,
&
pdn
);
dnParent
(
&
op
->
o
ra
_e
->
e_nname
,
&
pdn
);
}
/* get entry or parent */
...
...
@@ -209,7 +209,8 @@ retry: /* transaction retry */
rs
->
sr_ref
=
is_entry_referral
(
p
)
?
get_entry_referrals
(
op
,
p
)
:
NULL
;
bdb_unlocked_cache_return_entry_r
(
bdb
,
p
);
if
(
p
!=
(
Entry
*
)
&
slap_entry_root
)
bdb_unlocked_cache_return_entry_r
(
bdb
,
p
);
p
=
NULL
;
Debug
(
LDAP_DEBUG_TRACE
,
LDAP_XSTRING
(
bdb_add
)
": parent "
...
...
@@ -230,6 +231,10 @@ retry: /* transaction retry */
goto
retry
;
}
if
(
p
!=
(
Entry
*
)
&
slap_entry_root
)
bdb_unlocked_cache_return_entry_r
(
bdb
,
p
);
p
=
NULL
;
Debug
(
LDAP_DEBUG_TRACE
,
LDAP_XSTRING
(
bdb_add
)
": no write access to parent
\n
"
,
0
,
0
,
0
);
...
...
@@ -240,6 +245,8 @@ retry: /* transaction retry */
if
(
p
!=
(
Entry
*
)
&
slap_entry_root
)
{
if
(
is_entry_subentry
(
p
)
)
{
bdb_unlocked_cache_return_entry_r
(
bdb
,
p
);
p
=
NULL
;
/* parent is a subentry, don't allow add */
Debug
(
LDAP_DEBUG_TRACE
,
LDAP_XSTRING
(
bdb_add
)
": parent is subentry
\n
"
,
...
...
@@ -250,6 +257,8 @@ retry: /* transaction retry */
}
if
(
is_entry_alias
(
p
)
)
{
bdb_unlocked_cache_return_entry_r
(
bdb
,
p
);
p
=
NULL
;
/* parent is an alias, don't allow add */
Debug
(
LDAP_DEBUG_TRACE
,
LDAP_XSTRING
(
bdb_add
)
": parent is alias
\n
"
,
...
...
@@ -288,7 +297,7 @@ retry: /* transaction retry */
}
p
=
NULL
;
rs
->
sr_err
=
access_allowed
(
op
,
op
->
o
q_add
.
rs
_e
,
rs
->
sr_err
=
access_allowed
(
op
,
op
->
o
ra
_e
,
entry
,
NULL
,
ACL_WADD
,
NULL
);
if
(
!
rs
->
sr_err
)
{
...
...
@@ -334,7 +343,7 @@ retry: /* transaction retry */
rs
->
sr_text
=
"internal error"
;
goto
return_results
;
}
op
->
o
q_add
.
rs
_e
->
e_id
=
eid
;
op
->
o
ra
_e
->
e_id
=
eid
;
}
/* nested transaction */
...
...
@@ -351,7 +360,7 @@ retry: /* transaction retry */
}
/* dn2id index */
rs
->
sr_err
=
bdb_dn2id_add
(
op
,
lt2
,
ei
,
op
->
o
q_add
.
rs
_e
);
rs
->
sr_err
=
bdb_dn2id_add
(
op
,
lt2
,
ei
,
op
->
o
ra
_e
);
if
(
rs
->
sr_err
!=
0
)
{
Debug
(
LDAP_DEBUG_TRACE
,
LDAP_XSTRING
(
bdb_add
)
": dn2id_add failed: %s (%d)
\n
"
,
...
...
@@ -371,7 +380,7 @@ retry: /* transaction retry */
}
/* attribute indexes */
rs
->
sr_err
=
bdb_index_entry_add
(
op
,
lt2
,
op
->
o
q_add
.
rs
_e
);
rs
->
sr_err
=
bdb_index_entry_add
(
op
,
lt2
,
op
->
o
ra
_e
);
if
(
rs
->
sr_err
!=
LDAP_SUCCESS
)
{
Debug
(
LDAP_DEBUG_TRACE
,
LDAP_XSTRING
(
bdb_add
)
": index_entry_add failed
\n
"
,
...
...
@@ -388,7 +397,7 @@ retry: /* transaction retry */
}
/* id2entry index */
rs
->
sr_err
=
bdb_id2entry_add
(
op
->
o_bd
,
lt2
,
op
->
o
q_add
.
rs
_e
);
rs
->
sr_err
=
bdb_id2entry_add
(
op
->
o_bd
,
lt2
,
op
->
o
ra
_e
);
if
(
rs
->
sr_err
!=
0
)
{
Debug
(
LDAP_DEBUG_TRACE
,
LDAP_XSTRING
(
bdb_add
)
": id2entry_add failed
\n
"
,
...
...
@@ -416,7 +425,7 @@ retry: /* transaction retry */
postread_ctrl
=
&
ctrls
[
num_ctrls
++
];
ctrls
[
num_ctrls
]
=
NULL
;
}
if
(
slap_read_controls
(
op
,
rs
,
op
->
o
q_add
.
rs
_e
,
if
(
slap_read_controls
(
op
,
rs
,
op
->
o
ra
_e
,
&
slap_post_read_bv
,
postread_ctrl
)
)
{
Debug
(
LDAP_DEBUG_TRACE
,
...
...
@@ -475,7 +484,7 @@ retry: /* transaction retry */
Debug
(
LDAP_DEBUG_TRACE
,
LDAP_XSTRING
(
bdb_add
)
": added%s id=%08lx dn=
\"
%s
\"\n
"
,
op
->
o_noop
?
" (no-op)"
:
""
,
op
->
o
q_add
.
rs
_e
->
e_id
,
op
->
o
q_add
.
rs
_e
->
e_dn
);
op
->
o
ra
_e
->
e_id
,
op
->
o
ra
_e
->
e_dn
);
rs
->
sr_text
=
NULL
;
if
(
num_ctrls
)
rs
->
sr_ctrls
=
ctrls
;
...
...
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