Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Joe Martin
OpenLDAP
Commits
98936ee3
Commit
98936ee3
authored
Nov 25, 2005
by
Pierangelo Masarati
Browse files
streamline overlay configuration
parent
f86543c7
Changes
22
Hide whitespace changes
Inline
Side-by-side
configure
View file @
98936ee3
#! /bin/sh
# From configure.in OpenLDAP: pkg/ldap/configure.in,v 1.60
6
2005/11/
16 05:31:02
kurt Exp .
# From configure.in OpenLDAP: pkg/ldap/configure.in,v 1.60
7
2005/11/
23 17:55:37
kurt Exp .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59.
#
...
...
@@ -45206,7 +45206,10 @@ cat >>$CONFIG_STATUS <<_ACEOF
#
AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS"
STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS"
_ACEOF
...
...
@@ -46229,6 +46232,59 @@ ENDX
/* end of generated file */
ENDX
fi
OVERLAYSC="servers/slapd/overlays/statover.c"
echo "Making $OVERLAYSC"
rm -f $OVERLAYSC
cat > $OVERLAYSC << ENDX
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2005 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as authorized by the OpenLDAP
* Public License.
*
* A copy of this license is available in the file LICENSE in the
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>.
*/
/* This file is automatically generated by configure; please do not edit. */
#include "portable.h"
#include "slap.h"
ENDX
if test "${STATIC_OVERLAYS}"; then
for o in ${STATIC_OVERLAYS}; do
oo=`echo "${o}" | sed -e 's/.o$//' -e 's/_x$//'`
cat >> $OVERLAYSC << ENDX
extern BI_init ${oo}_initialize;
ENDX
done
fi
cat >> $OVERLAYSC << ENDX
OverlayInit slap_oinfo[] = {
ENDX
if test "${STATIC_OVERLAYS}"; then
for o in ${STATIC_OVERLAYS}; do
oo=`echo "${o}" | sed -e 's/.o$//' -e 's/_x$//'`
echo " Add ${oo} ..."
cat >> $OVERLAYSC << ENDX
{ "${oo}", ${oo}_initialize },
ENDX
done
fi
cat >> $OVERLAYSC << ENDX
{ NULL, NULL },
};
/* end of generated file */
ENDX
echo Please run \"make depend\" to build dependencies
;;
configure.in
View file @
98936ee3
...
...
@@ -3252,7 +3252,63 @@ ENDX
/* end of generated file */
ENDX
fi
OVERLAYSC="servers/slapd/overlays/statover.c"
echo "Making $OVERLAYSC"
rm -f $OVERLAYSC
cat > $OVERLAYSC << ENDX
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2005 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as authorized by the OpenLDAP
* Public License.
*
* A copy of this license is available in the file LICENSE in the
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>.
*/
/* This file is automatically generated by configure; please do not edit. */
#include "portable.h"
#include "slap.h"
ENDX
if test "${STATIC_OVERLAYS}"; then
for o in ${STATIC_OVERLAYS}; do
oo=`echo "${o}" | sed -e 's/.o$//' -e 's/_x$//'`
cat >> $OVERLAYSC << ENDX
extern BI_init ${oo}_initialize;
ENDX
done
fi
cat >> $OVERLAYSC << ENDX
OverlayInit slap_oinfo[] = {
ENDX
if test "${STATIC_OVERLAYS}"; then
for o in ${STATIC_OVERLAYS}; do
oo=`echo "${o}" | sed -e 's/.o$//' -e 's/_x$//'`
echo " Add ${oo} ..."
cat >> $OVERLAYSC << ENDX
{ "${oo}", ${oo}_initialize },
ENDX
done
fi
cat >> $OVERLAYSC << ENDX
{ NULL, NULL },
};
/* end of generated file */
ENDX
echo Please run \"make depend\" to build dependencies
]],[[STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS"]])
]],[[
STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS"
STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS"
]])
AC_OUTPUT
servers/slapd/overlays/Makefile.in
View file @
98936ee3
...
...
@@ -29,6 +29,7 @@ SRCS = overlays.c \
unique.c
\
valsort.c
OBJS
=
overlays.o
\
statover.o
\
@SLAPD_STATIC_OVERLAYS@
# Add here the objs that are needed by overlays, but do not make it
...
...
@@ -113,6 +114,8 @@ MKDEPFLAG = -l
.c.lo
:
$(LTCOMPILE_MOD)
$<
statover.o
:
statover.c $(srcdir)/../slap.h
$(LIBRARY)
:
$(OBJS) version.lo
$(AR)
rs
$@
$(OBJS)
...
...
@@ -124,3 +127,6 @@ depend-local:
mv
Makefile Makefile.bak
;
$(SED)
$$
SCR Makefile.bak
>
Makefile
&&
\
$(RM)
Makefile.bak
;
fi
veryclean-local
:
$(RM)
statover.c
servers/slapd/overlays/accesslog.c
View file @
98936ee3
...
...
@@ -1277,8 +1277,8 @@ accesslog_db_open(
ldap_pvt_thread_pool_context_reset
(
thrctx
);
return
rc
;
}
int
accesslog_init
()
int
accesslog_init
ialize
()
{
int
i
,
rc
;
...
...
@@ -1364,8 +1364,10 @@ int accesslog_init()
}
#if SLAPD_OVER_ACCESSLOG == SLAPD_MOD_DYNAMIC
int
init_module
(
int
argc
,
char
*
argv
[])
{
return
accesslog_init
();
int
init_module
(
int
argc
,
char
*
argv
[]
)
{
return
accesslog_initialize
();
}
#endif
...
...
servers/slapd/overlays/auditlog.c
View file @
98936ee3
...
...
@@ -215,7 +215,7 @@ auditlog_config(
return
SLAP_CONF_UNKNOWN
;
}
int
auditlog_init
()
{
int
auditlog_init
ialize
()
{
auditlog
.
on_bi
.
bi_type
=
"auditlog"
;
auditlog
.
on_bi
.
bi_db_init
=
auditlog_db_init
;
...
...
@@ -228,8 +228,10 @@ int auditlog_init() {
}
#if SLAPD_OVER_AUDITLOG == SLAPD_MOD_DYNAMIC && defined(PIC)
int
init_module
(
int
argc
,
char
*
argv
[])
{
return
auditlog_init
();
int
init_module
(
int
argc
,
char
*
argv
[]
)
{
return
auditlog_initialize
();
}
#endif
...
...
servers/slapd/overlays/collect.c
View file @
98936ee3
...
...
@@ -153,7 +153,7 @@ static int collect_config(
static
slap_overinst
collect
;
int
collect_init
()
{
int
collect_init
ialize
()
{
collect
.
on_bi
.
bi_type
=
"collect"
;
collect
.
on_bi
.
bi_db_config
=
collect_config
;
collect
.
on_response
=
collect_response
;
...
...
@@ -163,7 +163,7 @@ int collect_init() {
#if SLAPD_OVER_COLLECT == SLAPD_MOD_DYNAMIC
int
init_module
(
int
argc
,
char
*
argv
[])
{
return
collect_init
();
return
collect_init
ialize
();
}
#endif
...
...
servers/slapd/overlays/denyop.c
View file @
98936ee3
...
...
@@ -224,7 +224,7 @@ denyop_destroy(
static
slap_overinst
denyop
;
int
denyop_init
(
void
)
denyop_init
ialize
(
void
)
{
memset
(
&
denyop
,
0
,
sizeof
(
slap_overinst
)
);
denyop
.
on_bi
.
bi_type
=
"denyop"
;
...
...
@@ -251,7 +251,7 @@ denyop_init( void )
int
init_module
(
int
argc
,
char
*
argv
[]
)
{
return
denyop_init
();
return
denyop_init
ialize
();
}
#endif
/* SLAPD_OVER_DENYOP == SLAPD_MOD_DYNAMIC */
...
...
servers/slapd/overlays/dyngroup.c
View file @
98936ee3
...
...
@@ -146,7 +146,7 @@ static slap_overinst dyngroup;
* initialized and registered by some other function inside slapd.
*/
int
dyngroup_init
()
{
int
dyngroup_init
ialize
()
{
dyngroup
.
on_bi
.
bi_type
=
"dyngroup"
;
dyngroup
.
on_bi
.
bi_db_config
=
dyngroup_config
;
dyngroup
.
on_bi
.
bi_db_close
=
dyngroup_close
;
...
...
@@ -156,8 +156,10 @@ int dyngroup_init() {
}
#if SLAPD_OVER_DYNGROUP == SLAPD_MOD_DYNAMIC
int
init_module
(
int
argc
,
char
*
argv
[])
{
return
dyngroup_init
();
int
init_module
(
int
argc
,
char
*
argv
[]
)
{
return
dyngroup_initialize
();
}
#endif
...
...
servers/slapd/overlays/dynlist.c
View file @
98936ee3
...
...
@@ -749,7 +749,7 @@ static slap_overinst dynlist = { { NULL } };
static
#endif
/* SLAPD_OVER_DYNLIST == SLAPD_MOD_DYNAMIC */
int
dynlist_init
(
void
)
dynlist_init
ialize
(
void
)
{
dynlist
.
on_bi
.
bi_type
=
"dynlist"
;
dynlist
.
on_bi
.
bi_db_init
=
dynlist_db_init
;
...
...
@@ -766,7 +766,7 @@ dynlist_init(void)
int
init_module
(
int
argc
,
char
*
argv
[]
)
{
return
dynlist_init
();
return
dynlist_init
ialize
();
}
#endif
...
...
servers/slapd/overlays/lastmod.c
View file @
98936ee3
...
...
@@ -995,7 +995,7 @@ lastmod_db_destroy(
static
slap_overinst
lastmod
;
int
lastmod_init
()
lastmod_init
ialize
()
{
lastmod
.
on_bi
.
bi_type
=
"lastmod"
;
lastmod
.
on_bi
.
bi_db_init
=
lastmod_db_init
;
...
...
@@ -1020,7 +1020,7 @@ lastmod_init()
int
init_module
(
int
argc
,
char
*
argv
[]
)
{
return
lastmod_init
();
return
lastmod_init
ialize
();
}
#endif
/* SLAPD_OVER_LASTMOD == SLAPD_MOD_DYNAMIC */
...
...
servers/slapd/overlays/overlays.c
View file @
98936ee3
...
...
@@ -23,116 +23,22 @@
#include
"slap.h"
#if SLAPD_OVER_ACCESSLOG == SLAPD_MOD_STATIC
extern
int
accesslog_init
();
#endif
#if SLAPD_OVER_DENYOP == SLAPD_MOD_STATIC
extern
int
denyop_init
();
#endif
#if SLAPD_OVER_DYNGROUP == SLAPD_MOD_STATIC
extern
int
dyngroup_init
();
#endif
#if SLAPD_OVER_DYNLIST == SLAPD_MOD_STATIC
extern
int
dynlist_init
();
#endif
#if SLAPD_OVER_GLUE == SLAPD_MOD_STATIC
extern
int
glue_init
();
#endif
#if SLAPD_OVER_LASTMOD == SLAPD_MOD_STATIC
extern
int
lastmod_init
();
#endif
#if SLAPD_OVER_PPOLICY == SLAPD_MOD_STATIC
extern
int
ppolicy_init
();
#endif
#if SLAPD_OVER_PROXYCACHE == SLAPD_MOD_STATIC
extern
int
pcache_init
();
#endif
#if SLAPD_OVER_REFINT == SLAPD_MOD_STATIC
extern
int
refint_init
();
#endif
#if SLAPD_OVER_RETCODE == SLAPD_MOD_STATIC
extern
int
retcode_init
();
#endif
#if SLAPD_OVER_RWM == SLAPD_MOD_STATIC
extern
int
rwm_init
();
#endif
#if SLAPD_OVER_SYNCPROV == SLAPD_MOD_STATIC
extern
int
syncprov_init
();
#endif
#if SLAPD_OVER_TRANSLUCENT == SLAPD_MOD_STATIC
extern
int
translucent_init
();
#endif
#if SLAPD_OVER_UNIQUE == SLAPD_MOD_STATIC
extern
int
unique_init
();
#endif
#if SLAPD_OVER_VALSORT == SLAPD_MOD_STATIC
extern
int
valsort_init
();
#endif
static
struct
{
char
*
name
;
int
(
*
func
)();
}
funcs
[]
=
{
#if SLAPD_OVER_ACCESSLOG == SLAPD_MOD_STATIC
{
"Access Log"
,
accesslog_init
},
#endif
#if SLAPD_OVER_DENYOP == SLAPD_MOD_STATIC
{
"Deny Operation"
,
denyop_init
},
#endif
#if SLAPD_OVER_DYNGROUP == SLAPD_MOD_STATIC
{
"Dynamic Group"
,
dyngroup_init
},
#endif
#if SLAPD_OVER_DYNLIST == SLAPD_MOD_STATIC
{
"Dynamic List"
,
dynlist_init
},
#endif
#if SLAPD_OVER_GLUE == SLAPD_MOD_STATIC
{
"Backend Glue"
,
glue_init
},
#endif
#if SLAPD_OVER_LASTMOD == SLAPD_MOD_STATIC
{
"Last Modification"
,
lastmod_init
},
#endif
#if SLAPD_OVER_PPOLICY == SLAPD_MOD_STATIC
{
"Password Policy"
,
ppolicy_init
},
#endif
#if SLAPD_OVER_PROXYCACHE == SLAPD_MOD_STATIC
{
"Proxy Cache"
,
pcache_init
},
#endif
#if SLAPD_OVER_REFINT == SLAPD_MOD_STATIC
{
"Referential Integrity"
,
refint_init
},
#endif
#if SLAPD_OVER_RETCODE == SLAPD_MOD_STATIC
{
"Return Code"
,
retcode_init
},
#endif
#if SLAPD_OVER_RWM == SLAPD_MOD_STATIC
{
"Rewrite/Remap"
,
rwm_init
},
#endif
#if SLAPD_OVER_SYNCPROV == SLAPD_MOD_STATIC
{
"Syncrepl Provider"
,
syncprov_init
},
#endif
#if SLAPD_OVER_TRANSLUCENT == SLAPD_MOD_STATIC
{
"Translucent Proxy"
,
translucent_init
},
#endif
#if SLAPD_OVER_UNIQUE == SLAPD_MOD_STATIC
{
"Attribute Uniqueness"
,
unique_init
},
#endif
#if SLAPD_OVER_VALSORT == SLAPD_MOD_STATIC
{
"Value Sorting"
,
valsort_init
},
#endif
{
NULL
,
NULL
}
};
extern
OverlayInit
slap_oinfo
[];
int
overlay_init
(
void
)
{
int
i
,
rc
=
0
;
for
(
i
=
0
;
funcs
[
i
].
nam
e
;
i
++
)
{
rc
=
funcs
[
i
].
func
();
for
(
i
=
0
;
slap_oinfo
[
i
].
ov_typ
e
;
i
++
)
{
rc
=
slap_oinfo
[
i
].
ov_init
();
if
(
rc
)
{
Debug
(
LDAP_DEBUG_ANY
,
"%s overlay setup failed, err %d
\n
"
,
funcs
[
i
].
name
,
rc
,
0
);
"%s overlay setup failed, err %d
\n
"
,
slap_oinfo
[
i
].
ov_type
,
rc
,
0
);
break
;
}
}
return
rc
;
}
servers/slapd/overlays/pcache.c
View file @
98936ee3
...
...
@@ -1086,7 +1086,7 @@ cache_entries(
}
static
int
p
roxy_
cache_response
(
pcache_response
(
Operation
*
op
,
SlapReply
*
rs
)
{
...
...
@@ -1218,7 +1218,7 @@ add_filter_attrs(
* performing the pagedResults search only within the client
* and the proxy. This requires pcache to understand pagedResults. */
static
int
p
roxy_
cache_chk_controls
(
pcache_chk_controls
(
Operation
*
op
,
SlapReply
*
rs
)
{
...
...
@@ -1249,7 +1249,7 @@ proxy_cache_chk_controls(
}
static
int
p
roxy_
cache_search
(
pcache_
op_
search
(
Operation
*
op
,
SlapReply
*
rs
)
{
...
...
@@ -1377,7 +1377,7 @@ proxy_cache_search(
add_filter_attrs
(
op
,
&
op
->
ors_attrs
,
query
.
attrs
,
filter_attrs
);
cb
=
op
->
o_tmpalloc
(
sizeof
(
*
cb
)
+
sizeof
(
*
si
),
op
->
o_tmpmemctx
);
cb
->
sc_response
=
p
roxy_
cache_response
;
cb
->
sc_response
=
pcache_response
;
cb
->
sc_cleanup
=
NULL
;
cb
->
sc_private
=
(
cb
+
1
);
si
=
cb
->
sc_private
;
...
...
@@ -1988,7 +1988,7 @@ pc_cf_gen( ConfigArgs *c )
}
static
int
p
roxy_
cache_config
(
pcache_
db_
config
(
BackendDB
*
be
,
const
char
*
fname
,
int
lineno
,
...
...
@@ -2007,7 +2007,7 @@ proxy_cache_config(
}
static
int
p
roxy_
cache_init
(
pcache_
db_
init
(
BackendDB
*
be
)
{
...
...
@@ -2052,7 +2052,7 @@ proxy_cache_init(
}
static
int
p
roxy_
cache_open
(
pcache_
db_
open
(
BackendDB
*
be
)
{
...
...
@@ -2109,7 +2109,7 @@ proxy_cache_open(
if
(
BER_BVISNULL
(
&
cm
->
db
.
be_rootndn
)
||
BER_BVISEMPTY
(
&
cm
->
db
.
be_rootndn
)
)
{
Debug
(
LDAP_DEBUG_ANY
,
"p
roxy_
cache_open(): "
Debug
(
LDAP_DEBUG_ANY
,
"pcache_
db_
open(): "
"underlying database of type
\"
%s
\"\n
"
" serving naming context
\"
%s
\"\n
"
" has no
\"
rootdn
\"
, required by
\"
proxycache
\"
.
\n
"
,
...
...
@@ -2123,7 +2123,7 @@ proxy_cache_open(
}
static
int
p
roxy_
cache_close
(
pcache_
db_
close
(
BackendDB
*
be
)
{
...
...
@@ -2165,7 +2165,7 @@ proxy_cache_close(
}
static
int
p
roxy_
cache_destroy
(
pcache_
db_
destroy
(
BackendDB
*
be
)
{
...
...
@@ -2194,9 +2194,9 @@ proxy_cache_destroy(
return
0
;
}
static
slap_overinst
p
roxy_
cache
;
static
slap_overinst
pcache
;
int
pcache_init
()
int
pcache_init
ialize
()
{
LDAPAttributeType
*
at
;
int
code
;
...
...
@@ -2206,7 +2206,7 @@ int pcache_init()
LDAP_SCHEMA_ALLOW_ALL
);
if
(
!
at
)
{
Debug
(
LDAP_DEBUG_ANY
,
"pcache_init: ldap_str2attributetype failed %s %s
\n
"
,
"pcache_init
ialize
: ldap_str2attributetype failed %s %s
\n
"
,
ldap_scherr2str
(
code
),
err
,
0
);
return
code
;
}
...
...
@@ -2217,32 +2217,33 @@ int pcache_init()
ldap_memfree
(
at
);
if
(
code
)
{
Debug
(
LDAP_DEBUG_ANY
,
"pcache_init: at_add failed %s %s
\n
"
,
"pcache_init
ialize
: at_add failed %s %s
\n
"
,
scherr2str
(
code
),
err
,
0
);
return
code
;
}
proxy_cache
.
on_bi
.
bi_type
=
"pcache"
;
proxy_cache
.
on_bi
.
bi_db_init
=
proxy_cache_init
;
proxy_cache
.
on_bi
.
bi_db_config
=
proxy_cache_config
;
proxy_cache
.
on_bi
.
bi_db_open
=
proxy_cache_open
;
proxy_cache
.
on_bi
.
bi_db_close
=
proxy_cache_close
;
proxy_cache
.
on_bi
.
bi_db_destroy
=
proxy_cache_destroy
;
proxy_cache
.
on_bi
.
bi_op_search
=
proxy_cache_search
;
pcache
.
on_bi
.
bi_type
=
"pcache"
;
pcache
.
on_bi
.
bi_db_init
=
pcache_db_init
;
pcache
.
on_bi
.
bi_db_config
=
pcache_db_config
;
pcache
.
on_bi
.
bi_db_open
=
pcache_db_open
;
pcache
.
on_bi
.
bi_db_close
=
pcache_db_close
;
pcache
.
on_bi
.
bi_db_destroy
=
pcache_db_destroy
;
p
roxy_
cache
.
on_bi
.
bi_
chk_controls
=
proxy_cache_chk_controls
;
pcache
.
on_bi
.
bi_
op_search
=
pcache_op_search
;
proxy_cache
.
on_bi
.
bi_cf_ocs
=
pcocs
;
pcache
.
on_bi
.
bi_chk_controls
=
pcache_chk_controls
;
pcache
.
on_bi
.
bi_cf_ocs
=
pcocs
;
code
=
config_register_schema
(
pccfg
,
pcocs
);
if
(
code
)
return
code
;
return
overlay_register
(
&
p
roxy_
cache
);
return
overlay_register
(
&
pcache
);
}
#if SLAPD_OVER_PROXYCACHE == SLAPD_MOD_DYNAMIC
int
init_module
(
int
argc
,
char
*
argv
[])
{
return
pcache_init
();
return
pcache_init
ialize
();
}
#endif
...
...
servers/slapd/overlays/ppolicy.c
View file @
98936ee3
...
...
@@ -1942,7 +1942,7 @@ static char *extops[] = {
static
slap_overinst
ppolicy
;
int
ppolicy_init
()
int
ppolicy_init
ialize
()
{
LDAPAttributeType
*
at
;
const
char
*
err
;
...
...
@@ -2002,7 +2002,7 @@ int ppolicy_init()
#if SLAPD_OVER_PPOLICY == SLAPD_MOD_DYNAMIC
int
init_module
(
int
argc
,
char
*
argv
[])
{
return
ppolicy_init
();
return
ppolicy_init
ialize
();
}
#endif
...
...
servers/slapd/overlays/refint.c
View file @
98936ee3
...
...
@@ -659,7 +659,7 @@ done:
** it expects to be called automagically during dynamic module initialization
*/
int
refint_init
()
{
int
refint_init
ialize
()
{
/* statically declared just after the #includes at top */
refint
.
on_bi
.
bi_type
=
"refint"
;
...
...
@@ -674,7 +674,7 @@ int refint_init() {
#if SLAPD_OVER_REFINT == SLAPD_MOD_DYNAMIC && defined(PIC)
int
init_module
(
int
argc
,
char
*
argv
[])
{
return
refint_init
();
return
refint_init
ialize
();
}
#endif
...
...
servers/slapd/overlays/retcode.c
View file @
98936ee3
...
...
@@ -1066,7 +1066,7 @@ retcode_db_destroy( BackendDB *be )
static
#endif
/* SLAPD_OVER_RETCODE == SLAPD_MOD_DYNAMIC */
int
retcode_init
(
void
)
retcode_init
ialize
(
void
)
{
int
i
,
code
;
const
char
*
err
;
...
...
@@ -1243,7 +1243,7 @@ retcode_init( void )
int
init_module
(
int
argc
,
char
*
argv
[]
)