Mailing List Archive

NessusClient/nessus report.c,1.5,1.6 preferences.c,1.4,1.5
Update of /usr/local/cvs/NessusClient/nessus
In directory raccoon.nessus.org:/tmp/cvs-serv51994/nessus

Modified Files:
report.c preferences.c
Log Message:
Make the use of the plugin cache for report contexts options and
configurable in the preferences dialog


Index: report.c
===================================================================
RCS file: /usr/local/cvs/NessusClient/nessus/report.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- report.c 26 Apr 2006 13:22:53 -0000 1.5
+++ report.c 27 Apr 2006 14:09:11 -0000 1.6
@@ -38,6 +38,7 @@
#include "nbe_output.h"

#include "comm.h"
+#include "preferences.h"

/* returns filename of report (must be freed) or NULL */
char *
@@ -151,20 +152,24 @@
return;
}

- copy_plugins(report_context, context->plugins);
- copy_plugins(report_context, context->scanners);
-
- error = plugin_cache_write(report_context, "");
- if(error)
+ if (prefs_get_int(Global, "reports_use_plugin_cache"))
{
- show_error(_("report_save() couldn't save the plugin information"));
- return;
+ copy_plugins(report_context, context->plugins);
+ copy_plugins(report_context, context->scanners);
+
+ error = plugin_cache_write(report_context, "");
+ if(error)
+ {
+ show_error(_("report_save() couldn't save the plugin information"));
+ return;
+ }
+
+ /* by the time we get here, the report_context may already have got a
+ * plugin tree because scopetree_new_with_parent may trigger GUI
+ * updates, so we have to reset the tree. */
+ context_reset_plugin_tree(report_context);
}

- /* by the time we get here, the report_context may already have got a
- * plugin tree because scopetree_new_with_parent may trigger GUI
- * updates, so we have to reset the tree. */
- context_reset_plugin_tree(report_context);
prefs_context_update(report_context);
}

@@ -224,7 +229,8 @@
report_load_plugin_cache(struct context *context)
{
if (context->type == CONTEXT_REPORT && !context->report_plugin_cache_loaded
- && context->plugins == NULL)
+ && context->plugins == NULL
+ && prefs_get_int(Global, "reports_use_plugin_cache"))
{
/* FIXME: plugin_cache_read may fail. for the time being we can
* ignore this as the most likely reason is that there simply isn't

Index: preferences.c
===================================================================
RCS file: /usr/local/cvs/NessusClient/nessus/preferences.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- preferences.c 3 Feb 2006 21:31:51 -0000 1.4
+++ preferences.c 27 Apr 2006 14:09:11 -0000 1.5
@@ -716,6 +716,8 @@
return (void *)1;
else if(!strcmp(name, "cache_plugin_information"))
return (void *)1;
+ else if(!strcmp(name, "reports_use_plugin_cache"))
+ return (void *)1;
else
return NULL;
}

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