Mailing List Archive

NessusClient/nessus comm.c,1.18,1.19
Update of /usr/local/cvs/NessusClient/nessus
In directory raccoon.nessus.org:/tmp/cvs-serv75251

Modified Files:
comm.c
Log Message:
First part of fixing bug 1414:
http://bugs.nessus.org/show_bug.cgi?id=1414
This part takes care the Server only gets radio prefs
cut down to the first element of a ;-separated list.


Index: comm.c
===================================================================
RCS file: /usr/local/cvs/NessusClient/nessus/comm.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- comm.c 10 May 2006 07:51:46 -0000 1.18
+++ comm.c 17 May 2006 12:28:18 -0000 1.19
@@ -662,7 +662,26 @@
arg_add_value(pprefs, fullname, ARG_STRING, strlen(value),
strdup(value));
}
- network_printf(context->socket, "%s[%s]:%s <|> %s\n", plugs->name, type, name, value);
+
+ /* This cuts down the list of alternatives (separated by ';')
+ * down to just the first element, because the Nessus Server
+ * does not handle cutting itself.
+ * Background: The value of a "radio" preference is the set
+ * of possible values at one point (sent by Server and managed
+ * within the NessusClient) and the value chosen by the user at another
+ * (execution time of a scan by Nessus Server).
+ */
+ if(!strcmp(type, PREF_RADIO))
+ {
+ char * t, * v;
+ v = strdup(value);
+ if (v && (t = strchr(v, ';')))
+ t[0] = 0;
+ network_printf(context->socket, "%s[%s]:%s <|> %s\n", plugs->name, type, name, v);
+ free(v);
+ } else
+ network_printf(context->socket, "%s[%s]:%s <|> %s\n", plugs->name, type, name, value);
+
if(!strcmp(type, PREF_FILE))
{
if(!files_to_send)

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