Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Nessus: commits

NessusClient/nessus context.h, 1.11, 1.12 context.c, 1.9, 1.10 comm.c, 1.15, 1.16

 

 

Nessus commits RSS feed   Index | Next | Previous | View Threaded


bh at nessus

Apr 27, 2006, 12:54 PM

Post #1 of 1 (605 views)
Permalink
NessusClient/nessus context.h, 1.11, 1.12 context.c, 1.9, 1.10 comm.c, 1.15, 1.16

Update of /usr/local/cvs/NessusClient/nessus
In directory raccoon.nessus.org:/tmp/cvs-serv62225/nessus

Modified Files:
context.h context.c comm.c
Log Message:
Refactor the code to reset the plugin information of a context into a
separate function (context_reset_plugins) and call it from appropriate places.


Index: context.h
===================================================================
RCS file: /usr/local/cvs/NessusClient/nessus/context.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- context.h 27 Apr 2006 16:09:48 -0000 1.11
+++ context.h 27 Apr 2006 19:54:53 -0000 1.12
@@ -85,6 +85,7 @@
void context_reset_plugin_tree(struct context*);
void context_add_plugin(struct context*, struct nessus_plugin*);
void context_load_plugin_cache(struct context *context);
+void context_reset_plugins(struct context *context);
#ifdef USE_GTK
void context_collect(struct context*);
void context_rename(struct context*, const char*);

Index: context.c
===================================================================
RCS file: /usr/local/cvs/NessusClient/nessus/context.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- context.c 27 Apr 2006 16:09:48 -0000 1.9
+++ context.c 27 Apr 2006 19:54:53 -0000 1.10
@@ -99,6 +99,16 @@
#endif
}

+/* Reset the plugin information of the context */
+void
+context_reset_plugins(struct context *context)
+{
+ nessus_plugin_free(context->plugins);
+ nessus_plugin_free(context->scanners);
+ context->plugins = NULL;
+ context->scanners = NULL;
+ context_reset_plugin_tree(context);
+}

/*
* Add a plugin to the context. If the plugin is a scanner, it's added
@@ -503,13 +513,9 @@
while(context->children)
context_delete(context->children);

- context_reset_plugin_tree(context);
arg_free_all(context->prefs);
context->prefs = NULL;
- nessus_plugin_free(context->plugins);
- nessus_plugin_free(context->scanners);
- context->plugins = NULL;
- context->scanners = NULL;
+ context_reset_plugins(context);
arg_free_all(context->dependencies);
context->dependencies = NULL;
context_delete_directory(context->dir);

Index: comm.c
===================================================================
RCS file: /usr/local/cvs/NessusClient/nessus/comm.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- comm.c 26 Apr 2006 13:22:54 -0000 1.15
+++ comm.c 27 Apr 2006 19:54:53 -0000 1.16
@@ -1144,11 +1144,7 @@
char * server_md5sum = NULL;
int cache_status = -1;

-#ifdef USE_GTK
- context_reset_plugin_tree(context);
-#endif
- context->plugins = NULL;
- context->scanners = NULL;
+ context_reset_plugins(context);

bufsz = 1024 * 1024;
buf = emalloc(bufsz);

_______________________________________________
Nessus-cvs mailing list
Nessus-cvs [at] list
http://mail.nessus.org/mailman/listinfo/nessus-cvs

Nessus commits RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.