[EMAIL PROTECTED] writes:
> Modified: trunk/openvas-libraries/libopenvas/comm.h
> ===================================================================
> --- trunk/openvas-libraries/libopenvas/comm.h 2008-04-30 17:28:13 UTC (rev
> 841)
> +++ trunk/openvas-libraries/libopenvas/comm.h 2008-04-30 19:16:43 UTC (rev
> 842)
> @@ -56,6 +56,7 @@
> regarding the start and end of the whole scan
> and of each server (msg TIME)
> */
> + int plugins_oid:1; /* the the OID of the plugins along with their version
> */
> int plugins_cve_id:1; /* the the CVE ID of the plugins along with
> their version */
>
> int dns:1; /* send the host name and host ip */
I'm don't think it's a good idea to introduce this flag yet. It
describes the protocol between client and server and we haven't changed
that yet. Also, that flag is not used anywhere yet and it's a binary
incompatible change in libopenvas. Furthermore, there are some
potentially nasty problems with openvas-server which has it's own copy
of the ntp_caps struct in openvas-server/include/openvas-devel.h.
There's an #ifdef in openvas-libraries/libopenvas/comm.h to make sure
that libopenvas/comm.h's version of ntp_caps is not compiled when
openvas-devel.h has been included. So it seems that we need to make
sure to keep both copies in sync. It would, of course, be better to
only have one definition of that struct.
> Modified: trunk/openvas-libraries/libopenvas/plugutils.c
> ===================================================================
> --- trunk/openvas-libraries/libopenvas/plugutils.c 2008-04-30 17:28:13 UTC
> (rev 841)
> +++ trunk/openvas-libraries/libopenvas/plugutils.c 2008-04-30 19:16:43 UTC
> (rev 842)
> @@ -246,7 +246,26 @@
> return _plug_get_id(desc); /* Never cached */
> }
>
> +void plug_set_oid(desc, id)
> + struct arglist * desc;
> + char *id;
> +{
> + // TODO: check if OID set
> + arg_add_value(desc, "OID", ARG_STRING, strlen(id), estrdup(id));
> +}
Please do not use old K&R style function definitions in new code. It
would also be nice if we could make sure new code adheres to some kind
of coding standard. Most of the code I've been writing have followed
the GNU coding standard's rules for C code formatting with the exception
of the spaces before the open parentheses in function calls. The reason
for this choice was that it was what the code I was modifying was
almost using already. The above function would look like this:
void
plug_set_oid(struct arglist * desc, char *id)
{
// TODO: check if OID set
arg_add_value(desc, "OID", ARG_STRING, strlen(id), estrdup(id));
}
OTOH, given that plugutils.c is relatively consistent in following some
other standard (apart from the function declarations) it's not a problem
if new code in plugutils.c follows the style of that file, I guess.
> Modified: trunk/openvas-libraries/libopenvas/store_internal.h
> ===================================================================
> --- trunk/openvas-libraries/libopenvas/store_internal.h 2008-04-30
> 17:28:13 UTC (rev 841)
> +++ trunk/openvas-libraries/libopenvas/store_internal.h 2008-04-30
> 19:16:43 UTC (rev 842)
> @@ -16,6 +16,7 @@
> struct plugin {
> char magic;
> int id;
> + char oid [1024];
> char path [256];
> int timeout;
> int category;
> @@ -37,7 +38,7 @@
> char required_ports [64];
> char required_udp_ports [64];
> int has_prefs:1;
> - };
> +};
This changes the format of the files in the plugin description cache.
AFAICT we need to change the value for the magic field at the beginning
of struct plugin to make sure that the old cache entries are considered
invalid.
Bernhard
--
Bernhard Herzog Intevation GmbH, Osnabrück
Amtsgericht Osnabrück, HR B 18998 http://www.intevation.de/
Geschäftsführer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner
_______________________________________________
Openvas-devel mailing list
[email protected]
http://lists.wald.intevation.org/mailman/listinfo/openvas-devel