Hello Sebastien, On Freitag, 22. Juni 2012, Sebastien Aucouturier wrote: > as i need the plugin's Family in each result in report, i do > modification in openvasmd code. > Is it a enhanced that can be put in next release ?
thanks for the submission! First a general hint: If you create modification, it is best to use something like "svn diff > family-in-results.patch" if you are working with SVN trunk. Or "svn diff src/manage_sql.c.orig src/manage_sql.c > family-in-results.patch" if you used a tarball and of course created a backup file of the original version. This way we can easily apply the patch for testing. ("patch < family-in-results.patch") Now for your patch: I realize that we have some redundancy already with the <nvt> object inside results. Adding yet another redundancy won't probably hurt much, but doesn't make it better neither. If yo are about to write a special OMP client, you may already want to try using command <get_info> for the details of a NVT. BTW: I think the "family : ..." is positioned wrong anyway ... ? I wonder whether we should take this opportunity and create a section <nvts> <nvt oid="..."> </nvt> ... </nvts> into the report and only have references in the results via the OID. Then we could add the full NVT information in there always. It has the disadvantage of obligating clients to de-refernce inside the XML. How do people here feel about this? Best Jan > src/manage_sql.c : line 13277 > /** > * @brief Get the NVT Family from a result iterator. > * > * @param[in] iterator Iterator. > * > * @return The Family of the NVT that produced the result, or NULL on > error. > */ family ? family : "", > const char* > result_iterator_nvt_family (iterator_t *iterator) > { > nvti_t *nvti; > if (iterator->done) return NULL; > nvti = nvtis_lookup (nvti_cache, result_iterator_nvt_oid (iterator)); > if (nvti) > return nvti_family (nvti); > return NULL; > } > > src/omp.c : line 7105 > const char *family = result_iterator_nvt_family(results); > > src/omp.c : line 7136 > buffer_xml_append_printf > (buffer, > "<subnet>%s</subnet>" > "<host>%s</host>" > "<port>%s</port>" > "<nvt oid=\"%s\">" > "<name>%s</name>" > "<family>%s</family>" > "<cvss_base>%s</cvss_base>" > "<risk_factor>%s</risk_factor>" > "<cve>%s</cve>" > "<bid>%s</bid>" > "<xref>%s</xref>" > "</nvt>" > "<threat>%s</threat>" > "<description>%s</description>", > result_iterator_subnet (results), > result_iterator_host (results), > family ? family : "", > result_iterator_port (results), > result_iterator_nvt_oid (results), > name ? name : "", > cvss_base ? cvss_base : "", > risk_factor ? risk_factor : "", > cve ? cve : "", > bid ? bid : "", > xref ? xref : "", > manage_result_type_threat (result_iterator_type (results)), > descr ? nl_descr : ""); > > src/manage.h : line 805 > const char* > result_iterator_nvt_family (iterator_t *); > -- Dr. Jan-Oliver Wagner | ++49-541-335084-0 | http://www.greenbone.net/ Greenbone Networks GmbH, Neuer Graben 17, 49074 Osnabrück | AG Osnabrück, HR B 202460 Geschäftsführer: Lukas Grunwald, Dr. Jan-Oliver Wagner _______________________________________________ Openvas-devel mailing list Openvas-devel@wald.intevation.org http://lists.wald.intevation.org/cgi-bin/mailman/listinfo/openvas-devel