Don't require PLUGINDIR to be defined.
If it is not available, we just load monolithically built plugins.
This commit is contained in:
@@ -250,8 +250,11 @@ static bool load_plugin(private_plugin_loader_t *this, char *name, char *file,
|
|||||||
this->plugins->insert_last(this->plugins, entry);
|
this->plugins->insert_last(this->plugins, entry);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
case NOT_FOUND:
|
case NOT_FOUND:
|
||||||
/* try to load the plugin from a file */
|
if (file)
|
||||||
break;
|
{ /* try to load the plugin from a file */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
/* fall-through */
|
||||||
default:
|
default:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -651,16 +654,18 @@ METHOD(plugin_loader_t, load_plugins, bool,
|
|||||||
char *token;
|
char *token;
|
||||||
bool critical_failed = FALSE;
|
bool critical_failed = FALSE;
|
||||||
|
|
||||||
|
#ifdef PLUGINDIR
|
||||||
if (path == NULL)
|
if (path == NULL)
|
||||||
{
|
{
|
||||||
path = PLUGINDIR;
|
path = PLUGINDIR;
|
||||||
}
|
}
|
||||||
|
#endif /* PLUGINDIR */
|
||||||
|
|
||||||
enumerator = enumerator_create_token(list, " ", " ");
|
enumerator = enumerator_create_token(list, " ", " ");
|
||||||
while (!critical_failed && enumerator->enumerate(enumerator, &token))
|
while (!critical_failed && enumerator->enumerate(enumerator, &token))
|
||||||
{
|
{
|
||||||
bool critical = FALSE;
|
bool critical = FALSE;
|
||||||
char file[PATH_MAX];
|
char buf[PATH_MAX], *file = NULL;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
token = strdup(token);
|
token = strdup(token);
|
||||||
@@ -675,10 +680,14 @@ METHOD(plugin_loader_t, load_plugins, bool,
|
|||||||
free(token);
|
free(token);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (snprintf(file, sizeof(file), "%s/libstrongswan-%s.so",
|
if (path)
|
||||||
path, token) >= sizeof(file))
|
|
||||||
{
|
{
|
||||||
return FALSE;
|
if (snprintf(buf, sizeof(buf), "%s/libstrongswan-%s.so",
|
||||||
|
path, token) >= sizeof(buf))
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
file = buf;
|
||||||
}
|
}
|
||||||
if (!load_plugin(this, token, file, critical) && critical)
|
if (!load_plugin(this, token, file, critical) && critical)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user