Пример #1
0
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;
}
Пример #2
0
Файл: add.c Проект: Firstyear/ds
static int add_internal_pb (Slapi_PBlock *pb)
{
	LDAPControl		**controls;
	Operation       *op;
	int             opresult = 0;
	Slapi_Entry		*e;

	PR_ASSERT (pb != NULL);

	slapi_pblock_get(pb, SLAPI_ADD_ENTRY, &e);
	slapi_pblock_get(pb, SLAPI_CONTROLS_ARG, &controls);

	if (e == NULL)
	{
		opresult = LDAP_PARAM_ERROR;
		slapi_pblock_set(pb, SLAPI_PLUGIN_INTOP_RESULT, &opresult);
		return 0;
	}
	
	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 to all internal operations */
	set_common_params (pb);

	/* set actions taken to process the operation */
	set_config_params (pb);

	/* perform the add operation */
	op_shared_add (pb);
	
	slapi_pblock_set(pb, SLAPI_PLUGIN_INTOP_RESULT, &opresult);

	return 0;
}