Mailing List Archive

NessusClient/nessus report.c, 1.4, 1.5 comm.h, 1.4, 1.5 comm.c, 1.14, 1.15
Update of /usr/local/cvs/NessusClient/nessus
In directory raccoon.nessus.org:/tmp/cvs-serv5392/nessus

Modified Files:
report.c comm.h comm.c
Log Message:
Avoid warnings about unknown plugins when loading the plugin prefs from
nessusrc and the plugins from the cache as is now done for reports.
nessusrc may contain prefs for plugins which are not in the plugin
cache.


Index: report.c
===================================================================
RCS file: /usr/local/cvs/NessusClient/nessus/report.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- report.c 25 Apr 2006 15:28:46 -0000 1.4
+++ report.c 26 Apr 2006 13:22:53 -0000 1.5
@@ -207,8 +207,12 @@
fprintf(stderr, "unknown type\n");

if (value != NULL)
+ /* nessusrc and hence PLUGINS_PREFS may contain settings for old
+ * plugins that are not available on the server anymore and which
+ * are therefore also not in the plugin cache. So we deactivate
+ * the warnings about missing plugins in comm_parse_preference */
comm_parse_preference(context, NULL, NULL, context->prefs,
- pref->name, value);
+ pref->name, value, 0);

pref = pref->next;
}

Index: comm.h
===================================================================
RCS file: /usr/local/cvs/NessusClient/nessus/comm.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- comm.h 25 Apr 2006 14:52:34 -0000 1.4
+++ comm.h 26 Apr 2006 13:22:53 -0000 1.5
@@ -66,6 +66,6 @@
#endif

int comm_parse_preference(struct context *, struct arglist *, struct arglist *,
- struct arglist *, char *, char *);
+ struct arglist *, char *, char *, int);

#endif

Index: comm.c
===================================================================
RCS file: /usr/local/cvs/NessusClient/nessus/comm.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- comm.c 25 Apr 2006 14:52:34 -0000 1.14
+++ comm.c 26 Apr 2006 13:22:54 -0000 1.15
@@ -274,11 +274,15 @@
* serv_prefs, serv_infos or plugs_prefs. If the caller knows that the
* preference is a plugin preference the serv_prefs and serv_infos
* parameters may be NULL.
+ *
+ * If the parameter warn_about_unknown_plugins is true, a warning is
+ * printed to stderr if a preference refers to an unknown plugin.
*/
int
comm_parse_preference(struct context *context,
struct arglist *serv_prefs, struct arglist *serv_infos,
- struct arglist *plugs_prefs, char *buf, char *value)
+ struct arglist *plugs_prefs, char *buf, char *value,
+ int warn_about_unknown_plugins)
{
char *pref;
char *v;
@@ -373,11 +377,14 @@
plugin = nessus_plugin_get_by_name(context->scanners, plugname);
if (plugin == NULL)
{
- fprintf(stderr,
- _("Error : we received a preference (%s) for the plugin %s\n"),
- name, plugname);
- fprintf(stderr,
- _("but apparently the server has not loaded it\n"));
+ if (warn_about_unknown_plugins)
+ {
+ fprintf(stderr,
+ _("Error : we received a preference (%s) for the plugin %s\n"),
+ name, plugname);
+ fprintf(stderr,
+ _("but apparently the server has not loaded it\n"));
+ }
return 0;
}
}
@@ -491,7 +498,7 @@
value = v + 5;

comm_parse_preference(context, serv_prefs, serv_infos, plugs_prefs,
- buf, value);
+ buf, value, 1);
}
}
}

_______________________________________________
Nessus-cvs mailing list
Nessus-cvs@list.nessus.org
http://mail.nessus.org/mailman/listinfo/nessus-cvs