]> git.sur5r.net Git - openldap/commitdiff
Heads up: fix for SLAPI compliance: when calling slapi_pblock_set() with
authorLuke Howard <lukeh@openldap.org>
Mon, 25 Jul 2005 10:53:45 +0000 (10:53 +0000)
committerLuke Howard <lukeh@openldap.org>
Mon, 25 Jul 2005 10:53:45 +0000 (10:53 +0000)
an integer or long integer parameter, the value argument is a pointer to
the integeral value rather than the value itself.

servers/slapd/slapi/plugin.c
servers/slapd/slapi/slapi.h
servers/slapd/slapi/slapi_ops.c
servers/slapd/slapi/slapi_pblock.c
servers/slapd/slapi/slapi_utils.c

index abdd63d6cdc2f27a2430ed2b329fb55f77795574..450bc7395a68aec40e1b007a8a068d25212c00ad 100644 (file)
@@ -80,15 +80,8 @@ plugin_pblock_new(
                goto done;
        }
 
-       rc = slapi_pblock_set( pPlugin, SLAPI_PLUGIN_TYPE, (void *)type );
-       if ( rc != 0 ) {
-               goto done;
-       }
-
-       rc = slapi_pblock_set( pPlugin, SLAPI_PLUGIN_ARGC, (void *)argc );
-       if ( rc != 0 ) {
-               goto done;
-       }
+       slapi_pblock_set( pPlugin, SLAPI_PLUGIN_TYPE, (void *)&type );
+       slapi_pblock_set( pPlugin, SLAPI_PLUGIN_ARGC, (void *)&argc );
 
        av2 = ldap_charray_dup( argv );
        if ( av2 == NULL ) {
@@ -101,15 +94,9 @@ plugin_pblock_new(
        } else {
                ppPluginArgv = NULL;
        }
-       rc = slapi_pblock_set( pPlugin, SLAPI_PLUGIN_ARGV, (void *)ppPluginArgv );
-       if ( rc != 0 ) { 
-               goto done;
-       }
 
-       rc = slapi_pblock_set( pPlugin, SLAPI_X_CONFIG_ARGV, (void *)av2 );
-       if ( rc != 0 ) { 
-               goto done;
-       }
+       slapi_pblock_set( pPlugin, SLAPI_PLUGIN_ARGV, (void *)ppPluginArgv );
+       slapi_pblock_set( pPlugin, SLAPI_X_CONFIG_ARGV, (void *)av2 );
 
        rc = slapi_int_load_plugin( pPlugin, path, initfunc, 1, NULL, &hdLoadHandle );
        if ( rc != 0 ) {
index 6f0e87163df5a0d59794328cc4c02bf55efe3fbc..9006742c0d16d9fb2abea7e9a68ff96c9f02591e 100644 (file)
@@ -106,11 +106,18 @@ typedef enum slapi_pblock_class_e {
 #define PBLOCK_ERROR                   (-1)
 #define PBLOCK_MAX_PARAMS              100
 
+union slapi_pblock_value {
+       int pv_integer;
+       long pv_long_integer;
+       void *pv_pointer;
+       void (*pv_function_pointer)(void *);
+};
+
 struct slapi_pblock {
        ldap_pvt_thread_mutex_t pblockMutex;
        int                     numParams;
        int                     curParams[PBLOCK_MAX_PARAMS];
-       void                    *curVals[PBLOCK_MAX_PARAMS];
+       union slapi_pblock_value curVals[PBLOCK_MAX_PARAMS];
        /* native types */
        Connection              *pconn;
        Operation               *pop;
index 8f1fb2a908842559ec06a2bfbf1c658043c6889e..5ca82cedc00ac1ca234d23ae6b685760aea99da1 100644 (file)
@@ -587,7 +587,7 @@ slapi_int_search_entry_callback( Slapi_Entry *entry, void *callback_data )
        tp[i] = NULL;
                  
        slapi_pblock_set( pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, (void *)tp );
-       slapi_pblock_set( pb, SLAPI_NENTRIES, (void *)i );
+       slapi_pblock_set( pb, SLAPI_NENTRIES, (void *)&i );
 
        return LDAP_SUCCESS;
 }
@@ -671,20 +671,23 @@ slapi_search_internal_set_pb( Slapi_PBlock *pb,
        Slapi_ComponentId *plugin_identity,
        int operation_flags )
 {
+       int no_limit = SLAP_NO_LIMIT;
+       int deref = LDAP_DEREF_NEVER;
+
        slapi_int_connection_init_pb( pb, LDAP_REQ_SEARCH );
        slapi_pblock_set( pb, SLAPI_SEARCH_TARGET,    (void *)base );
-       slapi_pblock_set( pb, SLAPI_SEARCH_SCOPE,     (void *)scope );
-       slapi_pblock_set( pb, SLAPI_SEARCH_FILTER,    NULL );
+       slapi_pblock_set( pb, SLAPI_SEARCH_SCOPE,     (void *)&scope );
+       slapi_pblock_set( pb, SLAPI_SEARCH_FILTER,    (void *)0 );
        slapi_pblock_set( pb, SLAPI_SEARCH_STRFILTER, (void *)filter );
        slapi_pblock_set( pb, SLAPI_SEARCH_ATTRS,     (void *)attrs );
-       slapi_pblock_set( pb, SLAPI_SEARCH_ATTRSONLY, (void *)attrsonly );
+       slapi_pblock_set( pb, SLAPI_SEARCH_ATTRSONLY, (void *)&attrsonly );
        slapi_pblock_set( pb, SLAPI_REQCONTROLS,      (void *)controls );
        slapi_pblock_set( pb, SLAPI_TARGET_UNIQUEID,  (void *)uniqueid );
        slapi_pblock_set( pb, SLAPI_PLUGIN_IDENTITY,  (void *)plugin_identity );
-       slapi_pblock_set( pb, SLAPI_X_INTOP_FLAGS,    (void *)operation_flags );
-       slapi_pblock_set( pb, SLAPI_SEARCH_DEREF,     (void *)0 );
-       slapi_pblock_set( pb, SLAPI_SEARCH_SIZELIMIT, (void *)SLAP_NO_LIMIT );
-       slapi_pblock_set( pb, SLAPI_SEARCH_TIMELIMIT, (void *)SLAP_NO_LIMIT );
+       slapi_pblock_set( pb, SLAPI_X_INTOP_FLAGS,    (void *)&operation_flags );
+       slapi_pblock_set( pb, SLAPI_SEARCH_DEREF,     (void *)&deref );
+       slapi_pblock_set( pb, SLAPI_SEARCH_SIZELIMIT, (void *)&no_limit );
+       slapi_pblock_set( pb, SLAPI_SEARCH_TIMELIMIT, (void *)&no_limit );
 
        slapi_int_set_operation_dn( pb );
 }
@@ -726,7 +729,7 @@ slapi_modify_internal_set_pb( Slapi_PBlock *pb,
        slapi_pblock_set( pb, SLAPI_REQCONTROLS,     (void *)controls );
        slapi_pblock_set( pb, SLAPI_TARGET_UNIQUEID, (void *)uniqueid );
        slapi_pblock_set( pb, SLAPI_PLUGIN_IDENTITY, (void *)plugin_identity );
-       slapi_pblock_set( pb, SLAPI_X_INTOP_FLAGS,   (void *)operation_flags );
+       slapi_pblock_set( pb, SLAPI_X_INTOP_FLAGS,   (void *)&operation_flags );
        slapi_int_set_operation_dn( pb );
 }
 
@@ -752,7 +755,7 @@ slapi_modify_internal(
        pb = slapi_pblock_new();
 
        slapi_modify_internal_set_pb( pb, ldn, mods, controls, NULL, NULL, 0 );
-       slapi_pblock_set( pb, SLAPI_LOG_OPERATION, (void *)log_change );
+       slapi_pblock_set( pb, SLAPI_LOG_OPERATION, (void *)&log_change );
        slapi_modify_internal_pb( pb );
 
        return pb;
@@ -771,7 +774,7 @@ slapi_add_internal_set_pb( Slapi_PBlock *pb,
        slapi_pblock_set( pb, SLAPI_MODIFY_MODS,     (void *)attrs );
        slapi_pblock_set( pb, SLAPI_REQCONTROLS,     (void *)controls );
        slapi_pblock_set( pb, SLAPI_PLUGIN_IDENTITY, (void *)plugin_identity );
-       slapi_pblock_set( pb, SLAPI_X_INTOP_FLAGS,   (void *)operation_flags );
+       slapi_pblock_set( pb, SLAPI_X_INTOP_FLAGS,   (void *)&operation_flags );
        slapi_int_set_operation_dn( pb );
 
        return 0;
@@ -789,7 +792,7 @@ slapi_add_internal(
        pb = slapi_pblock_new();
 
        slapi_add_internal_set_pb( pb, dn, attrs, controls, NULL, 0);
-       slapi_pblock_set( pb, SLAPI_LOG_OPERATION, (void *)log_change );
+       slapi_pblock_set( pb, SLAPI_LOG_OPERATION, (void *)&log_change );
        slapi_add_internal_pb( pb );
 
        return pb;
@@ -806,7 +809,7 @@ slapi_add_entry_internal_set_pb( Slapi_PBlock *pb,
        slapi_pblock_set( pb, SLAPI_ADD_ENTRY,       (void *)e );
        slapi_pblock_set( pb, SLAPI_REQCONTROLS,     (void *)controls );
        slapi_pblock_set( pb, SLAPI_PLUGIN_IDENTITY, (void *)plugin_identity );
-       slapi_pblock_set( pb, SLAPI_X_INTOP_FLAGS,   (void *)operation_flags );
+       slapi_pblock_set( pb, SLAPI_X_INTOP_FLAGS,   (void *)&operation_flags );
        slapi_int_set_operation_dn( pb );
 }
 
@@ -821,7 +824,7 @@ slapi_add_entry_internal(
        pb = slapi_pblock_new();
 
        slapi_add_entry_internal_set_pb( pb, e, controls, NULL, 0 );
-       slapi_pblock_set( pb, SLAPI_LOG_OPERATION, (void *)log_change );
+       slapi_pblock_set( pb, SLAPI_LOG_OPERATION, (void *)&log_change );
        slapi_add_internal_pb( pb );
 
        return pb;
@@ -842,11 +845,11 @@ slapi_rename_internal_set_pb( Slapi_PBlock *pb,
        slapi_pblock_set( pb, SLAPI_MODRDN_TARGET,      (void *)olddn );
        slapi_pblock_set( pb, SLAPI_MODRDN_NEWRDN,      (void *)newrdn );
        slapi_pblock_set( pb, SLAPI_MODRDN_NEWSUPERIOR, (void *)newsuperior );
-       slapi_pblock_set( pb, SLAPI_MODRDN_DELOLDRDN,   (void *)deloldrdn );
+       slapi_pblock_set( pb, SLAPI_MODRDN_DELOLDRDN,   (void *)&deloldrdn );
        slapi_pblock_set( pb, SLAPI_REQCONTROLS,        (void *)controls );
        slapi_pblock_set( pb, SLAPI_TARGET_UNIQUEID,    (void *)uniqueid );
        slapi_pblock_set( pb, SLAPI_PLUGIN_IDENTITY,    (void *)plugin_identity );
-       slapi_pblock_set( pb, SLAPI_X_INTOP_FLAGS,      (void *)operation_flags );
+       slapi_pblock_set( pb, SLAPI_X_INTOP_FLAGS,      (void *)&operation_flags );
        slapi_int_set_operation_dn( pb );
 }
 
@@ -876,7 +879,7 @@ slapi_modrdn_internal(
 
        slapi_rename_internal_set_pb( pb, olddn, lnewrdn, NULL,
                deloldrdn, controls, NULL, NULL, 0 );
-       slapi_pblock_set( pb, SLAPI_LOG_OPERATION, (void *)log_change );
+       slapi_pblock_set( pb, SLAPI_LOG_OPERATION, (void *)&log_change );
        slapi_modrdn_internal_pb( pb );
 
        return pb;
@@ -895,7 +898,7 @@ slapi_delete_internal_set_pb( Slapi_PBlock *pb,
        slapi_pblock_set( pb, SLAPI_REQCONTROLS,     (void *)controls );
        slapi_pblock_set( pb, SLAPI_TARGET_UNIQUEID, (void *)uniqueid );
        slapi_pblock_set( pb, SLAPI_PLUGIN_IDENTITY, (void *)plugin_identity );
-       slapi_pblock_set( pb, SLAPI_X_INTOP_FLAGS,   (void *)operation_flags );
+       slapi_pblock_set( pb, SLAPI_X_INTOP_FLAGS,   (void *)&operation_flags );
        slapi_int_set_operation_dn( pb );
 }
 
@@ -920,7 +923,7 @@ slapi_delete_internal(
        pb = slapi_pblock_new();
 
        slapi_delete_internal_set_pb( pb, ldn, controls, NULL, NULL, 0 );
-       slapi_pblock_set( pb, SLAPI_LOG_OPERATION, (void *)log_change );
+       slapi_pblock_set( pb, SLAPI_LOG_OPERATION, (void *)&log_change );
        slapi_delete_internal_pb( pb );
 
        return pb;
index cd47bdfd96f2d5696f5870a0517f9ebe1cabc572..b899cdecec260358ac522fa8ab681328e87adf16 100644 (file)
@@ -65,10 +65,11 @@ pblock_get_param_class( int param )
        case SLAPI_DB2LDIF_PRINTKEY:
        case SLAPI_LDIF2DB_REMOVEDUPVALS:
        case SLAPI_MANAGEDSAIT:
-       case SLAPI_REQUESTOR_ISUPDATEDN:
+       case SLAPI_IS_REPLICATED_OPERATION:
        case SLAPI_X_CONN_IS_UDP:
        case SLAPI_X_CONN_SSF:
        case SLAPI_RESULT_CODE:
+       case SLAPI_LOG_OPERATION:
                return PBLOCK_CLASS_INTEGER;
                break;
 
@@ -268,7 +269,6 @@ pblock_get_param_class( int param )
        case SLAPI_SEARCH_RESULT_SET:
        case SLAPI_SEARCH_RESULT_ENTRY:
        case SLAPI_SEARCH_REFERRALS:
-       case SLAPI_LOG_OPERATION:
        case SLAPI_RESULT_TEXT:
        case SLAPI_RESULT_MATCHED:
        case SLAPI_X_GROUP_ENTRY:
@@ -328,14 +328,16 @@ pblock_get_default( Slapi_PBlock *pb, int param, void **value )
                if ( pb->curParams[i] == param ) {
                        switch ( pbClass ) {
                        case PBLOCK_CLASS_INTEGER:
-                               *((int *)value) = (int)pb->curVals[i];
+                               *((int *)value) = pb->curVals[i].pv_integer;
                                break;
                        case PBLOCK_CLASS_LONG_INTEGER:
-                               *((long *)value) = (long)pb->curVals[i];
+                               *((long *)value) = pb->curVals[i].pv_long_integer;
                                break;
                        case PBLOCK_CLASS_POINTER:
+                               *value = pb->curVals[i].pv_pointer;
+                               break;
                        case PBLOCK_CLASS_FUNCTION_POINTER:
-                               *value = pb->curVals[i];
+                               *value = pb->curVals[i].pv_function_pointer;
                                break;
                        default:
                                break;
@@ -389,10 +391,26 @@ pblock_set_default( Slapi_PBlock *pb, int param, void *value )
                return PBLOCK_ERROR;
        }
 
-       for ( i = 0; i < pb->numParams; i++ ) { 
+       for ( i = 0; i < pb->numParams; i++ ) {
                if ( pb->curParams[i] == param ) {
+                       switch ( pbClass ) {
+                       case PBLOCK_CLASS_INTEGER:
+                               pb->curVals[i].pv_integer = (*((int *)value));
+                               break;
+                       case PBLOCK_CLASS_LONG_INTEGER:
+                               pb->curVals[i].pv_long_integer = (*((long *)value));
+                               break;
+                       case PBLOCK_CLASS_POINTER:
+                               pb->curVals[i].pv_pointer = value;
+                               break;
+                       case PBLOCK_CLASS_FUNCTION_POINTER:
+                               pb->curVals[i].pv_function_pointer = value;
+                               break;
+                       default:
+                               break;
+                       }
                        break;
-               }
+               }
        }
 
        if ( i >= pb->numParams ) {
@@ -400,8 +418,6 @@ pblock_set_default( Slapi_PBlock *pb, int param, void *value )
                pb->numParams++;
        }
 
-       pb->curVals[i] = value;
-
        return PBLOCK_SUCCESS;
 }
 
@@ -418,11 +434,11 @@ pblock_get( Slapi_PBlock *pb, int param, void **value )
                break;
        case SLAPI_OPINITIATED_TIME:
                PBLOCK_ASSERT_OP( pb, 0 );
-               *((time_t *)value) = pb->pop->o_time;
+               *((long *)value) = pb->pop->o_time;
                break;
        case SLAPI_OPERATION_ID:
                PBLOCK_ASSERT_OP( pb, 0 );
-               *((unsigned long *)value) = pb->pop->o_opid;
+               *((long *)value) = pb->pop->o_opid;
                break;
        case SLAPI_OPERATION_TYPE:
                PBLOCK_ASSERT_OP( pb, 0 );
@@ -473,7 +489,7 @@ pblock_get( Slapi_PBlock *pb, int param, void **value )
                PBLOCK_ASSERT_OP( pb, 0 );
                *((int *)value) = be_isroot( pb->pop );
                break;
-       case SLAPI_REQUESTOR_ISUPDATEDN:
+       case SLAPI_IS_REPLICATED_OPERATION:
                PBLOCK_ASSERT_OP( pb, 0 );
                *((int *)value) = be_isupdate( pb->pop );
                break;
@@ -498,7 +514,7 @@ pblock_get( Slapi_PBlock *pb, int param, void **value )
                break;
        case SLAPI_CONN_ID:
                PBLOCK_ASSERT_CONN( pb );
-               *((unsigned long *)value) = pb->pconn->c_connid;
+               *((long *)value) = pb->pconn->c_connid;
                break;
        case SLAPI_CONN_DN:
                PBLOCK_ASSERT_CONN( pb );
@@ -762,15 +778,15 @@ pblock_set( Slapi_PBlock *pb, int param, void *value )
                break;
        case SLAPI_OPINITIATED_TIME:
                PBLOCK_ASSERT_OP( pb, 0 );
-               pb->pop->o_time = (time_t)value;
+               pb->pop->o_time = *((long *)value);
                break;
        case SLAPI_OPERATION_ID:
                PBLOCK_ASSERT_OP( pb, 0 );
-               pb->pop->o_opid = (unsigned long)value;
+               pb->pop->o_opid = *((long *)value);
                break;
        case SLAPI_OPERATION_TYPE:
                PBLOCK_ASSERT_OP( pb, 0 );
-               pb->pop->o_tag = (ber_tag_t)value;
+               pb->pop->o_tag = *((ber_tag_t *)value);
                break;
        case SLAPI_REQCONTROLS:
                PBLOCK_ASSERT_OP( pb, 0 );
@@ -797,7 +813,7 @@ pblock_set( Slapi_PBlock *pb, int param, void *value )
                break;
        case SLAPI_MANAGEDSAIT:
                PBLOCK_ASSERT_OP( pb, 0 );
-               pb->pop->o_managedsait = (int)value;
+               pb->pop->o_managedsait = *((int *)value);
                break;
        case SLAPI_BACKEND:
                PBLOCK_ASSERT_OP( pb, 0 );
@@ -825,7 +841,7 @@ pblock_set( Slapi_PBlock *pb, int param, void *value )
        case SLAPI_CONN_ID:
                PBLOCK_ASSERT_CONN( pb );
                PBLOCK_LOCK_CONN( pb );
-               pb->pconn->c_connid = (unsigned long)value;
+               pb->pconn->c_connid = *((long *)value);
                PBLOCK_UNLOCK_CONN( pb );
                break;
        case SLAPI_CONN_DN:
@@ -836,7 +852,7 @@ pblock_set( Slapi_PBlock *pb, int param, void *value )
                break;
        case SLAPI_RESULT_CODE:
        case SLAPI_PLUGIN_INTOP_RESULT:
-               pb->rs.sr_err = (int)value;
+               pb->rs.sr_err = *((int *)value);
                break;
        case SLAPI_RESULT_TEXT:
                snprintf( pb->textbuf, sizeof( pb->textbuf ), "%s", (char *)value );
@@ -922,21 +938,23 @@ pblock_set( Slapi_PBlock *pb, int param, void *value )
                PBLOCK_ASSERT_OP( pb, 0 );
                PBLOCK_VALIDATE_IS_INTOP( pb );
                if ( pb->pop->o_tag == LDAP_REQ_MODRDN )
-                       pb->pop->orr_deleteoldrdn = (int)value;
+                       pb->pop->orr_deleteoldrdn = *((int *)value);
                else
                        rc = PBLOCK_ERROR;
                break;
-       case SLAPI_SEARCH_SCOPE:
+       case SLAPI_SEARCH_SCOPE: {
+               int scope = *((int *)value);
+
                PBLOCK_ASSERT_OP( pb, 0 );
                if ( pb->pop->o_tag == LDAP_REQ_SEARCH ) {
-                       switch ( (int)value ) {
+                       switch ( *((int *)value) ) {
                        case LDAP_SCOPE_BASE:
                        case LDAP_SCOPE_ONELEVEL:
                        case LDAP_SCOPE_SUBTREE:
 #ifdef LDAP_SCOPE_SUBORDINATE
                        case LDAP_SCOPE_SUBORDINATE:
 #endif
-                               pb->pop->ors_scope = (int)value;
+                               pb->pop->ors_scope = scope;
                                break;
                        default:
                                rc = PBLOCK_ERROR;
@@ -946,24 +964,25 @@ pblock_set( Slapi_PBlock *pb, int param, void *value )
                        rc = PBLOCK_ERROR;
                }
                break;
+       }
        case SLAPI_SEARCH_DEREF:
                PBLOCK_ASSERT_OP( pb, 0 );
                if ( pb->pop->o_tag == LDAP_REQ_SEARCH )
-                       pb->pop->ors_deref = (int)value;
+                       pb->pop->ors_deref = *((int *)value);
                else
                        rc = PBLOCK_ERROR;
                break;
        case SLAPI_SEARCH_SIZELIMIT:
                PBLOCK_ASSERT_OP( pb, 0 );
                if ( pb->pop->o_tag == LDAP_REQ_SEARCH )
-                       pb->pop->ors_slimit = (int)value;
+                       pb->pop->ors_slimit = *((int *)value);
                else
                        rc = PBLOCK_ERROR;
                break;
        case SLAPI_SEARCH_TIMELIMIT:
                PBLOCK_ASSERT_OP( pb, 0 );
                if ( pb->pop->o_tag == LDAP_REQ_SEARCH )
-                       pb->pop->ors_tlimit = (int)value;
+                       pb->pop->ors_tlimit = *((int *)value);
                else
                        rc = PBLOCK_ERROR;
                break;
@@ -1030,7 +1049,7 @@ pblock_set( Slapi_PBlock *pb, int param, void *value )
                PBLOCK_VALIDATE_IS_INTOP( pb );
 
                if ( pb->pop->o_tag == LDAP_REQ_SEARCH )
-                       pb->pop->ors_attrsonly = (int)value;
+                       pb->pop->ors_attrsonly = *((int *)value);
                else
                        rc = PBLOCK_ERROR;
                break;
@@ -1072,7 +1091,7 @@ pblock_set( Slapi_PBlock *pb, int param, void *value )
                PBLOCK_VALIDATE_IS_INTOP( pb );
 
                if ( pb->pop->o_tag == LDAP_REQ_BIND )
-                       pb->pop->orb_method = (int)value;
+                       pb->pop->orb_method = *((int *)value);
                else
                        rc = PBLOCK_ERROR;
                break;
@@ -1117,7 +1136,7 @@ pblock_set( Slapi_PBlock *pb, int param, void *value )
                        rc = PBLOCK_ERROR;
                break;
        case SLAPI_REQUESTOR_ISROOT:
-       case SLAPI_REQUESTOR_ISUPDATEDN:
+       case SLAPI_IS_REPLICATED_OPERATION:
        case SLAPI_CONN_AUTHTYPE:
        case SLAPI_CONN_AUTHMETHOD:
        case SLAPI_X_CONN_IS_UDP:
@@ -1185,7 +1204,7 @@ slapi_pblock_new(void)
                memset( pb->curParams, 0, sizeof(pb->curParams) );
                memset( pb->curVals, 0, sizeof(pb->curVals) );
                pb->curParams[0] = SLAPI_IBM_PBLOCK;
-               pb->curVals[0] = NULL;
+               pb->curVals[0].pv_pointer = NULL;
                pb->numParams = 1;
                pb->pconn = NULL;
                pb->pop = NULL;
index bb46f4c4c6e67db64c9a0929b54492d9a0420e63..c9ccbd6dc1fc3b1e1ccbdb1a2eab10f266f9e816 100644 (file)
@@ -2859,6 +2859,7 @@ int slapi_compute_add_evaluator(slapi_compute_callback_t function)
 {
        Slapi_PBlock *pPlugin = NULL;
        int rc;
+       int type = SLAPI_PLUGIN_OBJECT;
 
        pPlugin = slapi_pblock_new();
        if ( pPlugin == NULL ) {
@@ -2866,7 +2867,7 @@ int slapi_compute_add_evaluator(slapi_compute_callback_t function)
                goto done;
        }
 
-       rc = slapi_pblock_set( pPlugin, SLAPI_PLUGIN_TYPE, (void *)SLAPI_PLUGIN_OBJECT );
+       rc = slapi_pblock_set( pPlugin, SLAPI_PLUGIN_TYPE, (void *)&type );
        if ( rc != LDAP_SUCCESS ) {
                goto done;
        }
@@ -2900,6 +2901,7 @@ int slapi_compute_add_search_rewriter(slapi_search_rewrite_callback_t function)
 {
        Slapi_PBlock *pPlugin = NULL;
        int rc;
+       int type = SLAPI_PLUGIN_OBJECT;
 
        pPlugin = slapi_pblock_new();
        if ( pPlugin == NULL ) {
@@ -2907,7 +2909,7 @@ int slapi_compute_add_search_rewriter(slapi_search_rewrite_callback_t function)
                goto done;
        }
 
-       rc = slapi_pblock_set( pPlugin, SLAPI_PLUGIN_TYPE, (void *)SLAPI_PLUGIN_OBJECT );
+       rc = slapi_pblock_set( pPlugin, SLAPI_PLUGIN_TYPE, (void *)&type );
        if ( rc != LDAP_SUCCESS ) {
                goto done;
        }