plugin-loader: Disable some logging output when building fuzz targets
This avoids evaluating %N. An alternative would be to define a printf-hook for plugin features.
This commit is contained in:
@@ -730,9 +730,11 @@ static bool load_dependencies(private_plugin_loader_t *this,
|
|||||||
|
|
||||||
if (!find_compatible_feature(this, &provided->feature[i]))
|
if (!find_compatible_feature(this, &provided->feature[i]))
|
||||||
{
|
{
|
||||||
char *name, *provide, *depend;
|
|
||||||
bool soft = provided->feature[i].kind == FEATURE_SDEPEND;
|
bool soft = provided->feature[i].kind == FEATURE_SDEPEND;
|
||||||
|
|
||||||
|
#ifndef USE_FUZZING
|
||||||
|
char *name, *provide, *depend;
|
||||||
|
|
||||||
name = provided->entry->plugin->get_name(provided->entry->plugin);
|
name = provided->entry->plugin->get_name(provided->entry->plugin);
|
||||||
provide = plugin_feature_get_string(&provided->feature[0]);
|
provide = plugin_feature_get_string(&provided->feature[0]);
|
||||||
depend = plugin_feature_get_string(&provided->feature[i]);
|
depend = plugin_feature_get_string(&provided->feature[i]);
|
||||||
@@ -753,6 +755,8 @@ static bool load_dependencies(private_plugin_loader_t *this,
|
|||||||
}
|
}
|
||||||
free(provide);
|
free(provide);
|
||||||
free(depend);
|
free(depend);
|
||||||
|
#endif /* !USE_FUZZING */
|
||||||
|
|
||||||
if (soft)
|
if (soft)
|
||||||
{ /* it's ok if we can't resolve soft dependencies */
|
{ /* it's ok if we can't resolve soft dependencies */
|
||||||
continue;
|
continue;
|
||||||
@@ -772,8 +776,6 @@ static void load_feature(private_plugin_loader_t *this,
|
|||||||
{
|
{
|
||||||
if (load_dependencies(this, provided, level))
|
if (load_dependencies(this, provided, level))
|
||||||
{
|
{
|
||||||
char *name, *provide;
|
|
||||||
|
|
||||||
if (plugin_feature_load(provided->entry->plugin, provided->feature,
|
if (plugin_feature_load(provided->entry->plugin, provided->feature,
|
||||||
provided->reg))
|
provided->reg))
|
||||||
{
|
{
|
||||||
@@ -783,6 +785,9 @@ static void load_feature(private_plugin_loader_t *this,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef USE_FUZZING
|
||||||
|
char *name, *provide;
|
||||||
|
|
||||||
name = provided->entry->plugin->get_name(provided->entry->plugin);
|
name = provided->entry->plugin->get_name(provided->entry->plugin);
|
||||||
provide = plugin_feature_get_string(&provided->feature[0]);
|
provide = plugin_feature_get_string(&provided->feature[0]);
|
||||||
if (provided->entry->critical)
|
if (provided->entry->critical)
|
||||||
@@ -796,6 +801,7 @@ static void load_feature(private_plugin_loader_t *this,
|
|||||||
provide, name);
|
provide, name);
|
||||||
}
|
}
|
||||||
free(provide);
|
free(provide);
|
||||||
|
#endif /* !USE_FUZZING */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ /* TODO: we could check the current level and set a different flag when
|
{ /* TODO: we could check the current level and set a different flag when
|
||||||
@@ -815,13 +821,16 @@ static void load_provided(private_plugin_loader_t *this,
|
|||||||
provided_feature_t *provided,
|
provided_feature_t *provided,
|
||||||
int level)
|
int level)
|
||||||
{
|
{
|
||||||
char *name, *provide;
|
|
||||||
int indent = level * 2;
|
int indent = level * 2;
|
||||||
|
|
||||||
if (provided->loaded || provided->failed)
|
if (provided->loaded || provided->failed)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef USE_FUZZING
|
||||||
|
char *name, *provide;
|
||||||
|
|
||||||
name = provided->entry->plugin->get_name(provided->entry->plugin);
|
name = provided->entry->plugin->get_name(provided->entry->plugin);
|
||||||
provide = plugin_feature_get_string(provided->feature);
|
provide = plugin_feature_get_string(provided->feature);
|
||||||
if (provided->loading)
|
if (provided->loading)
|
||||||
@@ -834,6 +843,12 @@ static void load_provided(private_plugin_loader_t *this,
|
|||||||
DBG3(DBG_LIB, "%*sloading feature %s in plugin '%s'",
|
DBG3(DBG_LIB, "%*sloading feature %s in plugin '%s'",
|
||||||
indent, "", provide, name);
|
indent, "", provide, name);
|
||||||
free(provide);
|
free(provide);
|
||||||
|
#else
|
||||||
|
if (provided->loading)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif /* USE_FUZZING */
|
||||||
|
|
||||||
provided->loading = TRUE;
|
provided->loading = TRUE;
|
||||||
load_feature(this, provided, level + 1);
|
load_feature(this, provided, level + 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user