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
David Barchiesi
OpenLDAP
Commits
4b6f888b
Commit
4b6f888b
authored
14 years ago
by
Howard Chu
Committed by
Quanah Gibson-Mount
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add overlay wrapper, use for triggers etc.
parent
0c17500a
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-sock/config.c
+130
-2
130 additions, 2 deletions
servers/slapd/back-sock/config.c
with
130 additions
and
2 deletions
servers/slapd/back-sock/config.c
+
130
−
2
View file @
4b6f888b
...
...
@@ -30,6 +30,7 @@
#include
"back-sock.h"
static
ConfigDriver
bs_cf_gen
;
static
int
sock_over_setup
();
enum
{
BS_EXT
=
1
...
...
@@ -61,6 +62,17 @@ static ConfigOCs bsocs[] = {
{
NULL
,
0
,
NULL
}
};
static
ConfigOCs
osocs
[]
=
{
{
"( OLcfgOvOc:22.1 "
"NAME 'olcOvSocketConfig' "
"DESC 'Socket overlay configuration' "
"SUP olcOverlayConfig "
"MUST olcDbSocketPath "
"MAY olcDbSocketExtensions )"
,
Cft_Overlay
,
bscfg
},
{
NULL
,
0
,
NULL
}
};
static
slap_verbmasks
bs_exts
[]
=
{
{
BER_BVC
(
"binddn"
),
SOCK_EXT_BINDDN
},
{
BER_BVC
(
"peername"
),
SOCK_EXT_PEERNAME
},
...
...
@@ -71,9 +83,16 @@ static slap_verbmasks bs_exts[] = {
static
int
bs_cf_gen
(
ConfigArgs
*
c
)
{
struct
sockinfo
*
si
=
c
->
be
->
be_private
;
struct
sockinfo
*
si
;
int
rc
;
if
(
c
->
be
&&
c
->
table
==
Cft_Database
)
si
=
c
->
be
->
be_private
;
else
if
(
c
->
bi
)
si
=
c
->
bi
->
bi_private
;
else
return
ARG_BAD_CONF
;
if
(
c
->
op
==
SLAP_CONFIG_EMIT
)
{
switch
(
c
->
type
)
{
case
BS_EXT
:
...
...
@@ -106,7 +125,116 @@ bs_cf_gen( ConfigArgs *c )
int
sock_back_init_cf
(
BackendInfo
*
bi
)
{
int
rc
;
bi
->
bi_cf_ocs
=
bsocs
;
return
config_register_schema
(
bscfg
,
bsocs
);
rc
=
config_register_schema
(
bscfg
,
bsocs
);
if
(
!
rc
)
rc
=
sock_over_setup
();
return
rc
;
}
/* sock overlay wrapper */
static
slap_overinst
sockover
;
static
int
sock_over_db_init
(
Backend
*
be
,
struct
config_reply_s
*
cr
);
static
int
sock_over_db_destroy
(
Backend
*
be
,
struct
config_reply_s
*
cr
);
static
BI_op_bind
*
sockfuncs
[]
=
{
sock_back_bind
,
sock_back_unbind
,
sock_back_search
,
sock_back_compare
,
sock_back_modify
,
sock_back_modrdn
,
sock_back_add
,
sock_back_delete
};
static
int
sock_over_op
(
Operation
*
op
,
SlapReply
*
rs
)
{
slap_overinst
*
on
=
(
slap_overinst
*
)
op
->
o_bd
->
bd_info
;
void
*
private
=
op
->
o_bd
->
be_private
;
slap_operation_t
which
;
int
rc
;
switch
(
op
->
o_tag
)
{
case
LDAP_REQ_BIND
:
which
=
op_bind
;
break
;
case
LDAP_REQ_UNBIND
:
which
=
op_unbind
;
break
;
case
LDAP_REQ_SEARCH
:
which
=
op_search
;
break
;
case
LDAP_REQ_COMPARE
:
which
=
op_compare
;
break
;
case
LDAP_REQ_MODIFY
:
which
=
op_modify
;
break
;
case
LDAP_REQ_MODRDN
:
which
=
op_modrdn
;
break
;
case
LDAP_REQ_ADD
:
which
=
op_add
;
break
;
case
LDAP_REQ_DELETE
:
which
=
op_delete
;
break
;
default:
return
SLAP_CB_CONTINUE
;
}
op
->
o_bd
->
be_private
=
on
->
on_bi
.
bi_private
;
rc
=
sockfuncs
[
which
](
op
,
rs
);
op
->
o_bd
->
be_private
=
private
;
return
rc
;
}
static
int
sock_over_setup
()
{
int
rc
;
sockover
.
on_bi
.
bi_type
=
"sock"
;
sockover
.
on_bi
.
bi_db_init
=
sock_over_db_init
;
sockover
.
on_bi
.
bi_db_destroy
=
sock_over_db_destroy
;
sockover
.
on_bi
.
bi_op_bind
=
sock_over_op
;
sockover
.
on_bi
.
bi_op_unbind
=
sock_over_op
;
sockover
.
on_bi
.
bi_op_search
=
sock_over_op
;
sockover
.
on_bi
.
bi_op_compare
=
sock_over_op
;
sockover
.
on_bi
.
bi_op_modify
=
sock_over_op
;
sockover
.
on_bi
.
bi_op_modrdn
=
sock_over_op
;
sockover
.
on_bi
.
bi_op_add
=
sock_over_op
;
sockover
.
on_bi
.
bi_op_delete
=
sock_over_op
;
sockover
.
on_bi
.
bi_cf_ocs
=
osocs
;
rc
=
config_register_schema
(
bscfg
,
osocs
);
if
(
rc
)
return
rc
;
return
overlay_register
(
&
sockover
);
}
static
int
sock_over_db_init
(
Backend
*
be
,
struct
config_reply_s
*
cr
)
{
slap_overinst
*
on
=
(
slap_overinst
*
)
be
->
bd_info
;
void
*
private
=
be
->
be_private
;
int
rc
;
be
->
be_private
=
NULL
;
rc
=
sock_back_db_init
(
be
,
cr
);
on
->
on_bi
.
bi_private
=
be
->
be_private
;
be
->
be_private
=
private
;
return
rc
;
}
static
int
sock_over_db_destroy
(
Backend
*
be
,
struct
config_reply_s
*
cr
)
{
slap_overinst
*
on
=
(
slap_overinst
*
)
be
->
bd_info
;
void
*
private
=
be
->
be_private
;
int
rc
;
be
->
be_private
=
on
->
on_bi
.
bi_private
;
rc
=
sock_back_db_destroy
(
be
,
cr
);
on
->
on_bi
.
bi_private
=
be
->
be_private
;
be
->
be_private
=
private
;
return
rc
;
}
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