|
|
@ -84,7 +84,7 @@ main (argc, argv)
|
|
|
|
unsigned int fill_i;
|
|
|
|
unsigned int fill_i;
|
|
|
|
unsigned short fill_requested = 0;
|
|
|
|
unsigned short fill_requested = 0;
|
|
|
|
unsigned int i = 0;
|
|
|
|
unsigned int i = 0;
|
|
|
|
char *plugin_name = NULL;
|
|
|
|
char *plugin_name, *complete_plugin_name = NULL;
|
|
|
|
char *ext;
|
|
|
|
char *ext;
|
|
|
|
void *plugin;
|
|
|
|
void *plugin;
|
|
|
|
char *dl_result;
|
|
|
|
char *dl_result;
|
|
|
@ -120,8 +120,6 @@ main (argc, argv)
|
|
|
|
|
|
|
|
|
|
|
|
unsigned short stop_at_newlines = 1;
|
|
|
|
unsigned short stop_at_newlines = 1;
|
|
|
|
|
|
|
|
|
|
|
|
char *newenv, *curenv;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef OPENSSL
|
|
|
|
#ifdef OPENSSL
|
|
|
|
SSL_METHOD *meth;
|
|
|
|
SSL_METHOD *meth;
|
|
|
|
SSL_CTX *ctx = NULL;
|
|
|
|
SSL_CTX *ctx = NULL;
|
|
|
@ -436,17 +434,16 @@ main (argc, argv)
|
|
|
|
ext = strstr(plugin_name, ".so");
|
|
|
|
ext = strstr(plugin_name, ".so");
|
|
|
|
if ((ext == NULL) || (strcmp (ext, ".so") != 0))
|
|
|
|
if ((ext == NULL) || (strcmp (ext, ".so") != 0))
|
|
|
|
sprintf (plugin_name, "%s.so", plugin_name);
|
|
|
|
sprintf (plugin_name, "%s.so", plugin_name);
|
|
|
|
curenv = getenv ("LD_LIBRARY_PATH");
|
|
|
|
|
|
|
|
if (! curenv)
|
|
|
|
|
|
|
|
newenv = PLUGINS_DIR;
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
sprintf (newenv, "%s:%s", curenv, PLUGINS_DIR);
|
|
|
|
|
|
|
|
if (setenv ("LD_LIBRARY_PATH", newenv, 1) == -1)
|
|
|
|
|
|
|
|
err_sys ("Cannot change LD_LIBRARY_PATH");
|
|
|
|
|
|
|
|
plugin = dlopen (plugin_name, RTLD_NOW);
|
|
|
|
plugin = dlopen (plugin_name, RTLD_NOW);
|
|
|
|
|
|
|
|
if (!plugin) { /* retries with the absolute name */
|
|
|
|
|
|
|
|
complete_plugin_name = (char *) malloc(MAX_LINE);
|
|
|
|
|
|
|
|
sprintf (complete_plugin_name, "%s/%s", PLUGINS_DIR, plugin_name);
|
|
|
|
|
|
|
|
plugin = dlopen (complete_plugin_name, RTLD_NOW);
|
|
|
|
|
|
|
|
}
|
|
|
|
if (!plugin)
|
|
|
|
if (!plugin)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
err_sys ("Cannot load \"%s\": %s", plugin_name, dlerror ());
|
|
|
|
err_sys ("Cannot load \"%s\" (I tried the short name, then the complete name in \"%s\"): %s",
|
|
|
|
|
|
|
|
plugin_name, PLUGINS_DIR, dlerror ());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
plugin_init = dlsym (plugin, "init");
|
|
|
|
plugin_init = dlsym (plugin, "init");
|
|
|
|
dl_result = dlerror ();
|
|
|
|
dl_result = dlerror ();
|
|
|
|