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
Jaak Ristioja
OpenLDAP
Commits
0c2c38c0
Commit
0c2c38c0
authored
21 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
ITS#3059: modrdn should delete than add.
parent
f7d8d55d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
servers/slapd/back-ldbm/modrdn.c
+30
-12
30 additions, 12 deletions
servers/slapd/back-ldbm/modrdn.c
with
30 additions
and
12 deletions
servers/slapd/back-ldbm/modrdn.c
+
30
−
12
View file @
0c2c38c0
...
...
@@ -614,28 +614,46 @@ ldbm_back_modrdn(
goto
return_results
;
}
/* add new one */
if
(
dn2id_add
(
op
->
o_bd
,
&
e
->
e_nname
,
e
->
e_id
)
!=
0
)
{
send_ldap_error
(
op
,
rs
,
LDAP_OTHER
,
"DN index add failed"
);
goto
return_results
;
}
/*
* NOTE: the backend MUST delete then add the entry,
* otherwise indexing may get hosed
* FIXME: if a new ID was used, the add could be done first.
* that would be safer.
*/
/* delete old one */
if
(
dn2id_delete
(
op
->
o_bd
,
&
old_ndn
,
e
->
e_id
)
!=
0
)
{
/* undo add of new one */
dn2id_delete
(
op
->
o_bd
,
&
e
->
e_nname
,
e
->
e_id
);
send_ldap_error
(
op
,
rs
,
LDAP_OTHER
,
"DN index delete fail"
);
goto
return_results
;
}
/* add new one */
if
(
dn2id_add
(
op
->
o_bd
,
&
e
->
e_nname
,
e
->
e_id
)
!=
0
)
{
/* try to repair old entry - probably hopeless */
if
(
dn2id_add
(
op
->
o_bd
,
&
old_ndn
,
e
->
e_id
)
!=
0
)
{
send_ldap_error
(
op
,
rs
,
LDAP_OTHER
,
"DN index add and repair failed"
);
}
else
{
send_ldap_error
(
op
,
rs
,
LDAP_OTHER
,
"DN index add failed"
);
}
goto
return_results
;
}
/* id2entry index */
if
(
id2entry_add
(
op
->
o_bd
,
e
)
!=
0
)
{
/* Try to undo */
dn2id_delete
(
op
->
o_bd
,
&
e
->
e_nname
,
e
->
e_id
);
dn2id_add
(
op
->
o_bd
,
&
old_ndn
,
e
->
e_id
);
send_ldap_error
(
op
,
rs
,
LDAP_OTHER
,
"entry update failed"
);
int
rc
;
rc
=
dn2id_delete
(
op
->
o_bd
,
&
e
->
e_nname
,
e
->
e_id
);
rc
|=
dn2id_add
(
op
->
o_bd
,
&
old_ndn
,
e
->
e_id
);
if
(
rc
)
{
send_ldap_error
(
op
,
rs
,
LDAP_OTHER
,
"entry update and repair failed"
);
}
else
{
send_ldap_error
(
op
,
rs
,
LDAP_OTHER
,
"entry update failed"
);
}
goto
return_results
;
}
...
...
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