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
3fe2cec5
Commit
3fe2cec5
authored
21 years ago
by
Pierangelo Masarati
Browse files
Options
Downloads
Patches
Plain Diff
only works with explicit overlay instantiation
parent
adb15297
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-relay/back-relay.h
+2
-0
2 additions, 0 deletions
servers/slapd/back-relay/back-relay.h
servers/slapd/back-relay/config.c
+27
-19
27 additions, 19 deletions
servers/slapd/back-relay/config.c
servers/slapd/back-relay/init.c
+14
-1
14 additions, 1 deletion
servers/slapd/back-relay/init.c
with
43 additions
and
20 deletions
servers/slapd/back-relay/back-relay.h
+
2
−
0
View file @
3fe2cec5
...
...
@@ -29,6 +29,8 @@ LDAP_BEGIN_DECL
typedef
struct
relay_back_info
{
BackendDB
*
ri_bd
;
struct
berval
ri_realsuffix
;
int
ri_massage
;
}
relay_back_info
;
LDAP_END_DECL
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/back-relay/config.c
+
27
−
19
View file @
3fe2cec5
...
...
@@ -46,6 +46,7 @@ relay_back_db_config(
if
(
strcasecmp
(
argv
[
0
],
"relay"
)
==
0
)
{
struct
berval
dn
,
ndn
,
pdn
;
int
rc
;
BackendDB
*
bd
;
if
(
argc
<
2
)
{
fprintf
(
stderr
,
...
...
@@ -70,20 +71,22 @@ relay_back_db_config(
return
1
;
}
ri
->
ri_
bd
=
select_backend
(
&
ndn
,
0
,
1
);
if
(
ri
->
ri_
bd
==
NULL
)
{
bd
=
select_backend
(
&
ndn
,
0
,
1
);
if
(
bd
==
NULL
)
{
fprintf
(
stderr
,
"%s: line %d: "
"cannot find database "
"of relay dn
\"
%s
\"\n
"
,
fname
,
lineno
,
argv
[
1
]
);
return
1
;
}
else
if
(
ri
->
ri_
bd
==
be
)
{
}
else
if
(
bd
==
be
)
{
fprintf
(
stderr
,
"%s: line %d: "
"relay dn
\"
%s
\"
would call self
\n
"
,
fname
,
lineno
,
pdn
.
bv_val
);
return
1
;
}
}
ri
->
ri_realsuffix
=
ndn
;
if
(
overlay_config
(
be
,
"rewrite-remap"
)
)
{
fprintf
(
stderr
,
"%s: line %d: unable to install "
...
...
@@ -93,33 +96,38 @@ relay_back_db_config(
return
1
;
}
if
(
argc
==
3
)
{
#if 0
{
char *cargv[ 4 ];
if
(
strcmp
(
argv
[
2
],
"massage"
)
)
{
fprintf
(
stderr
,
"%s: line %d: "
"unknown directive
\"
%s
\"
"
"in
\"
relay <dn> [massage]
\"
line
\n
"
,
fname
,
lineno
,
argv
[
2
]
);
return
1
;
}
cargv[ 0 ] = "overlay";
cargv[ 1 ] = "rewrite-remap";
cargv[ 2 ] = NULL;
if
(
be
->
be_suffix
[
0
].
bv_val
==
NULL
)
{
fprintf
(
stderr
,
"%s: line %d: "
"relay line must come after
\"
suffix
\"\n
"
,
fname
,
lineno
);
return
1
;
}
be->be_config( be, fname, lineno, 2, cargv );
cargv[ 0 ] = "suffixmassage";
cargv[ 1 ] = be->be_suffix[0].bv_val;
cargv[ 2 ] = ri->ri_bd->be_suffix[0].bv_val;
cargv[ 3 ] = NULL;
if
(
be
->
be_config
(
be
,
"back-relay"
,
1
,
3
,
cargv
)
)
{
if ( be->be_config( be, fname, lineno, 3, cargv ) ) {
return 1;
}
}
if ( argc == 3 ) {
if ( strcmp( argv[2], "massage" ) ) {
fprintf( stderr, "%s: line %d: "
"unknown directive \"%s\" "
"in \"relay <dn> [massage]\" line\n",
fname, lineno, argv[2] );
return 1;
}
ri->ri_massage = 1;
}
#endif
/* anything else */
}
else
{
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/back-relay/init.c
+
14
−
1
View file @
3fe2cec5
...
...
@@ -92,6 +92,9 @@ relay_back_db_init( Backend *be )
}
ri
->
ri_bd
=
NULL
;
ri
->
ri_realsuffix
.
bv_val
=
NULL
;
ri
->
ri_realsuffix
.
bv_len
=
0
;
ri
->
ri_massage
=
0
;
be
->
be_private
=
(
void
*
)
ri
;
...
...
@@ -105,10 +108,20 @@ relay_back_db_open( Backend *be )
assert
(
ri
!=
NULL
);
if
(
ri
->
ri_realsuffix
.
bv_val
!=
NULL
)
{
ri
->
ri_bd
=
select_backend
(
&
ri
->
ri_realsuffix
,
0
,
1
);
assert
(
ri
->
ri_bd
);
}
#if 0
if (
!
ri->ri_
do_not_
massage ) {
if ( ri->ri_massage ) {
char *argv[ 4 ];
if ( be->be_suffix[0].bv_val == NULL ) {
fprintf( stderr, "suffix must be defined to require suffix massage\n" );
return 1;
}
argv[ 0 ] = "suffixmassage";
argv[ 1 ] = be->be_suffix[0].bv_val;
argv[ 2 ] = ri->ri_bd->be_suffix[0].bv_val;
...
...
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