Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Lukas However
OpenLDAP
Commits
88c03960
Commit
88c03960
authored
Aug 09, 2005
by
Kurt Zeilenga
Browse files
Sync with HEAD
parent
d2b9ac48
Changes
294
Expand all
Hide whitespace changes
Inline
Side-by-side
configure
View file @
88c03960
This diff is collapsed.
Click to expand it.
include/ldap.h
View file @
88c03960
...
...
@@ -298,6 +298,7 @@ typedef struct ldapcontrol {
#define LDAP_CONTROL_X_SEARCH_OPTIONS "1.2.840.113556.1.4.1340"
#define LDAP_SEARCH_FLAG_DOMAIN_SCOPE 1
/* do not generate referrals */
#define LDAP_SEARCH_FLAG_PHANTOM_ROOT 2
/* search all NCs subordinate to base */
#define LDAP_CONTROL_X_EXTENDED_DN "1.2.840.113556.1.4.529"
/* LDAP Unsolicited Notifications */
#define LDAP_NOTICE_OF_DISCONNECTION "1.3.6.1.4.1.1466.20036"
/* RFC 2251 */
...
...
@@ -1959,7 +1960,7 @@ ldap_parse_vlv_control LDAP_P((
* LDAP Transactions
* in txn.c
*/
#ifdef LDAP_GROUP
ING
_TRANSACTION
#ifdef LDAP_GROUP_TRANSACTION
LDAP_F
(
int
)
ldap_parse_txn_create
LDAP_P
((
LDAP
*
ld
,
...
...
include/ldap_cdefs.h
View file @
88c03960
...
...
@@ -207,6 +207,24 @@
# define LDAP_SLAPD_V(type) extern type
#endif
/* SLAPD (as a dynamic library exporting symbols) */
#if defined(_WIN32) && defined(SLAPD_IMPORT)
# define LDAP_SLAPI_F(type) extern __declspec(dllimport) type
# define LDAP_SLAPI_V(type) extern __declspec(dllimport) type
#else
# define LDAP_SLAPI_F(type) extern type
# define LDAP_SLAPI_V(type) extern type
#endif
/* SLAPD (as a dynamic library exporting symbols) */
#if defined(_WIN32) && defined(SLAPD_IMPORT)
# define SLAPI_F(type) extern __declspec(dllimport) type
# define SLAPI_V(type) extern __declspec(dllimport) type
#else
# define SLAPI_F(type) extern type
# define SLAPI_V(type) extern type
#endif
/*
* C library. Mingw32 links with the dynamic C run-time library by default,
* so the explicit definition of CSTATIC will keep dllimport from
...
...
include/portable.h.in
View file @
88c03960
...
...
@@ -620,6 +620,9 @@
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define if you have the <utime.h> header file. */
#undef HAVE_UTIME_H
/* Define if you have the <winsock.h> header file. */
#undef HAVE_WINSOCK_H
...
...
@@ -1061,6 +1064,9 @@
/* define for Referential Integrity overlay */
#undef SLAPD_OVER_REFINT
/* define for Referential Integrity overlay */
#undef SLAPD_OVER_RETCODE
/* define for Rewrite/Remap overlay */
#undef SLAPD_OVER_RWM
...
...
include/slapi-plugin.h
View file @
88c03960
...
...
@@ -40,6 +40,9 @@ typedef struct slapi_mod Slapi_Mod;
typedef
struct
slapi_mods
Slapi_Mods
;
typedef
struct
slapi_componentid
Slapi_ComponentId
;
#define SLAPI_ATTR_UNIQUEID "entryUUID"
#define SLAPI_ATTR_OBJECTCLASS "objectClass"
/* pblock routines */
int
slapi_pblock_get
(
Slapi_PBlock
*
pb
,
int
arg
,
void
*
value
);
int
slapi_pblock_set
(
Slapi_PBlock
*
pb
,
int
arg
,
void
*
value
);
...
...
@@ -76,6 +79,7 @@ char *slapi_dn_normalize( char *dn );
char
*
slapi_dn_normalize_case
(
char
*
dn
);
int
slapi_dn_issuffix
(
char
*
dn
,
char
*
suffix
);
char
*
slapi_dn_beparent
(
Slapi_PBlock
*
pb
,
const
char
*
dn
);
int
slapi_dn_isbesuffix
(
Slapi_PBlock
*
pb
,
char
*
dn
);
char
*
slapi_dn_parent
(
const
char
*
dn
);
int
slapi_dn_isparent
(
const
char
*
parentdn
,
const
char
*
childdn
);
char
*
slapi_dn_ignore_case
(
char
*
dn
);
...
...
@@ -141,7 +145,7 @@ Slapi_Value *slapi_value_new_value(const Slapi_Value *v);
Slapi_Value
*
slapi_value_new_string
(
const
char
*
s
);
Slapi_Value
*
slapi_value_init
(
Slapi_Value
*
v
);
Slapi_Value
*
slapi_value_init_berval
(
Slapi_Value
*
v
,
struct
berval
*
bval
);
Slapi_Value
*
slapi_value_init_string
(
Slapi_Value
*
v
,
const
char
*
s
);
Slapi_Value
*
slapi_value_init_string
(
Slapi_Value
*
v
,
const
char
*
s
);
Slapi_Value
*
slapi_value_dup
(
const
Slapi_Value
*
v
);
void
slapi_value_free
(
Slapi_Value
**
value
);
const
struct
berval
*
slapi_value_get_berval
(
const
Slapi_Value
*
value
);
...
...
@@ -156,7 +160,7 @@ unsigned int slapi_value_get_uint(const Slapi_Value *value);
long
slapi_value_get_long
(
const
Slapi_Value
*
value
);
unsigned
long
slapi_value_get_ulong
(
const
Slapi_Value
*
value
);
size_t
slapi_value_get_length
(
const
Slapi_Value
*
value
);
int
slapi_value_compare
(
const
Slapi_Attr
*
a
,
const
Slapi_Value
*
v1
,
const
Slapi_Value
*
v2
);
int
slapi_value_compare
(
const
Slapi_Attr
*
a
,
const
Slapi_Value
*
v1
,
const
Slapi_Value
*
v2
);
Slapi_ValueSet
*
slapi_valueset_new
(
void
);
void
slapi_valueset_free
(
Slapi_ValueSet
*
vs
);
...
...
@@ -168,6 +172,70 @@ int slapi_valueset_next_value( Slapi_ValueSet *vs, int index, Slapi_Value **v);
int
slapi_valueset_count
(
const
Slapi_ValueSet
*
vs
);
void
slapi_valueset_set_valueset
(
Slapi_ValueSet
*
vs1
,
const
Slapi_ValueSet
*
vs2
);
/* DNs */
Slapi_DN
*
slapi_sdn_new
(
void
);
Slapi_DN
*
slapi_sdn_new_dn_byval
(
const
char
*
dn
);
Slapi_DN
*
slapi_sdn_new_ndn_byval
(
const
char
*
ndn
);
Slapi_DN
*
slapi_sdn_new_dn_byref
(
const
char
*
dn
);
Slapi_DN
*
slapi_sdn_new_ndn_byref
(
const
char
*
ndn
);
Slapi_DN
*
slapi_sdn_new_dn_passin
(
const
char
*
dn
);
Slapi_DN
*
slapi_sdn_set_dn_byval
(
Slapi_DN
*
sdn
,
const
char
*
dn
);
Slapi_DN
*
slapi_sdn_set_dn_byref
(
Slapi_DN
*
sdn
,
const
char
*
dn
);
Slapi_DN
*
slapi_sdn_set_dn_passin
(
Slapi_DN
*
sdn
,
const
char
*
dn
);
Slapi_DN
*
slapi_sdn_set_ndn_byval
(
Slapi_DN
*
sdn
,
const
char
*
ndn
);
Slapi_DN
*
slapi_sdn_set_ndn_byref
(
Slapi_DN
*
sdn
,
const
char
*
ndn
);
void
slapi_sdn_done
(
Slapi_DN
*
sdn
);
void
slapi_sdn_free
(
Slapi_DN
**
sdn
);
const
char
*
slapi_sdn_get_dn
(
const
Slapi_DN
*
sdn
);
const
char
*
slapi_sdn_get_ndn
(
const
Slapi_DN
*
sdn
);
void
slapi_sdn_get_parent
(
const
Slapi_DN
*
sdn
,
Slapi_DN
*
sdn_parent
);
void
slapi_sdn_get_backend_parent
(
const
Slapi_DN
*
sdn
,
Slapi_DN
*
sdn_parent
,
const
Slapi_Backend
*
backend
);
Slapi_DN
*
slapi_sdn_dup
(
const
Slapi_DN
*
sdn
);
void
slapi_sdn_copy
(
const
Slapi_DN
*
from
,
Slapi_DN
*
to
);
int
slapi_sdn_compare
(
const
Slapi_DN
*
sdn1
,
const
Slapi_DN
*
sdn2
);
int
slapi_sdn_isempty
(
const
Slapi_DN
*
sdn
);
int
slapi_sdn_issuffix
(
const
Slapi_DN
*
sdn
,
const
Slapi_DN
*
suffixsdn
);
int
slapi_sdn_isparent
(
const
Slapi_DN
*
parent
,
const
Slapi_DN
*
child
);
int
slapi_sdn_isgrandparent
(
const
Slapi_DN
*
parent
,
const
Slapi_DN
*
child
);
int
slapi_sdn_get_ndn_len
(
const
Slapi_DN
*
sdn
);
int
slapi_sdn_scope_test
(
const
Slapi_DN
*
dn
,
const
Slapi_DN
*
base
,
int
scope
);
void
slapi_sdn_get_rdn
(
const
Slapi_DN
*
sdn
,
Slapi_RDN
*
rdn
);
Slapi_DN
*
slapi_sdn_set_rdn
(
Slapi_DN
*
sdn
,
const
Slapi_RDN
*
rdn
);
Slapi_DN
*
slapi_sdn_set_parent
(
Slapi_DN
*
sdn
,
const
Slapi_DN
*
parentdn
);
int
slapi_sdn_is_rdn_component
(
const
Slapi_DN
*
rdn
,
const
Slapi_Attr
*
a
,
const
Slapi_Value
*
v
);
char
*
slapi_moddn_get_newdn
(
Slapi_DN
*
dn_olddn
,
char
*
newrdn
,
char
*
newsuperiordn
);
/* RDNs */
Slapi_RDN
*
slapi_rdn_new
(
void
);
Slapi_RDN
*
slapi_rdn_new_dn
(
const
char
*
dn
);
Slapi_RDN
*
slapi_rdn_new_sdn
(
const
Slapi_DN
*
sdn
);
Slapi_RDN
*
slapi_rdn_new_rdn
(
const
Slapi_RDN
*
fromrdn
);
void
slapi_rdn_init
(
Slapi_RDN
*
rdn
);
void
slapi_rdn_init_dn
(
Slapi_RDN
*
rdn
,
const
char
*
dn
);
void
slapi_rdn_init_sdn
(
Slapi_RDN
*
rdn
,
const
Slapi_DN
*
sdn
);
void
slapi_rdn_init_rdn
(
Slapi_RDN
*
rdn
,
const
Slapi_RDN
*
fromrdn
);
void
slapi_rdn_set_dn
(
Slapi_RDN
*
rdn
,
const
char
*
dn
);
void
slapi_rdn_set_sdn
(
Slapi_RDN
*
rdn
,
const
Slapi_DN
*
sdn
);
void
slapi_rdn_set_rdn
(
Slapi_RDN
*
rdn
,
const
Slapi_RDN
*
fromrdn
);
void
slapi_rdn_free
(
Slapi_RDN
**
rdn
);
void
slapi_rdn_done
(
Slapi_RDN
*
rdn
);
int
slapi_rdn_get_first
(
Slapi_RDN
*
rdn
,
char
**
type
,
char
**
value
);
int
slapi_rdn_get_next
(
Slapi_RDN
*
rdn
,
int
index
,
char
**
type
,
char
**
value
);
int
slapi_rdn_get_index
(
Slapi_RDN
*
rdn
,
const
char
*
type
,
const
char
*
value
,
size_t
length
);
int
slapi_rdn_get_index_attr
(
Slapi_RDN
*
rdn
,
const
char
*
type
,
char
**
value
);
int
slapi_rdn_contains
(
Slapi_RDN
*
rdn
,
const
char
*
type
,
const
char
*
value
,
size_t
length
);
int
slapi_rdn_contains_attr
(
Slapi_RDN
*
rdn
,
const
char
*
type
,
char
**
value
);
int
slapi_rdn_add
(
Slapi_RDN
*
rdn
,
const
char
*
type
,
const
char
*
value
);
int
slapi_rdn_remove_index
(
Slapi_RDN
*
rdn
,
int
atindex
);
int
slapi_rdn_remove
(
Slapi_RDN
*
rdn
,
const
char
*
type
,
const
char
*
value
,
size_t
length
);
int
slapi_rdn_remove_attr
(
Slapi_RDN
*
rdn
,
const
char
*
type
);
int
slapi_rdn_isempty
(
const
Slapi_RDN
*
rdn
);
int
slapi_rdn_get_num_components
(
Slapi_RDN
*
rdn
);
int
slapi_rdn_compare
(
Slapi_RDN
*
rdn1
,
Slapi_RDN
*
rdn2
);
const
char
*
slapi_rdn_get_rdn
(
const
Slapi_RDN
*
rdn
);
const
char
*
slapi_rdn_get_nrdn
(
const
Slapi_RDN
*
rdn
);
Slapi_DN
*
slapi_sdn_add_rdn
(
Slapi_DN
*
sdn
,
const
Slapi_RDN
*
rdn
);
/* locks and synchronization */
typedef
struct
slapi_mutex
Slapi_Mutex
;
typedef
struct
slapi_condvar
Slapi_CondVar
;
...
...
@@ -189,7 +257,7 @@ void slapi_ch_free( void **ptr );
void
slapi_ch_free_string
(
char
**
ptr
);
char
*
slapi_ch_calloc
(
unsigned
long
nelem
,
unsigned
long
size
);
char
*
slapi_ch_realloc
(
char
*
block
,
unsigned
long
size
);
char
*
slapi_ch_strdup
(
char
*
s
);
char
*
slapi_ch_strdup
(
const
char
*
s
);
void
slapi_ch_array_free
(
char
**
arrayp
);
struct
berval
*
slapi_ch_bvdup
(
const
struct
berval
*
v
);
struct
berval
**
slapi_ch_bvecdup
(
const
struct
berval
**
v
);
...
...
@@ -218,6 +286,13 @@ void slapi_register_supported_saslmechanism(char *mechanism);
char
**
slapi_get_supported_saslmechanisms
();
char
**
slapi_get_supported_extended_ops
(
void
);
/* operation */
int
slapi_op_abandoned
(
Slapi_PBlock
*
pb
);
unsigned
long
slapi_op_get_type
(
Slapi_Operation
*
op
);
void
slapi_operation_set_flag
(
Slapi_Operation
*
op
,
unsigned
long
flag
);
void
slapi_operation_clear_flag
(
Slapi_Operation
*
op
,
unsigned
long
flag
);
int
slapi_operation_is_flag_set
(
Slapi_Operation
*
op
,
unsigned
long
flag
);
char
*
slapi_op_type_to_string
(
unsigned
long
type
);
/* send ldap result back */
void
slapi_send_ldap_result
(
Slapi_PBlock
*
pb
,
int
err
,
char
*
matched
,
...
...
@@ -236,6 +311,7 @@ int slapi_filter_get_ava( Slapi_Filter *f, char **type, struct berval **bval );
Slapi_Filter
*
slapi_filter_list_first
(
Slapi_Filter
*
f
);
Slapi_Filter
*
slapi_filter_list_next
(
Slapi_Filter
*
f
,
Slapi_Filter
*
fprev
);
int
slapi_filter_get_attribute_type
(
Slapi_Filter
*
f
,
char
**
type
);
int
slapi_x_filter_set_attribute_type
(
Slapi_Filter
*
f
,
const
char
*
type
);
int
slapi_filter_get_subfilt
(
Slapi_Filter
*
f
,
char
**
type
,
char
**
initial
,
char
***
any
,
char
**
final
);
Slapi_Filter
*
slapi_filter_join
(
int
ftype
,
Slapi_Filter
*
f1
,
Slapi_Filter
*
f2
);
...
...
@@ -266,13 +342,60 @@ Slapi_PBlock *slapi_delete_internal( char * dn, LDAPControl **controls,
Slapi_PBlock
*
slapi_modrdn_internal
(
char
*
olddn
,
char
*
newrdn
,
int
deloldrdn
,
LDAPControl
**
controls
,
int
log_change
);
#if 0
Slapi_PBlock *slapi_modrdn_internal( char * olddn, char * newrdn,
char *newParent, int deloldrdn, LDAPControl **controls,
int log_change );
#endif
Slapi_PBlock
*
slapi_rename_internal
(
const
char
*
olddn
,
const
char
*
newrdn
,
const
char
*
newsuperior
,
int
delolrdn
,
LDAPControl
**
controls
,
int
log_change
);
void
slapi_free_search_results_internal
(
Slapi_PBlock
*
pb
);
/* new internal add/delete/search/modify routines */
typedef
void
(
*
plugin_result_callback
)(
int
rc
,
void
*
callback_data
);
typedef
int
(
*
plugin_referral_entry_callback
)(
char
*
referral
,
void
*
callback_data
);
typedef
int
(
*
plugin_search_entry_callback
)(
Slapi_Entry
*
e
,
void
*
callback_data
);
void
slapi_free_search_results_internal
(
Slapi_PBlock
*
pb
);
#define SLAPI_OP_FLAG_NEVER_CHAIN 0x0800
int
slapi_search_internal_pb
(
Slapi_PBlock
*
pb
);
int
slapi_search_internal_callback_pb
(
Slapi_PBlock
*
pb
,
void
*
callback_data
,
plugin_result_callback
prc
,
plugin_search_entry_callback
psec
,
plugin_referral_entry_callback
prec
);
int
slapi_add_internal_pb
(
Slapi_PBlock
*
pb
);
int
slapi_modify_internal_pb
(
Slapi_PBlock
*
pb
);
int
slapi_modrdn_internal_pb
(
Slapi_PBlock
*
pb
);
int
slapi_delete_internal_pb
(
Slapi_PBlock
*
pb
);
int
slapi_seq_internal_callback_pb
(
Slapi_PBlock
*
pb
,
void
*
callback_data
,
plugin_result_callback
res_callback
,
plugin_search_entry_callback
srch_callback
,
plugin_referral_entry_callback
ref_callback
);
void
slapi_search_internal_set_pb
(
Slapi_PBlock
*
pb
,
const
char
*
base
,
int
scope
,
const
char
*
filter
,
char
**
attrs
,
int
attrsonly
,
LDAPControl
**
controls
,
const
char
*
uniqueid
,
Slapi_ComponentId
*
plugin_identity
,
int
operation_flags
);
void
slapi_add_entry_internal_set_pb
(
Slapi_PBlock
*
pb
,
Slapi_Entry
*
e
,
LDAPControl
**
controls
,
Slapi_ComponentId
*
plugin_identity
,
int
operation_flags
);
int
slapi_add_internal_set_pb
(
Slapi_PBlock
*
pb
,
const
char
*
dn
,
LDAPMod
**
attrs
,
LDAPControl
**
controls
,
Slapi_ComponentId
*
plugin_identity
,
int
operation_flags
);
void
slapi_modify_internal_set_pb
(
Slapi_PBlock
*
pb
,
const
char
*
dn
,
LDAPMod
**
mods
,
LDAPControl
**
controls
,
const
char
*
uniqueid
,
Slapi_ComponentId
*
plugin_identity
,
int
operation_flags
);
void
slapi_rename_internal_set_pb
(
Slapi_PBlock
*
pb
,
const
char
*
olddn
,
const
char
*
newrdn
,
const
char
*
newsuperior
,
int
deloldrdn
,
LDAPControl
**
controls
,
const
char
*
uniqueid
,
Slapi_ComponentId
*
plugin_identity
,
int
operation_flags
);
void
slapi_delete_internal_set_pb
(
Slapi_PBlock
*
pb
,
const
char
*
dn
,
LDAPControl
**
controls
,
const
char
*
uniqueid
,
Slapi_ComponentId
*
plugin_identity
,
int
operation_flags
);
void
slapi_seq_internal_set_pb
(
Slapi_PBlock
*
pb
,
char
*
ibase
,
int
type
,
char
*
attrname
,
char
*
val
,
char
**
attrs
,
int
attrsonly
,
LDAPControl
**
controls
,
Slapi_ComponentId
*
plugin_identity
,
int
operation_flags
);
/* connection related routines */
int
slapi_is_connection_ssl
(
Slapi_PBlock
*
pPB
,
int
*
isSSL
);
int
slapi_get_client_port
(
Slapi_PBlock
*
pPB
,
int
*
fromPort
);
...
...
@@ -288,6 +411,12 @@ int compute_rewrite_search_filter(Slapi_PBlock *pb);
int
compute_evaluator
(
computed_attr_context
*
c
,
char
*
type
,
Slapi_Entry
*
e
,
slapi_compute_output_t
outputfn
);
int
slapi_x_compute_get_pblock
(
computed_attr_context
*
c
,
Slapi_PBlock
**
pb
);
/* backend routines */
void
slapi_be_set_readonly
(
Slapi_Backend
*
be
,
int
readonly
);
int
slapi_be_get_readonly
(
Slapi_Backend
*
be
);
const
char
*
slapi_x_be_get_updatedn
(
Slapi_Backend
*
be
);
Slapi_Backend
*
slapi_be_select
(
const
Slapi_DN
*
sdn
);
/* ACL plugins; only SLAPI_PLUGIN_ACL_ALLOW_ACCESS supported now */
typedef
int
(
*
slapi_acl_callback_t
)(
Slapi_PBlock
*
pb
,
Slapi_Entry
*
e
,
...
...
@@ -384,7 +513,8 @@ int slapi_x_backend_get_flags( const Slapi_Backend *be, unsigned long *flags );
/* operation params */
#define SLAPI_OPINITIATED_TIME 140
#define SLAPI_REQUESTOR_DN 141
#define SLAPI_REQUESTOR_ISUPDATEDN 142
#define SLAPI_IS_REPLICATED_OPERATION 142
#define SLAPI_REQUESTOR_ISUPDATEDN SLAPI_IS_REPLICATED_OPERATION
/* connection structure params*/
#define SLAPI_CONN_DN 143
...
...
@@ -397,6 +527,9 @@ int slapi_x_backend_get_flags( const Slapi_Backend *be, unsigned long *flags );
#define SLAPI_X_CONN_IS_UDP 1302
#define SLAPI_X_CONN_SSF 1303
#define SLAPI_X_CONN_SASL_CONTEXT 1304
#define SLAPI_X_OPERATION_DELETE_GLUE_PARENT 1305
#define SLAPI_X_MANAGEDIT 1306
#define SLAPI_X_OPERATION_NO_SCHEMA_CHECK 1307
/* Authentication types */
#define SLAPD_AUTH_NONE "none"
...
...
@@ -415,12 +548,17 @@ int slapi_x_backend_get_flags( const Slapi_Backend *be, unsigned long *flags );
#define SLAPI_PLUGIN_OBJECT 10
#define SLAPI_PLUGIN_DESTROY_FN 11
#define SLAPI_PLUGIN_DESCRIPTION 12
#define SLAPI_PLUGIN_IDENTITY 13
/* internal opreations params */
#define SLAPI_PLUGIN_INTOP_RESULT 15
#define SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES 16
#define SLAPI_PLUGIN_INTOP_SEARCH_REFERRALS 17
/* transaction arguments */
#define SLAPI_PARENT_TXN 190
#define SLAPI_TXN 191
/* function pointer params for backends */
#define SLAPI_PLUGIN_DB_BIND_FN 200
#define SLAPI_PLUGIN_DB_UNBIND_FN 201
...
...
@@ -456,7 +594,7 @@ int slapi_x_backend_get_flags( const Slapi_Backend *be, unsigned long *flags );
#define SLAPI_PLUGIN_EXT_OP_FN 300
#define SLAPI_PLUGIN_EXT_OP_OIDLIST 301
/*
functions for
preoperation
functions
*/
/* preoperation */
#define SLAPI_PLUGIN_PRE_BIND_FN 401
#define SLAPI_PLUGIN_PRE_UNBIND_FN 402
#define SLAPI_PLUGIN_PRE_SEARCH_FN 403
...
...
@@ -470,7 +608,19 @@ int slapi_x_backend_get_flags( const Slapi_Backend *be, unsigned long *flags );
#define SLAPI_PLUGIN_PRE_REFERRAL_FN 411
#define SLAPI_PLUGIN_PRE_RESULT_FN 412
/* functions for postoperation functions*/
/* internal preoperation */
#define SLAPI_PLUGIN_INTERNAL_PRE_ADD_FN 420
#define SLAPI_PLUGIN_INTERNAL_PRE_MODIFY_FN 421
#define SLAPI_PLUGIN_INTERNAL_PRE_MODRDN_FN 422
#define SLAPI_PLUGIN_INTERNAL_PRE_DELETE_FN 423
/* backend preoperation */
#define SLAPI_PLUGIN_BE_PRE_ADD_FN 450
#define SLAPI_PLUGIN_BE_PRE_MODIFY_FN 451
#define SLAPI_PLUGIN_BE_PRE_MODRDN_FN 452
#define SLAPI_PLUGIN_BE_PRE_DELETE_FN 453
/* postoperation */
#define SLAPI_PLUGIN_POST_BIND_FN 501
#define SLAPI_PLUGIN_POST_UNBIND_FN 502
#define SLAPI_PLUGIN_POST_SEARCH_FN 503
...
...
@@ -484,6 +634,18 @@ int slapi_x_backend_get_flags( const Slapi_Backend *be, unsigned long *flags );
#define SLAPI_PLUGIN_POST_REFERRAL_FN 511
#define SLAPI_PLUGIN_POST_RESULT_FN 512
/* internal postoperation */
#define SLAPI_PLUGIN_INTERNAL_POST_ADD_FN 520
#define SLAPI_PLUGIN_INTERNAL_POST_MODIFY_FN 521
#define SLAPI_PLUGIN_INTERNAL_POST_MODRDN_FN 522
#define SLAPI_PLUGIN_INTERNAL_POST_DELETE_FN 523
/* backend postoperation */
#define SLAPI_PLUGIN_BE_POST_ADD_FN 550
#define SLAPI_PLUGIN_BE_POST_MODIFY_FN 551
#define SLAPI_PLUGIN_BE_POST_MODRDN_FN 552
#define SLAPI_PLUGIN_BE_POST_DELETE_FN 553
#define SLAPI_OPERATION_TYPE 590
#define SLAPI_PLUGIN_MR_FILTER_CREATE_FN 600
...
...
@@ -568,16 +730,23 @@ int slapi_x_backend_get_flags( const Slapi_Backend *be, unsigned long *flags );
#define SLAPI_CONFIG_ARGV 43
/* operational params */
#define SLAPI_TARGET_ADDRESS 48
#define SLAPI_TARGET_UNIQUEID 49
#define SLAPI_TARGET_DN 50
#define SLAPI_REQCONTROLS 51
/* server LDAPv3 controls */
#define SLAPI_REQCONTROLS 51
#define SLAPI_RESCONTROLS 55
#define SLAPI_ADD_RESCONTROL 56
#define SLAPI_CONTROLS_ARG 58
/* add params */
#define SLAPI_ADD_TARGET SLAPI_TARGET_DN
#define SLAPI_ADD_ENTRY 60
#define SLAPI_ADD_EXISTING_DN_ENTRY 61
#define SLAPI_ADD_PARENT_ENTRY 62
#define SLAPI_ADD_PARENT_UNIQUEID 63
#define SLAPI_ADD_EXISTING_UNIQUEID_ENTRY 64
/* bind params */
#define SLAPI_BIND_TARGET SLAPI_TARGET_DN
...
...
@@ -593,16 +762,23 @@ int slapi_x_backend_get_flags( const Slapi_Backend *be, unsigned long *flags );
/* delete params */
#define SLAPI_DELETE_TARGET SLAPI_TARGET_DN
#define SLAPI_DELETE_EXISTING_ENTRY SLAPI_ADD_EXISTING_DN_ENTRY
/* modify params */
#define SLAPI_MODIFY_TARGET SLAPI_TARGET_DN
#define SLAPI_MODIFY_MODS 90
#define SLAPI_MODIFY_EXISTING_ENTRY SLAPI_ADD_EXISTING_DN_ENTRY
/* modrdn params */
#define SLAPI_MODRDN_TARGET SLAPI_TARGET_DN
#define SLAPI_MODRDN_NEWRDN 100
#define SLAPI_MODRDN_DELOLDRDN 101
#define SLAPI_MODRDN_NEWSUPERIOR 102
/* v3 only */
#define SLAPI_MODRDN_EXISTING_ENTRY SLAPI_ADD_EXISTING_DN_ENTRY
#define SLAPI_MODRDN_PARENT_ENTRY 104
#define SLAPI_MODRDN_NEWPARENT_ENTRY 105
#define SLAPI_MODRDN_TARGET_ENTRY 106
#define SLAPI_MODRDN_NEWSUPERIOR_ADDRESS 107
/* search params */
#define SLAPI_SEARCH_TARGET SLAPI_TARGET_DN
...
...
@@ -630,6 +806,7 @@ int slapi_x_backend_get_flags( const Slapi_Backend *be, unsigned long *flags );
#define SLAPI_FAIL_DISKFULL -2
#define SLAPI_FAIL_GENERAL -1
#define SLAPI_PLUGIN_EXTENDED_NOT_HANDLED -2
#define SLAPI_BIND_SUCCESS 0
#define SLAPI_BIND_FAIL 2
#define SLAPI_BIND_ANONYMOUS 3
...
...
libraries/liblber/memory.c
View file @
88c03960
...
...
@@ -143,8 +143,9 @@ ber_memfree_x( void *p, void *ctx )
ber_int_options
.
lbo_meminuse
-=
mh
->
bm_length
;
#ifdef LDAP_MEMORY_TRACE
fprintf
(
stderr
,
"0x%08x 0x%08x -f- %d ber_memfree %d
\n
"
,
mh
->
bm_sequence
,
mh
,
mh
->
bm_length
,
ber_int_options
.
lbo_meminuse
);
fprintf
(
stderr
,
"0x%08lx 0x%08lx -f- %ld ber_memfree %ld
\n
"
,
(
long
)
mh
->
bm_sequence
,
(
long
)
mh
,
(
long
)
mh
->
bm_length
,
ber_int_options
.
lbo_meminuse
);
#endif
/* Fill the free space with poison */
memset
(
mh
,
0xff
,
mh
->
bm_length
+
sizeof
(
struct
ber_mem_hdr
)
+
sizeof
(
ber_int_t
));
...
...
@@ -155,7 +156,7 @@ ber_memfree_x( void *p, void *ctx )
return
;
}
assert
(
ber_int_memory_fns
->
bmf_free
);
assert
(
ber_int_memory_fns
->
bmf_free
!=
0
);
(
*
ber_int_memory_fns
->
bmf_free
)(
p
,
ctx
);
}
...
...
@@ -220,8 +221,9 @@ ber_memalloc_x( ber_len_t s, void *ctx )
#ifdef LDAP_MEMORY_TRACE
mh
->
bm_sequence
=
sequence
++
;
fprintf
(
stderr
,
"0x%08x 0x%08x -a- %d ber_memalloc %d
\n
"
,
mh
->
bm_sequence
,
mh
,
mh
->
bm_length
,
ber_int_options
.
lbo_meminuse
);
fprintf
(
stderr
,
"0x%08lx 0x%08lx -a- %ld ber_memalloc %ld
\n
"
,
(
long
)
mh
->
bm_sequence
,
(
long
)
mh
,
(
long
)
mh
->
bm_length
,
ber_int_options
.
lbo_meminuse
);
#endif
/* poison new memory */
memset
(
(
char
*
)
&
mh
[
1
],
0xff
,
s
);
...
...
@@ -277,8 +279,9 @@ ber_memcalloc_x( ber_len_t n, ber_len_t s, void *ctx )
#ifdef LDAP_MEMORY_TRACE
mh
->
bm_sequence
=
sequence
++
;
fprintf
(
stderr
,
"0x%08x 0x%08x -a- %d ber_memcalloc %d
\n
"
,
mh
->
bm_sequence
,
mh
,
mh
->
bm_length
,
ber_int_options
.
lbo_meminuse
);
fprintf
(
stderr
,
"0x%08lx 0x%08lx -a- %ld ber_memcalloc %ld
\n
"
,
(
long
)
mh
->
bm_sequence
,
(
long
)
mh
,
(
long
)
mh
->
bm_length
,
ber_int_options
.
lbo_meminuse
);
#endif
BER_MEM_VALID
(
&
mh
[
1
]
);
new
=
&
mh
[
1
];
...
...
@@ -351,8 +354,9 @@ ber_memrealloc_x( void* p, ber_len_t s, void *ctx )
ber_int_options
.
lbo_meminuse
+=
s
-
oldlen
;
#ifdef LDAP_MEMORY_TRACE
fprintf
(
stderr
,
"0x%08x 0x%08x -a- %d ber_memrealloc %d
\n
"
,
mh
->
bm_sequence
,
mh
,
mh
->
bm_length
,
ber_int_options
.
lbo_meminuse
);
fprintf
(
stderr
,
"0x%08lx 0x%08lx -a- %ld ber_memrealloc %ld
\n
"
,
(
long
)
mh
->
bm_sequence
,
(
long
)
mh
,
(
long
)
mh
->
bm_length
,
ber_int_options
.
lbo_meminuse
);
#endif
BER_MEM_VALID
(
&
mh
[
1
]
);
return
&
mh
[
1
];
...
...
libraries/liblber/options.c
View file @
88c03960
...
...
@@ -25,6 +25,8 @@ char ber_pvt_opt_on; /* used to get a non-NULL address for *_OPT_ON */
struct
lber_options
ber_int_options
=
{
LBER_UNINITIALIZED
,
0
,
0
,
0
};
static
BerMemoryFunctions
ber_int_memory_fns_datum
;
int
ber_get_option
(
void
*
item
,
...
...
@@ -43,10 +45,12 @@ ber_get_option(
}
if
(
item
==
NULL
)
{
if
(
option
==
LBER_OPT_BER_DEBUG
)
{
switch
(
option
)
{
case
LBER_OPT_BER_DEBUG
:
*
(
int
*
)
outvalue
=
ber_int_debug
;
return
LBER_OPT_SUCCESS
;
}
else
if
(
option
==
LBER_OPT_MEMORY_INUSE
)
{
case
LBER_OPT_MEMORY_INUSE
:
/* The memory inuse is a global variable on kernal implementations.
* This means that memory debug is shared by all LDAP processes
* so for this variable to have much meaning, only one LDAP process
...
...
@@ -60,7 +64,8 @@ ber_get_option(
#else
return
LBER_OPT_ERROR
;
#endif
}
else
if
(
option
==
LBER_OPT_LOG_PRINT_FILE
)
{
case
LBER_OPT_LOG_PRINT_FILE
:
*
((
FILE
**
)
outvalue
)
=
(
FILE
*
)
ber_pvt_err_file
;
return
LBER_OPT_SUCCESS
;
}
...
...
@@ -124,11 +129,10 @@ ber_set_option(
if
(
(
ber_int_options
.
lbo_valid
==
LBER_UNINITIALIZED
)
&&
(
ber_int_memory_fns
==
NULL
)
&&
(
option
==
LBER_OPT_MEMORY_FNS
)
&&
(
invalue
!=
NULL
))
&&
(
invalue
!=
NULL
)
)
{
const
BerMemoryFunctions
*
f
=
(
const
BerMemoryFunctions
*
)
invalue
;
/* make sure all functions are provided */
if
(
!
(
f
->
bmf_malloc
&&
f
->
bmf_calloc
&&
f
->
bmf_realloc
&&
f
->
bmf_free
))
...
...
@@ -137,13 +141,7 @@ ber_set_option(
return
LBER_OPT_ERROR
;
}
ber_int_memory_fns
=
(
BerMemoryFunctions
*
)
(
*
(
f
->
bmf_malloc
))(
sizeof
(
BerMemoryFunctions
),
NULL
);
if
(
ber_int_memory_fns
==
NULL
)
{
ber_errno
=
LBER_ERROR_MEMORY
;
return
LBER_OPT_ERROR
;
}
ber_int_memory_fns
=
&
ber_int_memory_fns_datum
;
AC_MEMCPY
(
ber_int_memory_fns
,
f
,
sizeof
(
BerMemoryFunctions
));
...
...
@@ -160,17 +158,20 @@ ber_set_option(
}
if
(
item
==
NULL
)
{
if
(
option
==
LBER_OPT_BER_DEBUG
)
{
switch
(
option
)
{
case
LBER_OPT_BER_DEBUG
:
ber_int_debug
=
*
(
const
int
*
)
invalue
;
return
LBER_OPT_SUCCESS
;
}
else
if
(
option
==
LBER_OPT_LOG_PRINT_FN
)
{
case
LBER_OPT_LOG_PRINT_FN
:
ber_pvt_log_print
=
(
BER_LOG_PRINT_FN
)
invalue
;
return
LBER_OPT_SUCCESS
;
}
else
if
(
option
==
LBER_OPT_LOG_PRINT_FILE
)
{
case
LBER_OPT_LOG_PRINT_FILE
:
ber_pvt_err_file
=
(
void
*
)
invalue
;
return
LBER_OPT_SUCCESS
;
}
else
if
(
option
==
LBER_OPT_MEMORY_INUSE
)
{
case
LBER_OPT_MEMORY_INUSE
:
/* The memory inuse is a global variable on kernal implementations.
* This means that memory debug is shared by all LDAP processes
* so for this variable to have much meaning, only one LDAP process
...
...
@@ -184,8 +185,9 @@ ber_set_option(
#else
return
LBER_OPT_ERROR
;
#endif
}
else
if
(
option
==
LBER_OPT_LOG_PROC
)
{
case
LBER_OPT_LOG_PROC
:
ber_int_log_proc
=
(
BER_LOG_FN
)
invalue
;
return
LBER_OPT_SUCCESS
;
}
ber_errno
=
LBER_ERROR_PARAM
;
...
...
libraries/liblber/sockbuf.c
View file @
88c03960
...
...
@@ -104,13 +104,13 @@ ber_sockbuf_ctrl( Sockbuf *sb, int opt, void *arg )
case
LBER_SB_OPT_GET_FD
:
if
(
arg
!=
NULL
)
{
*
((
in
t
*
)
arg
)
=
sb
->
sb_fd
;
*
((
ber_socket_
t
*
)
arg
)
=
sb
->
sb_fd
;
}
ret
=
(
sb
->
sb_fd
==
AC_SOCKET_INVALID
?
-
1
:
1
);
break
;
case
LBER_SB_OPT_SET_FD
:
sb
->
sb_fd
=
*
((
in
t
*
)
arg
);
sb
->
sb_fd
=
*
((
ber_socket_
t
*
)
arg
);
ret
=
1
;
break
;
...
...
libraries/libldap/abandon.c
View file @
88c03960
...
...
@@ -238,6 +238,7 @@ do_abandon(
}
else
{
/* send the message */
if
(
lr
!=
NULL
)
{
assert
(
lr
->
lr_conn
!=
NULL
);
sb
=
lr
->
lr_conn
->
lconn_sb
;
}
else
{
sb
=
ld
->
ld_sb
;
...
...
libraries/libldap/cyrus.c
View file @
88c03960
...
...
@@ -207,7 +207,7 @@ sb_sasl_pkt_length( const unsigned char *buf, int debuglevel )
|
buf
[
1
]
<<
16
|
buf
[
2
]
<<
8
|
buf
[
3
];
if
(
size
>
SASL_MAX_BUFF_SIZE
)
{
/* somebody is trying to mess me up. */
ber_log_printf
(
LDAP_DEBUG_ANY
,
debuglevel
,
...
...
@@ -877,7 +877,7 @@ static struct {
{
BER_BVC
(
"minssf="
),
0
,
GOT_MINSSF
,
0
},
{
BER_BVC
(
"maxssf="
),
0
,
GOT_MAXSSF
,
INT_MAX
},
{
BER_BVC
(
"maxbufsize="
),
0
,
GOT_MAXBUF
,
65536
},
{
BER_BVNULL
,
0
,
0
}
{
BER_BVNULL
,
0
,
0
,
0
}
};
void
ldap_pvt_sasl_secprops_unparse
(
...
...
@@ -895,7 +895,7 @@ void ldap_pvt_sasl_secprops_unparse(
comma
=
0
;