more cleanups

This commit is contained in:
Luke Howard 2005-07-25 13:17:15 +00:00
parent f302b9ee0d
commit 88737d900a
2 changed files with 14 additions and 22 deletions

View File

@ -10,7 +10,7 @@
- This is a very tough task: try to implement a sandbox to execute - This is a very tough task: try to implement a sandbox to execute
plugins in, trap deadly signals and possibly disable unsafe plugins plugins in, trap deadly signals and possibly disable unsafe plugins
without crashing slapd (fork from inside thread? trap signals without crashing slapd (fork from inside thread? trap signals
and longjump to next plugin execution? Brrr). and longjump to next plugin execution? Brrr).
--- ---
$OpenLDAP$ $OpenLDAP$

View File

@ -70,9 +70,9 @@ plugin_pblock_new(
Slapi_PluginDesc *pPluginDesc = NULL; Slapi_PluginDesc *pPluginDesc = NULL;
lt_dlhandle hdLoadHandle; lt_dlhandle hdLoadHandle;
int rc; int rc;
char **av2 = NULL, **ppPluginArgv; char **av2 = NULL, **ppPluginArgv;
char *path = argv[2]; char *path = argv[2];
char *initfunc = argv[3]; char *initfunc = argv[3];
pPlugin = slapi_pblock_new(); pPlugin = slapi_pblock_new();
if ( pPlugin == NULL ) { if ( pPlugin == NULL ) {
@ -146,9 +146,9 @@ slapi_int_register_plugin(
Backend *be, Backend *be,
Slapi_PBlock *pPB ) Slapi_PBlock *pPB )
{ {
Slapi_PBlock *pTmpPB; Slapi_PBlock *pTmpPB;
Slapi_PBlock *pSavePB; Slapi_PBlock *pSavePB;
int rc = LDAP_SUCCESS; int rc = LDAP_SUCCESS;
assert( be != NULL ); assert( be != NULL );
@ -273,14 +273,12 @@ createExtendedOp()
{ {
ExtendedOp *ret; ExtendedOp *ret;
ret = (ExtendedOp *)ch_malloc(sizeof(ExtendedOp)); ret = (ExtendedOp *)slapi_ch_malloc(sizeof(ExtendedOp));
if ( ret != NULL ) { ret->ext_oid.bv_val = NULL;
ret->ext_oid.bv_val = NULL; ret->ext_oid.bv_len = 0;
ret->ext_oid.bv_len = 0; ret->ext_func = NULL;
ret->ext_func = NULL; ret->ext_be = NULL;
ret->ext_be = NULL; ret->ext_next = NULL;
ret->ext_next = NULL;
}
return ret; return ret;
} }
@ -600,12 +598,6 @@ slapi_int_call_plugins(
} }
for ( pGetPlugin = tmpPlugin ; *pGetPlugin != NULL; pGetPlugin++ ) { for ( pGetPlugin = tmpPlugin ; *pGetPlugin != NULL; pGetPlugin++ ) {
/*
* FIXME: we should provide here a sort of sandbox,
* to protect from plugin faults; e.g. trap signals
* and longjump here, marking the plugin as unsafe for
* later executions ...
*/
rc = (*pGetPlugin)(pPB); rc = (*pGetPlugin)(pPB);
/* /*
@ -757,7 +749,7 @@ slapi_int_initialize(void)
return -1; return -1;
} }
slapi_log_file = ch_strdup( LDAP_RUNDIR LDAP_DIRSEP "errors" ); slapi_log_file = slapi_ch_strdup( LDAP_RUNDIR LDAP_DIRSEP "errors" );
if ( slapi_log_file == NULL ) { if ( slapi_log_file == NULL ) {
return -1; return -1;
} }