#ifdef LDAP_SLAPI
if ( op->o_pb &&
- !slapi_x_access_allowed( op, e, desc, val, access, state )) {
+ !slapi_int_access_allowed( op, e, desc, val, access, state )) {
/* ACL plugin denied access */
goto done;
}
static void initAddPlugin( Operation *op,
struct berval *dn, Entry *e, int manageDSAit )
{
- slapi_x_pblock_set_operation( op->o_pb, op );
+ slapi_int_pblock_set_operation( op->o_pb, op );
slapi_pblock_set( op->o_pb, SLAPI_ADD_TARGET, (void *)dn->bv_val );
slapi_pblock_set( op->o_pb, SLAPI_ADD_ENTRY, (void *)e );
slapi_pblock_set( op->o_pb, SLAPI_MANAGEDSAIT, (void *)manageDSAit );
int i, rc = LDAP_SUCCESS;
struct monitorinfo *mi = ( struct monitorinfo * )be->be_private;
- if ( slapi_x_pblock_get_first( be, &pCurrentPB ) != LDAP_SUCCESS ) {
+ if ( slapi_int_pblock_get_first( be, &pCurrentPB ) != LDAP_SUCCESS ) {
/*
* LDAP_OTHER is returned if no plugins are installed
*/
i++;
- } while ( ( slapi_x_pblock_get_next( &pCurrentPB ) == LDAP_SUCCESS )
+ } while ( ( slapi_int_pblock_get_next( &pCurrentPB ) == LDAP_SUCCESS )
&& ( pCurrentPB != NULL ) );
done:
#if defined( LDAP_SLAPI )
if ( op->o_pb ) {
int rc;
- if ( i == 0 ) slapi_x_pblock_set_operation( op->o_pb, op );
+ if ( i == 0 ) slapi_int_pblock_set_operation( op->o_pb, op );
slapi_pblock_set( op->o_pb, SLAPI_BACKEND, (void *)&backends[i] );
rc = doPluginFNs( &backends[i], SLAPI_PLUGIN_PRE_UNBIND_FN,
(Slapi_PBlock *)op->o_pb );
* SASL bind.
*/
if ( pb ) {
- slapi_x_pblock_set_operation( pb, op );
+ slapi_int_pblock_set_operation( pb, op );
slapi_pblock_set( pb, SLAPI_BIND_TARGET, (void *)dn.bv_val );
slapi_pblock_set( pb, SLAPI_BIND_METHOD, (void *)method );
slapi_pblock_set( pb, SLAPI_BIND_CREDENTIALS, (void *)&op->orb_cred );
#if defined( LDAP_SLAPI )
if ( pb ) {
int rc;
- slapi_x_pblock_set_operation( pb, op );
+ slapi_int_pblock_set_operation( pb, op );
slapi_pblock_set( pb, SLAPI_BIND_TARGET, (void *)dn.bv_val );
slapi_pblock_set( pb, SLAPI_BIND_METHOD, (void *)method );
slapi_pblock_set( pb, SLAPI_BIND_CREDENTIALS, (void *)&op->orb_cred );
#if defined( LDAP_SLAPI )
#define pb op->o_pb
if ( pb ) {
- slapi_x_pblock_set_operation( pb, op );
+ slapi_int_pblock_set_operation( pb, op );
slapi_pblock_set( pb, SLAPI_COMPARE_TARGET, (void *)dn.bv_val );
slapi_pblock_set( pb, SLAPI_MANAGEDSAIT, (void *)manageDSAit );
slapi_pblock_set( pb, SLAPI_COMPARE_TYPE, (void *)desc.bv_val );
ldap_pvt_thread_cond_destroy( &connections[i].c_write_cv );
#ifdef LDAP_SLAPI
if ( slapi_plugins_used ) {
- slapi_x_free_object_extensions( SLAPI_X_EXT_CONNECTION, &connections[i] );
+ slapi_int_free_object_extensions( SLAPI_X_EXT_CONNECTION, &connections[i] );
}
#endif
}
#ifdef LDAP_SLAPI
if ( slapi_plugins_used ) {
- slapi_x_create_object_extensions( SLAPI_X_EXT_CONNECTION, c );
+ slapi_int_create_object_extensions( SLAPI_X_EXT_CONNECTION, c );
}
#endif
#ifdef LDAP_SLAPI
/* call destructors, then constructors; avoids unnecessary allocation */
if ( slapi_plugins_used ) {
- slapi_x_clear_object_extensions( SLAPI_X_EXT_CONNECTION, c );
+ slapi_int_clear_object_extensions( SLAPI_X_EXT_CONNECTION, c );
}
#endif
}
#if defined( LDAP_SLAPI )
#define pb op->o_pb
if ( pb ) {
- slapi_x_pblock_set_operation( pb, op );
+ slapi_int_pblock_set_operation( pb, op );
slapi_pblock_set( pb, SLAPI_DELETE_TARGET, (void *)dn.bv_val );
slapi_pblock_set( pb, SLAPI_MANAGEDSAIT, (void *)manageDSAit );
goto done;
}
- rs->sr_err = slapi_x_pblock_set_operation( pb, op );
+ rs->sr_err = slapi_int_pblock_set_operation( pb, op );
if ( rs->sr_err != LDAP_SUCCESS ) {
rs->sr_err = LDAP_OTHER;
goto done;
#if defined( LDAP_SLAPI )
#define pb op->o_pb
if ( pb ) {
- slapi_x_pblock_set_operation( pb, op );
+ slapi_int_pblock_set_operation( pb, op );
slapi_pblock_set( pb, SLAPI_MODIFY_TARGET, (void *)dn.bv_val );
slapi_pblock_set( pb, SLAPI_MANAGEDSAIT, (void *)manageDSAit );
- modv = slapi_x_modifications2ldapmods( &modlist );
+ modv = slapi_int_modifications2ldapmods( &modlist );
slapi_pblock_set( pb, SLAPI_MODIFY_MODS, (void *)modv );
rs->sr_err = doPluginFNs( op->o_bd, SLAPI_PLUGIN_PRE_MODIFY_FN, pb );
rs->sr_err == LDAP_SUCCESS ) {
rs->sr_err = LDAP_OTHER;
}
- slapi_x_free_ldapmods( modv );
+ slapi_int_free_ldapmods( modv );
modv = NULL;
goto cleanup;
}
* modification array, so we need to convert it back to
* a Modification list.
*
- * Calling slapi_x_modifications2ldapmods() destroyed modlist so
+ * Calling slapi_int_modifications2ldapmods() destroyed modlist so
* we don't need to free it.
*/
slapi_pblock_get( pb, SLAPI_MODIFY_MODS, (void **)&modv );
- modlist = slapi_x_ldapmods2modifications( modv );
+ modlist = slapi_int_ldapmods2modifications( modv );
}
/*
* (for example, a plugin might store some attributes elsewhere
* and remove them from the modification list; if only those
* attribute types were included in the modification request,
- * then slapi_x_ldapmods2modifications() above will return
+ * then slapi_int_ldapmods2modifications() above will return
* NULL).
*
* However, the post-operation plugin should still be
op->o_tmpfree( op->o_req_ndn.bv_val, op->o_tmpmemctx );
if ( modlist != NULL ) slap_mods_free( modlist );
#if defined( LDAP_SLAPI )
- if ( modv != NULL ) slapi_x_free_ldapmods( modv );
+ if ( modv != NULL ) slapi_int_free_ldapmods( modv );
#endif
return rs->sr_err;
}
#if defined( LDAP_SLAPI )
#define pb op->o_pb
if ( pb ) {
- slapi_x_pblock_set_operation( pb, op );
+ slapi_int_pblock_set_operation( pb, op );
slapi_pblock_set( pb, SLAPI_MODRDN_TARGET, (void *)dn.bv_val );
slapi_pblock_set( pb, SLAPI_MODRDN_NEWRDN, (void *)newrdn.bv_val );
slapi_pblock_set( pb, SLAPI_MODRDN_NEWSUPERIOR,
#if defined( LDAP_SLAPI )
if ( op->o_pb != NULL ) {
slapi_pblock_destroy( (Slapi_PBlock *)op->o_pb );
- slapi_x_free_object_extensions( SLAPI_X_EXT_OPERATION, op );
+ slapi_int_free_object_extensions( SLAPI_X_EXT_OPERATION, op );
}
#endif /* defined( LDAP_SLAPI ) */
#if defined( LDAP_SLAPI )
if ( slapi_plugins_used ) {
op->o_pb = slapi_pblock_new();
- slapi_x_create_object_extensions( SLAPI_X_EXT_OPERATION, op );
+ slapi_int_create_object_extensions( SLAPI_X_EXT_OPERATION, op );
}
#endif /* defined( LDAP_SLAPI ) */
* result if they wish to change the result.
*/
if ( op->o_pb ) {
- slapi_x_pblock_set_operation( op->o_pb, op );
+ slapi_int_pblock_set_operation( op->o_pb, op );
slapi_pblock_set( op->o_pb, SLAPI_RESULT_CODE, (void *)rs->sr_err );
slapi_pblock_set( op->o_pb, SLAPI_RESULT_TEXT, (void *)rs->sr_text );
slapi_pblock_set( op->o_pb, SLAPI_RESULT_MATCHED, (void *)rs->sr_matched );
if ( rs->sr_attrs != NULL ) {
for ( anp = rs->sr_attrs; anp->an_name.bv_val != NULL; anp++ ) {
rc = compute_evaluator( &ctx, anp->an_name.bv_val,
- rs->sr_entry, slapi_x_compute_output_ber );
+ rs->sr_entry, slapi_int_compute_output_ber );
if ( rc == 1 ) {
break;
}
* plugin decide whether to be naughty or not.
*/
rc = compute_evaluator( &ctx, "*",
- rs->sr_entry, slapi_x_compute_output_ber );
+ rs->sr_entry, slapi_int_compute_output_ber );
}
if ( rc == 1 ) {
if ( op->o_res_ber == NULL ) ber_free_buf( ber );
static void initSearchPlugin( Operation *op,
char **attrs, int managedsait )
{
- slapi_x_pblock_set_operation( op->o_pb, op );
+ slapi_int_pblock_set_operation( op->o_pb, op );
slapi_pblock_set( op->o_pb, SLAPI_SEARCH_TARGET, (void *)op->o_req_dn.bv_val );
slapi_pblock_set( op->o_pb, SLAPI_SEARCH_SCOPE, (void *)op->ors_scope );
slapi_pblock_set( op->o_pb, SLAPI_SEARCH_DEREF, (void *)op->ors_deref );
return -1;
}
- if ( slapi_x_init_object_extensions() != 0 ) {
+ if ( slapi_int_init_object_extensions() != 0 ) {
return -1;
}
extern int slapi_audit_send_record( Slapi_PBlock *pb, Connection *conn,
Operation *op, int rc);
-extern int slapi_x_pblock_set_operation( Slapi_PBlock *pb, Operation *op );
+extern int slapi_int_pblock_set_operation( Slapi_PBlock *pb, Operation *op );
-extern LDAPMod **slapi_x_modifications2ldapmods(Modifications **);
-extern Modifications *slapi_x_ldapmods2modifications(LDAPMod **);
-extern void slapi_x_free_ldapmods(LDAPMod **);
+extern LDAPMod **slapi_int_modifications2ldapmods(Modifications **);
+extern Modifications *slapi_int_ldapmods2modifications(LDAPMod **);
+extern void slapi_int_free_ldapmods(LDAPMod **);
extern int slapi_compute_add_evaluator(slapi_compute_callback_t function);
extern int slapi_compute_add_search_rewriter(slapi_search_rewrite_callback_t function);
extern int compute_rewrite_search_filter(Slapi_PBlock *pb);
extern int compute_evaluator(computed_attr_context *c, char *type, Slapi_Entry *e, slapi_compute_output_t outputfn);
-extern int slapi_x_compute_output_ber(computed_attr_context *c, Slapi_Attr *a, Slapi_Entry *e);
+extern int slapi_int_compute_output_ber(computed_attr_context *c, Slapi_Attr *a, Slapi_Entry *e);
extern int slapi_x_compute_get_pblock(computed_attr_context *c, Slapi_PBlock **pb);
-extern int slapi_x_access_allowed(Operation *op, Entry *entry, AttributeDescription *desc, struct berval *val, slap_access_t access, AccessControlState *state);
+extern int slapi_int_access_allowed(Operation *op, Entry *entry, AttributeDescription *desc, struct berval *val, slap_access_t access, AccessControlState *state);
extern ldap_pvt_thread_mutex_t slapi_hn_mutex;
extern ldap_pvt_thread_mutex_t slapi_time_mutex;
/*
* OpenLDAP extensions
*/
-extern int slapi_x_pblock_get_first( Backend *be, Slapi_PBlock **pb );
-extern int slapi_x_pblock_get_next( Slapi_PBlock **pb );
+extern int slapi_int_pblock_get_first( Backend *be, Slapi_PBlock **pb );
+extern int slapi_int_pblock_get_next( Slapi_PBlock **pb );
/*
char *suffix, char *chNum, Operation* op);
extern Backend * slapi_cl_get_be(char *dn);
-int slapi_x_init_object_extensions(void);
-int slapi_x_free_object_extensions(int objecttype, void *object);
-int slapi_x_create_object_extensions(int objecttype, void *object);
-int slapi_x_clear_object_extensions(int objecttype, void *object);
+int slapi_int_init_object_extensions(void);
+int slapi_int_free_object_extensions(int objecttype, void *object);
+int slapi_int_create_object_extensions(int objecttype, void *object);
+int slapi_int_clear_object_extensions(int objecttype, void *object);
LDAP_END_DECL
#endif /* LDAP_SLAPI */
}
-int slapi_x_create_object_extensions(int objecttype, void *object)
+int slapi_int_create_object_extensions(int objecttype, void *object)
{
#ifdef LDAP_SLAPI
int i, rc;
#endif
}
-int slapi_x_free_object_extensions(int objecttype, void *object)
+int slapi_int_free_object_extensions(int objecttype, void *object)
{
#ifdef LDAP_SLAPI
int i, rc;
}
/* for reusable object types */
-int slapi_x_clear_object_extensions(int objecttype, void *object)
+int slapi_int_clear_object_extensions(int objecttype, void *object)
{
#ifdef LDAP_SLAPI
int i, rc;
#endif
}
-int slapi_x_init_object_extensions(void)
+int slapi_int_init_object_extensions(void)
{
#ifdef LDAP_SLAPI
memset( ®istered_extensions, 0, sizeof( registered_extensions ) );
* OpenLDAP extension
*/
int
-slapi_x_pblock_get_first( Backend *be, Slapi_PBlock **pb )
+slapi_int_pblock_get_first( Backend *be, Slapi_PBlock **pb )
{
#if defined(LDAP_SLAPI)
assert( pb );
* OpenLDAP extension
*/
int
-slapi_x_pblock_get_next( Slapi_PBlock **pb )
+slapi_int_pblock_get_next( Slapi_PBlock **pb )
{
#if defined(LDAP_SLAPI)
assert( pb );
/*
* Internal API to prime a Slapi_PBlock with an Operation.
*/
-int slapi_x_pblock_set_operation( Slapi_PBlock *pb, Operation *op )
+int slapi_int_pblock_set_operation( Slapi_PBlock *pb, Operation *op )
{
#ifdef LDAP_SLAPI
int isRoot = 0;
return LDAP_PARAM_ERROR;
}
- ml = slapi_x_ldapmods2modifications( mods );
+ ml = slapi_int_ldapmods2modifications( mods );
if ( ml == NULL ) {
return LDAP_OTHER;
}
*
* This function must also be called before slap_mods_check().
*/
-LDAPMod **slapi_x_modifications2ldapmods(Modifications **pmodlist)
+LDAPMod **slapi_int_modifications2ldapmods(Modifications **pmodlist)
{
#ifdef LDAP_SLAPI
Modifications *ml, *modlist;
*
* The returned Modification list contains pointers into the
* LDAPMods array; the latter MUST be freed with
- * slapi_x_free_ldapmods() (see below).
+ * slapi_int_free_ldapmods() (see below).
*/
-Modifications *slapi_x_ldapmods2modifications (LDAPMod **mods)
+Modifications *slapi_int_ldapmods2modifications (LDAPMod **mods)
{
#ifdef LDAP_SLAPI
Modifications *modlist = NULL, **modtail;
/*
* This function only frees the parts of the mods array that
* are not shared with the Modification list that was created
- * by slapi_x_ldapmods2modifications().
+ * by slapi_int_ldapmods2modifications().
*
*/
-void slapi_x_free_ldapmods (LDAPMod **mods)
+void slapi_int_free_ldapmods (LDAPMod **mods)
{
#ifdef LDAP_SLAPI
int i, j;
* op->o_callback->sc_sendentry, if you wish to make computed
* attributes available to it.
*/
-int slapi_x_compute_output_ber(computed_attr_context *c, Slapi_Attr *a, Slapi_Entry *e)
+int slapi_int_compute_output_ber(computed_attr_context *c, Slapi_Attr *a, Slapi_Entry *e)
{
#ifdef LDAP_SLAPI
Operation *op = NULL;
}
if ( !access_allowed( op, e, desc, NULL, ACL_READ, &c->cac_acl_state) ) {
- slapi_log_error( SLAPI_LOG_ACL, "slapi_x_compute_output_ber",
+ slapi_log_error( SLAPI_LOG_ACL, "slapi_int_compute_output_ber",
"acl: access to attribute %s not allowed\n",
desc->ad_cname.bv_val );
return 0;
rc = ber_printf( ber, "{O[" /*]}*/ , &desc->ad_cname );
if (rc == -1 ) {
- slapi_log_error( SLAPI_LOG_BER, "slapi_x_compute_output_ber",
+ slapi_log_error( SLAPI_LOG_BER, "slapi_int_compute_output_ber",
"ber_printf failed\n");
return 1;
}
for ( i = 0; a->a_vals[i].bv_val != NULL; i++ ) {
if ( !access_allowed( op, e,
desc, &a->a_vals[i], ACL_READ, &c->cac_acl_state)) {
- slapi_log_error( SLAPI_LOG_ACL, "slapi_x_compute_output_ber",
+ slapi_log_error( SLAPI_LOG_ACL, "slapi_int_compute_output_ber",
"conn %lu "
"acl: access to %s, value %d not allowed\n",
op->o_connid, desc->ad_cname.bv_val, i );
}
if (( rc = ber_printf( ber, "O", &a->a_vals[i] )) == -1 ) {
- slapi_log_error( SLAPI_LOG_BER, "slapi_x_compute_output_ber",
+ slapi_log_error( SLAPI_LOG_BER, "slapi_int_compute_output_ber",
"ber_printf failed\n");
return 1;
}
}
if (( rc = ber_printf( ber, /*{[*/ "]N}" )) == -1 ) {
- slapi_log_error( SLAPI_LOG_BER, "slapi_x_compute_output_ber",
+ slapi_log_error( SLAPI_LOG_BER, "slapi_int_compute_output_ber",
"ber_printf failed\n" );
return 1;
}
#endif
}
-int slapi_x_access_allowed( Operation *op,
+int slapi_int_access_allowed( Operation *op,
Entry *entry,
AttributeDescription *desc,
struct berval *val,
return 1;
}
- slapi_x_pblock_set_operation( op->o_pb, op );
+ slapi_int_pblock_set_operation( op->o_pb, op );
rc = 1; /* default allow policy */