本文整理汇总了C++中slapi_pblock_set函数的典型用法代码示例。如果您正苦于以下问题:C++ slapi_pblock_set函数的具体用法?C++ slapi_pblock_set怎么用?C++ slapi_pblock_set使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了slapi_pblock_set函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: oath_preop_init
int oath_preop_init(Slapi_PBlock *pb) {
int rc;
slapi_pblock_get(pb, SLAPI_PLUGIN_IDENTITY, &oath_preop_plugin_id);
if (slapi_pblock_get(pb, SLAPI_PLUGIN_ARGC, (void *) &argc) != 0 ||
slapi_pblock_get(pb, SLAPI_PLUGIN_ARGV, (void *) &argv)) {
slapi_log_error(SLAPI_LOG_PLUGIN, "oath", "oath_preop_init: Failed to obtain plugin args, not registering plugin\n");
return -1;
}
if (argc < 1) {
slapi_log_error(SLAPI_LOG_PLUGIN, "oath", "oath_preop_init: No configuration given, not registering plugin\n");
return -1;
}
if (slapi_pblock_set(pb, SLAPI_PLUGIN_VERSION, SLAPI_PLUGIN_VERSION_03) != 0 ||
slapi_pblock_set(pb, SLAPI_PLUGIN_DESCRIPTION, (void *) &oath_preop_plugin_desc) != 0 ||
slapi_pblock_set(pb, SLAPI_PLUGIN_PRE_BIND_FN, (void *) oath_preop_bind) != 0 ||
slapi_pblock_set(pb, SLAPI_PLUGIN_START_FN, (void *) oath_preop_start) != 0 ||
slapi_pblock_set(pb, SLAPI_PLUGIN_CLOSE_FN, (void *) oath_preop_close) != 0) {
slapi_log_error(SLAPI_LOG_PLUGIN, "oath",
"oath_preop_init: Error registering plugin\n");
return -1;
}
slapi_log_error(SLAPI_LOG_PLUGIN, "oath", "oath_preop_init: Plugin successfully registered\n");
return 0;
}
开发者ID:cargosoft,项目名称:oath-slapi,代码行数:32,代码来源:oath.c
示例2: mr_wrap_mr_index_sv_fn
/* this function takes SLAPI_PLUGIN_MR_VALUES as Slapi_Value ** and
returns SLAPI_PLUGIN_MR_KEYS as Slapi_Value **
*/
static int
mr_wrap_mr_index_sv_fn(Slapi_PBlock* pb)
{
int rc = -1;
Slapi_Value **in_vals = NULL;
Slapi_Value **out_vals = NULL;
struct slapdplugin *pi = NULL;
slapi_pblock_set(pb, SLAPI_PLUGIN_MR_KEYS, out_vals); /* make sure output is cleared */
slapi_pblock_get(pb, SLAPI_PLUGIN, &pi);
if (!pi) {
slapi_log_err(SLAPI_LOG_ERR, "mr_wrap_mr_index_sv_fn", "No plugin specified\n");
} else if (!pi->plg_mr_values2keys) {
slapi_log_err(SLAPI_LOG_ERR, "mr_wrap_mr_index_sv_fn", "Plugin has no plg_mr_values2keys function\n");
} else {
struct mr_private *mrpriv = NULL;
int ftype = plugin_mr_get_type(pi);
slapi_pblock_get(pb, SLAPI_PLUGIN_MR_VALUES, &in_vals);
(*pi->plg_mr_values2keys)(pb, in_vals, &out_vals, ftype);
slapi_pblock_set(pb, SLAPI_PLUGIN_MR_KEYS, out_vals);
/* we have to save out_vals to free next time or during destroy */
slapi_pblock_get(pb, SLAPI_PLUGIN_OBJECT, &mrpriv);
/* In case SLAPI_PLUGIN_OBJECT is not set
* (e.g. custom index/filter create function did not initialize it
*/
if (mrpriv) {
mr_private_indexer_done(mrpriv); /* free old vals, if any */
mrpriv->sva = out_vals; /* save pointer for later */
}
rc = 0;
}
return rc;
}
开发者ID:Firstyear,项目名称:ds,代码行数:37,代码来源:plugin_mr.c
示例3: acct_postop_init
int
acct_postop_init( Slapi_PBlock *pb )
{
void *plugin_id = get_identity();
if ( slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION,
SLAPI_PLUGIN_VERSION_01 ) != 0 ||
slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION,
(void *)&post_plugin_desc ) != 0 ) {
slapi_log_err(SLAPI_LOG_ERR, POST_PLUGIN_NAME,
"acct_postop_init - Failed to set plugin version or name\n" );
return( CALLBACK_ERR );
}
if ( slapi_pblock_set( pb, SLAPI_PLUGIN_POST_BIND_FN, (void *)acct_bind_postop ) != 0 ||
slapi_pblock_set(pb, SLAPI_PLUGIN_POST_ADD_FN, (void *) acct_post_op) != 0 ||
slapi_pblock_set(pb, SLAPI_PLUGIN_POST_MODIFY_FN, (void *) acct_post_op) != 0)
{
slapi_log_err(SLAPI_LOG_ERR, POST_PLUGIN_NAME,
"acct_postop_init - Failed to set plugin callback function\n" );
return( CALLBACK_ERR );
}
if( slapi_pblock_get( pb, SLAPI_PLUGIN_IDENTITY, &plugin_id ) != 0 ) {
slapi_log_err(SLAPI_LOG_ERR, POST_PLUGIN_NAME,
"acct_postop_init - Failed to get plugin identity\n" );
return( CALLBACK_ERR );
}
return( CALLBACK_OK );
}
开发者ID:Firstyear,项目名称:ds,代码行数:32,代码来源:acct_init.c
示例4: usn_bepostop_init
static int
usn_bepostop_init(Slapi_PBlock *pb)
{
int rc = 0;
Slapi_Entry *plugin_entry = NULL;
char *plugin_type = NULL;
int postadd = SLAPI_PLUGIN_BE_POST_ADD_FN;
int postmod = SLAPI_PLUGIN_BE_POST_MODIFY_FN;
int postmdn = SLAPI_PLUGIN_BE_POST_MODRDN_FN;
int postdel = SLAPI_PLUGIN_BE_POST_DELETE_FN;
if ((slapi_pblock_get(pb, SLAPI_PLUGIN_CONFIG_ENTRY, &plugin_entry) == 0) &&
plugin_entry &&
(plugin_type = slapi_entry_attr_get_charptr(plugin_entry,
"nsslapd-plugintype")) &&
plugin_type && strstr(plugin_type, "betxn")) {
postadd = SLAPI_PLUGIN_BE_TXN_POST_ADD_FN;
postmod = SLAPI_PLUGIN_BE_TXN_POST_MODIFY_FN;
postmdn = SLAPI_PLUGIN_BE_TXN_POST_MODRDN_FN;
postdel = SLAPI_PLUGIN_BE_TXN_POST_DELETE_FN;
}
slapi_ch_free_string(&plugin_type);
if ((slapi_pblock_set(pb, postadd, (void *)usn_bepostop) != 0) ||
(slapi_pblock_set(pb, postdel, (void *)usn_bepostop_delete) != 0) ||
(slapi_pblock_set(pb, postmod, (void *)usn_bepostop_modify) != 0) ||
(slapi_pblock_set(pb, postmdn, (void *)usn_bepostop) != 0)) {
slapi_log_error(SLAPI_LOG_FATAL, USN_PLUGIN_SUBSYSTEM,
"usn_bepostop_init: failed to register bepostop plugin\n");
rc = -1;
}
return rc;
}
开发者ID:leto,项目名称:389-ds,代码行数:34,代码来源:usn.c
示例5: sidgen_task_init
int sidgen_task_init(Slapi_PBlock *pb)
{
int ret = 0;
ret = slapi_pblock_get(pb, SLAPI_PLUGIN_IDENTITY,
&global_sidgen_plugin_id);
if (ret != 0 || global_sidgen_plugin_id == NULL) {
LOG_FATAL("Plugin identity not available.\n");
ret = (ret != 0) ? ret : EINVAL;
goto done;
}
ret = slapi_pblock_set(pb, SLAPI_PLUGIN_VERSION,
(void *) SLAPI_PLUGIN_VERSION_03);
ret |= slapi_pblock_set(pb, SLAPI_PLUGIN_START_FN,
(void *) sigden_task_start);
done:
if (ret != 0) {
LOG_FATAL("Failed to initialize plug-in\n" );
}
return ret;
}
开发者ID:jtux270,项目名称:translate,代码行数:25,代码来源:ipa_sidgen_task.c
示例6: be_unbindall
void
be_unbindall(Connection *conn, Operation *op)
{
int i;
Slapi_PBlock pb = {0};
for ( i = 0; i < maxbackends; i++ )
{
if ( backends[i] && (backends[i]->be_unbind != NULL) )
{
/* This is the modern, and faster way to do pb memset(0)
* It also doesn't trigger the HORRIBLE stack overflows I found ...
*/
pblock_init_common( &pb, backends[i], conn, op );
if ( plugin_call_plugins( &pb, SLAPI_PLUGIN_PRE_UNBIND_FN ) == 0 )
{
int rc = 0;
slapi_pblock_set( &pb, SLAPI_PLUGIN, backends[i]->be_database );
if(backends[i]->be_state != BE_STATE_DELETED &&
backends[i]->be_unbind!=NULL)
{
rc = (*backends[i]->be_unbind)( &pb );
}
slapi_pblock_set( &pb, SLAPI_PLUGIN_OPRETURN, &rc );
(void) plugin_call_plugins( &pb, SLAPI_PLUGIN_POST_UNBIND_FN );
}
}
}
}
开发者ID:Firstyear,项目名称:ds,代码行数:30,代码来源:backend_manager.c
示例7: slapi_delete_internal_set_pb
/* Initialize a pblock for a call to slapi_delete_internal_pb() */
void
slapi_delete_internal_set_pb (Slapi_PBlock *pb,
const char *rawdn,
LDAPControl **controls, const char *uniqueid,
Slapi_ComponentId *plugin_identity,
int operation_flags)
{
Operation *op;
PR_ASSERT (pb != NULL);
if (pb == NULL || rawdn == NULL)
{
slapi_log_error(SLAPI_LOG_FATAL, NULL,
"slapi_delete_internal_set_pb: NULL parameter\n");
return;
}
op = internal_operation_new(SLAPI_OPERATION_DELETE,operation_flags);
slapi_pblock_set(pb, SLAPI_OPERATION, op);
slapi_pblock_set(pb, SLAPI_ORIGINAL_TARGET, (void*)rawdn);
slapi_pblock_set(pb, SLAPI_CONTROLS_ARG, controls);
if (uniqueid)
{
slapi_pblock_set(pb, SLAPI_TARGET_UNIQUEID, (void*)uniqueid);
}
slapi_pblock_set(pb, SLAPI_PLUGIN_IDENTITY, plugin_identity);
}
开发者ID:leto,项目名称:389-ds,代码行数:27,代码来源:delete.c
示例8: passthruauth_init
/*
* Plugin initialization function (which must be listed in the appropriate
* slapd config file).
*/
int
passthruauth_init( Slapi_PBlock *pb )
{
PASSTHRU_ASSERT( pb != NULL );
slapi_log_error( SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM,
"=> passthruauth_init\n" );
if ( slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION,
(void *)SLAPI_PLUGIN_VERSION_01 ) != 0
|| slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION,
(void *)&pdesc ) != 0
|| slapi_pblock_set( pb, SLAPI_PLUGIN_START_FN,
(void *)passthru_bindpreop_start ) != 0
|| slapi_pblock_set( pb, SLAPI_PLUGIN_PRE_BIND_FN,
(void *)passthru_bindpreop ) != 0
|| slapi_pblock_set( pb, SLAPI_PLUGIN_CLOSE_FN,
(void *)passthru_bindpreop_close ) != 0 ) {
slapi_log_error( SLAPI_LOG_FATAL, PASSTHRU_PLUGIN_SUBSYSTEM,
"passthruauth_init failed\n" );
return( -1 );
}
slapi_log_error( SLAPI_LOG_PLUGIN, PASSTHRU_PLUGIN_SUBSYSTEM,
"<= passthruauth_init succeeded\n" );
return( 0 );
}
开发者ID:leto,项目名称:389-ds,代码行数:32,代码来源:ptpreop.c
示例9: bitwise_filter_create
static int
bitwise_filter_create (Slapi_PBlock* pb)
{
auto int rc = LDAP_UNAVAILABLE_CRITICAL_EXTENSION; /* failed to initialize */
auto char* mrOID = NULL;
auto char* mrTYPE = NULL;
auto struct berval* mrVALUE = NULL;
if (!slapi_pblock_get (pb, SLAPI_PLUGIN_MR_OID, &mrOID) && mrOID != NULL &&
!slapi_pblock_get (pb, SLAPI_PLUGIN_MR_TYPE, &mrTYPE) && mrTYPE != NULL &&
!slapi_pblock_get (pb, SLAPI_PLUGIN_MR_VALUE, &mrVALUE) && mrVALUE != NULL) {
struct bitwise_match_cb *bmc = NULL;
if (strcmp(mrOID, "1.2.840.113556.1.4.803") == 0) {
slapi_pblock_set (pb, SLAPI_PLUGIN_MR_FILTER_MATCH_FN, (void*)bitwise_filter_match_and);
} else if (strcmp(mrOID, "1.2.840.113556.1.4.804") == 0) {
slapi_pblock_set (pb, SLAPI_PLUGIN_MR_FILTER_MATCH_FN, (void*)bitwise_filter_match_or);
} else { /* this oid not handled by this plugin */
LDAPDebug (LDAP_DEBUG_FILTER, "=> bitwise_filter_create OID (%s) not handled\n", mrOID, 0, 0);
return rc;
}
bmc = new_bitwise_match_cb(mrTYPE, mrVALUE);
slapi_pblock_set (pb, SLAPI_PLUGIN_OBJECT, bmc);
slapi_pblock_set (pb, SLAPI_PLUGIN_DESTROY_FN, (void*)bitwise_filter_destroy);
rc = LDAP_SUCCESS;
} else {
LDAPDebug (LDAP_DEBUG_FILTER, "=> bitwise_filter_create missing parameter(s)\n", 0, 0, 0);
}
LDAPDebug (LDAP_DEBUG_FILTER, "<= bitwise_filter_create %i\n", rc, 0, 0);
return LDAP_SUCCESS;
}
开发者ID:leto,项目名称:389-ds,代码行数:31,代码来源:bitwise.c
示例10: ipa_topo_pre_add
int ipa_topo_pre_add(Slapi_PBlock *pb)
{
int result = SLAPI_PLUGIN_SUCCESS;
char *errtxt = NULL;
slapi_log_error(SLAPI_LOG_PLUGIN, IPA_TOPO_PLUGIN_SUBSYSTEM,
"--> ipa_topo_pre_add\n");
if (0 == ipa_topo_get_plugin_active()) {
slapi_log_error(SLAPI_LOG_PLUGIN, IPA_TOPO_PLUGIN_SUBSYSTEM,
"<-- ipa_topo_pre_add - plugin not active\n");
return 0;
}
if (ipa_topo_pre_ignore_op(pb)) return result;
if (ipa_topo_is_entry_managed(pb)) {
int rc = LDAP_UNWILLING_TO_PERFORM;
errtxt = slapi_ch_smprintf("Entry is managed by topology plugin."
" Adding of entry not allowed.\n");
slapi_pblock_set(pb, SLAPI_PB_RESULT_TEXT, errtxt);
slapi_pblock_set(pb, SLAPI_RESULT_CODE, &rc);
result = SLAPI_PLUGIN_FAILURE;
} else if (ipa_topo_check_segment_is_valid(pb, &errtxt)) {
int rc = LDAP_UNWILLING_TO_PERFORM;
slapi_pblock_set(pb, SLAPI_PB_RESULT_TEXT, errtxt);
slapi_pblock_set(pb, SLAPI_RESULT_CODE, &rc);
result = SLAPI_PLUGIN_FAILURE;
}
slapi_log_error(SLAPI_LOG_PLUGIN, IPA_TOPO_PLUGIN_SUBSYSTEM,
"<-- ipa_topo_pre_add\n");
return result;
}
开发者ID:LiptonB,项目名称:freeipa,代码行数:33,代码来源:topology_pre.c
示例11: replication_legacy_plugin_init
/* Initialize the legacy replication plugin */
int
replication_legacy_plugin_init(Slapi_PBlock *pb)
{
static int legacy_initialised= 0;
int rc= 0; /* OK */
void *identity = NULL;
slapi_pblock_get (pb, SLAPI_PLUGIN_IDENTITY, &identity);
PR_ASSERT (identity);
repl_set_plugin_identity (PLUGIN_LEGACY_REPLICATION, identity);
if(rc==0 && !legacy_initialised)
{
rc= slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, SLAPI_PLUGIN_VERSION_01 );
rc= slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&legacydesc );
rc= slapi_pblock_set( pb, SLAPI_PLUGIN_START_FN, (void *) legacy_start );
rc= slapi_pblock_set( pb, SLAPI_PLUGIN_CLOSE_FN, (void *) legacy_stop );
rc= slapi_pblock_set( pb, SLAPI_PLUGIN_POSTSTART_FN, (void *) legacy_poststart );
/* Register the plugin interfaces we implement */
rc= slapi_register_plugin("preoperation", 1 /* Enabled */, "legacy_preop_init", legacy_preop_init, "Legacy replication preoperation plugin", NULL, identity);
rc= slapi_register_plugin("postoperation", 1 /* Enabled */, "legacy_postop_init", legacy_postop_init, "Legacy replication postoperation plugin", NULL, identity);
rc= slapi_register_plugin("internalpreoperation", 1 /* Enabled */, "legacy_internalpreop_init", legacy_internalpreop_init, "Legacy replication internal preoperation plugin", NULL, identity);
rc= slapi_register_plugin("internalpostoperation", 1 /* Enabled */, "legacy_internalpostop_init", legacy_internalpostop_init, "Legacy replication internal postoperation plugin", NULL, identity);
rc= slapi_register_plugin("entry", 1 /* Enabled */, "legacy_entry_init", legacy_entry_init, "Legacy replication entry plugin", NULL, identity);
legacy_initialised= 1;
}
return rc;
}
开发者ID:Firstyear,项目名称:ds,代码行数:31,代码来源:repl_init.c
示例12: ipa_topo_pre_modrdn
int
ipa_topo_pre_modrdn(Slapi_PBlock *pb)
{
int result = SLAPI_PLUGIN_SUCCESS;
slapi_log_error(SLAPI_LOG_PLUGIN, IPA_TOPO_PLUGIN_SUBSYSTEM,
"--> ipa_topo_pre_modrdn\n");
if (0 == ipa_topo_get_plugin_active()) {
slapi_log_error(SLAPI_LOG_PLUGIN, IPA_TOPO_PLUGIN_SUBSYSTEM,
"<-- ipa_topo_pre_modrdn - plugin not active\n");
return 0;
}
if (ipa_topo_pre_ignore_op(pb)) return result;
if (ipa_topo_check_entry_move(pb)){
int rc = LDAP_UNWILLING_TO_PERFORM;
char *errtxt;
errtxt = slapi_ch_smprintf("Moving of a segment or config entry "
"to another subtree is not allowed.\n");
slapi_pblock_set(pb, SLAPI_PB_RESULT_TEXT, errtxt);
slapi_pblock_set(pb, SLAPI_RESULT_CODE, &rc);
result = SLAPI_PLUGIN_FAILURE;
}
return result;
}
开发者ID:LiptonB,项目名称:freeipa,代码行数:30,代码来源:topology_pre.c
示例13: rename_internal_pb
static int rename_internal_pb (Slapi_PBlock *pb)
{
LDAPControl **controls;
Operation *op;
int opresult = 0;
PR_ASSERT (pb != NULL);
slapi_pblock_get(pb, SLAPI_CONTROLS_ARG, &controls);
slapi_pblock_get(pb, SLAPI_OPERATION, &op);
op->o_handler_data = &opresult;
op->o_result_handler = internal_getresult_callback;
slapi_pblock_set(pb, SLAPI_REQCONTROLS, controls);
/* set parameters common for all internal operations */
set_common_params (pb);
/* set actions taken to process the operation */
set_config_params (pb);
op_shared_rename (pb, 0 /* not passing ownership of args */ );
slapi_pblock_set(pb, SLAPI_PLUGIN_INTOP_RESULT, &opresult);
return 0;
}
开发者ID:ohamada,项目名称:389ds,代码行数:28,代码来源:modrdn.c
示例14: slapi_rename_internal_set_pb_ext
void
slapi_rename_internal_set_pb_ext(Slapi_PBlock *pb,
const Slapi_DN *olddn,
const char *newrdn, /* normalized */
const Slapi_DN *newsuperior, int deloldrdn,
LDAPControl **controls, const char *uniqueid,
Slapi_ComponentId *plugin_identity,
int operation_flags)
{
Operation *op;
PR_ASSERT (pb != NULL);
if (pb == NULL || olddn == NULL || newrdn == NULL)
{
slapi_log_error(SLAPI_LOG_FATAL, NULL,
"slapi_rename_internal_set_pb: NULL parameter\n");
return;
}
op = internal_operation_new(SLAPI_OPERATION_MODRDN,operation_flags);
slapi_pblock_set(pb, SLAPI_OPERATION, op);
slapi_pblock_set(pb, SLAPI_ORIGINAL_TARGET,
(void*)slapi_sdn_get_dn(olddn));
slapi_pblock_set(pb, SLAPI_MODRDN_TARGET_SDN, (void*)olddn);
slapi_pblock_set(pb, SLAPI_MODRDN_NEWRDN, (void*)newrdn);
slapi_pblock_set(pb, SLAPI_MODRDN_NEWSUPERIOR_SDN, (void*)newsuperior);
slapi_pblock_set(pb, SLAPI_MODRDN_DELOLDRDN, &deloldrdn);
slapi_pblock_set(pb, SLAPI_CONTROLS_ARG, controls);
slapi_pblock_set(pb, SLAPI_MODIFY_MODS, NULL);
if (uniqueid)
{
slapi_pblock_set(pb, SLAPI_TARGET_UNIQUEID, (void*)uniqueid);
}
slapi_pblock_set(pb, SLAPI_PLUGIN_IDENTITY, plugin_identity);
}
开发者ID:ohamada,项目名称:389ds,代码行数:34,代码来源:modrdn.c
示例15: ipa_topo_internal_postop_init
static int
ipa_topo_internal_postop_init(Slapi_PBlock *pb)
{
int rc;
rc = slapi_pblock_set(pb, SLAPI_PLUGIN_INTERNAL_POST_ADD_FN,
(void *)ipa_topo_post_add);
rc |= slapi_pblock_set(pb, SLAPI_PLUGIN_INTERNAL_POST_DELETE_FN,
(void *)ipa_topo_post_del);
return(rc);
}
开发者ID:borland667,项目名称:freeipa,代码行数:10,代码来源:topology_init.c
示例16: acl_preopInit
int
acl_preopInit (Slapi_PBlock *pb)
{
int rc = 0;
/* save plugin identity to later pass to internal operations */
rc = slapi_pblock_get (pb, SLAPI_PLUGIN_IDENTITY, &g_acl_preop_plugin_identity);
/* Declare plugin version */
rc = slapi_pblock_set(pb, SLAPI_PLUGIN_VERSION, SLAPI_PLUGIN_VERSION_01);
/* Provide descriptive information */
rc |= slapi_pblock_set(pb, SLAPI_PLUGIN_DESCRIPTION, (void*)&pdesc);
/* Register functions */
rc |= slapi_pblock_set(pb, SLAPI_PLUGIN_PRE_SEARCH_FN, (void*)aclplugin_preop_search);
rc |= slapi_pblock_set(pb, SLAPI_PLUGIN_PRE_COMPARE_FN, (void*)aclplugin_preop_search);
rc |= slapi_pblock_set(pb, SLAPI_PLUGIN_PRE_ADD_FN, (void*)aclplugin_preop_modify);
rc |= slapi_pblock_set(pb, SLAPI_PLUGIN_PRE_MODIFY_FN, (void*)aclplugin_preop_modify);
rc |= slapi_pblock_set(pb, SLAPI_PLUGIN_PRE_MODRDN_FN, (void*)aclplugin_preop_modify);
rc |= slapi_pblock_set(pb, SLAPI_PLUGIN_PRE_DELETE_FN, (void*)aclplugin_preop_modify);
#if 0
/*
* XXXmcs: In order to support access control checking from
* extended operations, we need a SLAPI_PLUGIN_PRE_EXTENDED_FN hook.
* But today no such entry point exists.
*/
rc |= slapi_pblock_set(pb, SLAPI_PLUGIN_PRE_EXTENDED_FN, (void*)aclplugin_preop_modify);
#endif
slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "<= acl_preop_Init %d\n", rc );
return( rc );
}
开发者ID:Firstyear,项目名称:ds,代码行数:35,代码来源:aclplugin.c
示例17: sampletask_init
/*
* Init function
* Specified in the plugin entry as "nsslapd-pluginInitfunc: sampletask_init"
*/
int
sampletask_init( Slapi_PBlock *pb )
{
int rc = 0;
rc = slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION,
(void *) SLAPI_PLUGIN_VERSION_03 );
rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_START_FN,
(void *) task_sampletask_start );
return rc;
}
开发者ID:Firstyear,项目名称:ds,代码行数:15,代码来源:sampletask.c
示例18: slapi_search_internal_callback_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 free_filter = 0;
SlapReply *rs;
if ( pb == NULL ) {
return -1;
}
PBLOCK_ASSERT_INTOP( pb, LDAP_REQ_SEARCH );
rs = pb->pb_rs;
/* search callback and arguments */
slapi_pblock_set( pb, SLAPI_X_INTOP_RESULT_CALLBACK, (void *)prc );
slapi_pblock_set( pb, SLAPI_X_INTOP_SEARCH_ENTRY_CALLBACK, (void *)psec );
slapi_pblock_set( pb, SLAPI_X_INTOP_REFERRAL_ENTRY_CALLBACK, (void *)prec );
slapi_pblock_set( pb, SLAPI_X_INTOP_CALLBACK_DATA, (void *)callback_data );
if ( BER_BVISEMPTY( &pb->pb_op->ors_filterstr )) {
rs->sr_err = LDAP_PARAM_ERROR;
goto cleanup;
}
if ( pb->pb_op->ors_filter == NULL ) {
pb->pb_op->ors_filter = slapi_str2filter( pb->pb_op->ors_filterstr.bv_val );
if ( pb->pb_op->ors_filter == NULL ) {
rs->sr_err = LDAP_PROTOCOL_ERROR;
goto cleanup;
}
free_filter = 1;
}
slapi_int_func_internal_pb( pb, op_search );
cleanup:
if ( free_filter ) {
slapi_filter_free( pb->pb_op->ors_filter, 1 );
pb->pb_op->ors_filter = NULL;
}
slapi_pblock_delete_param( pb, SLAPI_X_INTOP_RESULT_CALLBACK );
slapi_pblock_delete_param( pb, SLAPI_X_INTOP_SEARCH_ENTRY_CALLBACK );
slapi_pblock_delete_param( pb, SLAPI_X_INTOP_REFERRAL_ENTRY_CALLBACK );
slapi_pblock_delete_param( pb, SLAPI_X_INTOP_CALLBACK_DATA );
return 0;
}
开发者ID:dago,项目名称:openldap,代码行数:54,代码来源:slapi_ops.c
示例19: addrdnvalues_preop_init
int addrdnvalues_preop_init(Slapi_PBlock *pb)
{
if (slapi_pblock_set(pb, SLAPI_PLUGIN_VERSION, SLAPI_PLUGIN_VERSION_03) != 0 ||
slapi_pblock_set(pb, SLAPI_PLUGIN_DESCRIPTION, &pluginDescription) != 0 ||
slapi_pblock_set(pb, SLAPI_PLUGIN_PRE_ADD_FN, (void *)addrdnvalues_preop_add) != 0) {
slapi_log_error(SLAPI_LOG_PLUGIN, "addrdnvalues_preop_init",
"Error registering %s\n", pluginDescription.spd_description);
return -1;
}
return 0;
}
开发者ID:1ack,项目名称:Impala,代码行数:12,代码来源:addrdnvalues.c
示例20: consumer_connection_extension_destructor
/* consumer connection extension destructor */
void consumer_connection_extension_destructor (void *ext, void *object, void *parent)
{
PRUint64 connid = 0;
if (ext)
{
/* Check to see if this replication session has acquired
* a replica. If so, release it here.
*/
consumer_connection_extension *connext = (consumer_connection_extension *)ext;
if (NULL != connext->replica_acquired)
{
Replica *r = object_get_data ((Object*)connext->replica_acquired);
/* If a total update was in progress, abort it */
if (REPL_PROTOCOL_50_TOTALUPDATE == connext->repl_protocol_version)
{
Slapi_PBlock *pb = slapi_pblock_new();
const Slapi_DN *repl_root_sdn = replica_get_root(r);
PR_ASSERT(NULL != repl_root_sdn);
if (NULL != repl_root_sdn)
{
slapi_pblock_set(pb, SLAPI_CONNECTION, connext->connection);
slapi_pblock_set(pb, SLAPI_TARGET_SDN, (void*)repl_root_sdn);
slapi_pblock_get(pb, SLAPI_CONN_ID, &connid);
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
"Aborting total update in progress for replicated "
"area %s connid=%" NSPRIu64 "\n", slapi_sdn_get_dn(repl_root_sdn),
connid);
slapi_stop_bulk_import(pb);
}
else
{
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
"consumer_connection_extension_destructor: can't determine root "
"of replicated area.\n");
}
slapi_pblock_destroy(pb);
/* allow reaping again */
replica_set_tombstone_reap_stop(r, PR_FALSE);
}
replica_relinquish_exclusive_access(r, connid, -1);
object_release ((Object*)connext->replica_acquired);
connext->replica_acquired = NULL;
}
if (connext->supplier_ruv)
{
ruv_destroy ((RUV **)&connext->supplier_ruv);
}
connext->connection = NULL;
slapi_ch_free((void **)&ext);
}
}
开发者ID:leto,项目名称:389-ds,代码行数:54,代码来源:repl_connext.c
注:本文中的slapi_pblock_set函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论