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
François Kooman
OpenLDAP
Commits
75eecdc5
Commit
75eecdc5
authored
16 years ago
by
Howard Chu
Browse files
Options
Downloads
Patches
Plain Diff
ITS#5346 overlay_db_open needs to preserve the original *be.
parent
c0f5fad0
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/backover.c
+33
-40
33 additions, 40 deletions
servers/slapd/backover.c
servers/slapd/slap.h
+1
-1
1 addition, 1 deletion
servers/slapd/slap.h
with
34 additions
and
41 deletions
servers/slapd/backover.c
+
33
−
40
View file @
75eecdc5
...
...
@@ -29,43 +29,6 @@
static
slap_overinst
*
overlays
;
enum
db_which
{
db_open
=
0
,
db_close
,
db_destroy
,
db_last
};
static
int
over_db_func
(
BackendDB
*
be
,
ConfigReply
*
cr
,
enum
db_which
which
)
{
slap_overinfo
*
oi
=
be
->
bd_info
->
bi_private
;
slap_overinst
*
on
=
oi
->
oi_list
;
BackendInfo
*
bi_orig
=
be
->
bd_info
;
BI_db_open
**
func
;
int
rc
=
0
;
func
=
&
oi
->
oi_orig
->
bi_db_open
;
if
(
func
[
which
]
)
{
be
->
bd_info
=
oi
->
oi_orig
;
rc
=
func
[
which
](
be
,
cr
);
}
for
(;
on
&&
rc
==
0
;
on
=
on
->
on_next
)
{
be
->
bd_info
=
&
on
->
on_bi
;
func
=
&
on
->
on_bi
.
bi_db_open
;
if
(
func
[
which
])
{
rc
=
func
[
which
](
be
,
cr
);
}
}
be
->
bd_info
=
bi_orig
;
return
rc
;
}
static
int
over_db_config
(
BackendDB
*
be
,
...
...
@@ -173,7 +136,25 @@ over_db_open(
ConfigReply
*
cr
)
{
return
over_db_func
(
be
,
cr
,
db_open
);
slap_overinfo
*
oi
=
be
->
bd_info
->
bi_private
;
slap_overinst
*
on
=
oi
->
oi_list
;
BackendDB
db
=
*
be
;
int
rc
=
0
;
db
.
be_flags
|=
SLAP_DBFLAG_OVERLAY
;
db
.
bd_info
=
oi
->
oi_orig
;
if
(
db
.
bd_info
->
bi_db_open
)
{
rc
=
db
.
bd_info
->
bi_db_open
(
&
db
,
cr
);
}
for
(;
on
&&
rc
==
0
;
on
=
on
->
on_next
)
{
db
.
bd_info
=
&
on
->
on_bi
;
if
(
db
.
bd_info
->
bi_db_open
)
{
rc
=
db
.
bd_info
->
bi_db_open
(
&
db
,
cr
);
}
}
return
rc
;
}
static
int
...
...
@@ -211,17 +192,29 @@ over_db_destroy(
{
slap_overinfo
*
oi
=
be
->
bd_info
->
bi_private
;
slap_overinst
*
on
=
oi
->
oi_list
,
*
next
;
BackendInfo
*
bi_orig
=
be
->
bd_info
;
int
rc
;
rc
=
over_db_func
(
be
,
cr
,
db_destroy
);
be
->
bd_info
=
oi
->
oi_orig
;
if
(
be
->
bd_info
->
bi_db_destroy
)
{
rc
=
be
->
bd_info
->
bi_db_destroy
(
be
,
cr
);
}
for
(;
on
&&
rc
==
0
;
on
=
on
->
on_next
)
{
be
->
bd_info
=
&
on
->
on_bi
;
if
(
be
->
bd_info
->
bi_db_destroy
)
{
rc
=
be
->
bd_info
->
bi_db_destroy
(
be
,
cr
);
}
}
on
=
oi
->
oi_list
;
if
(
on
)
{
for
(
next
=
on
->
on_next
;
on
;
on
=
next
)
{
next
=
on
->
on_next
;
free
(
on
);
}
}
be
->
bd_info
=
bi_orig
;
free
(
oi
);
return
rc
;
}
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/slap.h
+
1
−
1
View file @
75eecdc5
...
...
@@ -1707,7 +1707,7 @@ struct ConfigOCs; /* config.h */
struct
BackendDB
{
BackendInfo
*
bd_info
;
/* pointer to shared backend info */
struct
BackendDB
*
bd_self
;
/* pointer to this struct */
BackendDB
*
bd_self
;
/* pointer to this struct */
/* fields in this structure (and routines acting on this structure)
should be renamed from be_ to bd_ */
...
...
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