[Openvas-commits] r1653 - in trunk/openvas-server: . openvasd
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Fri Oct 31 11:32:37 CET 2008
Author: felix
Date: 2008-10-31 11:32:37 +0100 (Fri, 31 Oct 2008)
New Revision: 1653
Modified:
trunk/openvas-server/ChangeLog
trunk/openvas-server/openvasd/nasl_plugins.c
Log:
* openvasd/nasl_plugins.c (nasl_plugin_add): Replaced obsolete ID check
by OID check (might have excluded id-less scripts), added comment.
M openvasd/nasl_plugins.c
M ChangeLog
Modified: trunk/openvas-server/ChangeLog
===================================================================
--- trunk/openvas-server/ChangeLog 2008-10-31 09:12:13 UTC (rev 1652)
+++ trunk/openvas-server/ChangeLog 2008-10-31 10:32:37 UTC (rev 1653)
@@ -1,3 +1,8 @@
+2008-10-31 Felix Wolfsteller <felix.wolfsteller at intevation.de>
+
+ * openvasd/nasl_plugins.c (nasl_plugin_add): Replaced obsolete ID check
+ by OID check (might have excluded id-less scripts), added comment.
+
2008-10-17 Felix Wolfsteller <felix.wolfsteller at intevation.de>
* openvasd/nsp.h: Removed. Contained include guard and gpl only.
Modified: trunk/openvas-server/openvasd/nasl_plugins.c
===================================================================
--- trunk/openvas-server/openvasd/nasl_plugins.c 2008-10-31 09:12:13 UTC (rev 1652)
+++ trunk/openvas-server/openvasd/nasl_plugins.c 2008-10-31 10:32:37 UTC (rev 1653)
@@ -47,15 +47,19 @@
static void nasl_thread(struct arglist *);
-/*
- * Add *one* .nasl plugin to the plugin list
+/**
+ * Add *one* .nasl plugin to the plugin list and return the pointer to it.
+ * The plugin is first attempted to be loaded from the cache (.desc) calling
+ * load_store_plugin. If that fails, it is parsed (via execute_nasl_script).
+ * @param folder Path to the plugin folder.
+ * @param name File-name of the plugin.
+ * @param plugins The arglist that the plugin shall be added to.
+ * @param preferences The plugins preferences.
+ * @return Pointer to the plugin (as arglist). NULL in case of errors.
*/
static struct arglist *
-nasl_plugin_add(folder, name, plugins, preferences)
- char * folder;
- char * name;
- struct arglist * plugins;
- struct arglist * preferences;
+nasl_plugin_add(char* folder, char* name, struct arglist* plugins,
+ struct arglist* preferences)
{
char fullname[PATH_MAX+1];
struct arglist *plugin_args;
@@ -90,7 +94,7 @@
return NULL;
}
plug_set_path(plugin_args, fullname);
- if(plug_get_id(plugin_args) > 0)
+ if(plug_get_oid(plugin_args) != NULL)
{
store_plugin(plugin_args, name);
plugin_args = store_load_plugin(folder, name, preferences);
@@ -105,7 +109,7 @@
return NULL;
}
- if(plug_get_id(plugin_args) == 0)
+ if(plug_get_oid(plugin_args) == NULL)
{
plugin_free(plugin_args);
return NULL;
More information about the Openvas-commits
mailing list