2013-02-22  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	Replace index on affected_products (cve, cpe) by two separate ones for
	each column to speed up queries on that table slowing down updates.

	* tools/greenbone-scapdata-sync (VERSION): Update.
	(db_migrate_9): New database migration funcion.
	(check_db_version): Migrate to version 9 from version 8.

	* tools/openvas-scapdata-sync.in (db_migrate_9): New database migration
	function.
	(check_db_version): Migrate to version 9 from version 8.

	* tools/scap_db_init.sql (afp_idx): Remove. Replaced by afp_cve_idx and
	afp_cpe_idx.
	(afp_cve_idx): New index on affected_products (cve).
	(afp_cpe_idx): New index on affected_products (cpe).

2013-02-22  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 4.0+beta5 release.

	* CHANGES: Updated.

	* INSTALL: Updated openvas-libraries dependency.

2013-02-21  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	* tools/greenbone-scapdata-sync, tools/openvas-scapdata-sync.in
	(list_oval_files_sortable, update_sec_db): Add quotes to allow syncing
	when $SCAP_DIR is the current directory.

2013-02-21  Werner Koch  <wk@gnupg.org>

	* src/manage_sql.c (manage_set_setting): Re-word password
	diagnostic.

2013-02-20  Werner Koch  <wk@gnupg.org>

	Check password policy.

	* src/openvasmd.c: Include openvas/base/pwpolicy.h.
	(main): Add option --disable-password-policy.

	* src/manage_sql.c: Include openvas/base/pwpolicy.h.
	(manage_set_setting): Call openvas_validate_password and add new
	arg R_ERRDESC.
	* src/manage.h: Update prototype for this.
	* src/omp.c (make_xml_error_syntax): New.
	(omp_xml_handle_end_element) <CLIENT_MODIFY_SETTING>: Send back an
	error string for an invalid password.

2013-02-20  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	* tools/openvas-certdata-sync.in: Enable rsync and add --refresh option.
	(do_help): Add text for --refresh.
	(do_rsync): Enable previously commented out rsync code, remove now
	obsolete warning and add $RSYNC_DELETE.
	(do_refresh): New function.
	(): Add case for --refresh.

2013-02-20  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	* tools/openvas-scapdata-sync.in (do_refresh): Move to prevent possible
	problems with shells not finding update_sec_db.

2013-02-20  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	* tools/openvas-scapdata-sync.in (): Add command line option --refresh
	to update database without downloading feed data.
	(do_help): Add text for new --refresh option.
	(do_refresh): New function.

2013-02-20  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	* tools/openvas-scapdata-sync.in: Remove / disable http feed download.
	(do_help): Remove text for --wget and --curl.
	(CMD_WGET, CMD_CURL): Remove
	(chk_system_tools): Remove wget and curl checks
	(do_wget, do_curl): Change to exit with warning.
	(do_sync): Change to only try rsync.

2013-02-20  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	Add private subdirectory functionality in OpenVAS sync scripts.

	* tools/openvas-certdata-sync.in (PRIVATE_SUBDIR, RSYNC_DELETE): New.
	(do_help): Add line for PRIVATE_SUBDIR as environment variable.

	* tools/openvas-scapdata-sync.in (PRIVATE_SUBDIR): New.
	(RSYNC_DELETE): Add --exclude for private subdirectory.
	(do_help): Add line for PRIVATE_SUBDIR as environment variable.

2013-02-20  Michael Wiegand <michael.wiegand@greenbone.net>

	Move "-Werror" flag to the "Debug" build type.

	* CMakeLists.txt: Move "-Werror" from CMAKE_C_FLAGS to
	CMAKE_C_FLAGS_DEBUG to keep it out of the "Release" build type.

2013-02-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_parser_new): Clear parser memory on allocation, so that
	parent_state is 0 initially.  This prevents the end handler from setting
	the client state to some arbitrary number after reading over an element,
	for example when importing a report.

2013-02-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_empty_trashcan): Empty notes and overrides
	too.

2013-02-19  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	* src/omp.c (client_state_t): Add client states for cert and cert_ref
	elements in create_report.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add cert
	and cert_ref elements in create_report.

2013-02-19  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (manage_set_setting): Add Reports Filter setting.

	* src/omp.c (omp_xml_handle_element): Check for settings default report
	filter when no filter and filt_id are provided in GET_REPORTS case.

2013-02-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_start_element)
	(omp_xml_handle_end_element): Set the importing flag around
	CREATE_REPORT, to read-over new elements in reports.

2013-02-19  Andre Heinecke <andre.heinecke@greenbone.net>

	* report_formats/verinice-ism/gsm_verinice_ism.xsl (control_details):
	Add gsm_control_tag that is a comma seperated list of tags
	based on the notes description. If a line in the description starts
	with + it will be interpreted as a "Tag"

2013-02-19  Andre Heinecke <andre.heinecke@greenbone.net>

	* report_formats/verinice-ism/gsm_verinice_ism.xsl (scenario_details):
	Add cvss and fix cve and threat values

2013-02-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* tools/greenbone-scapdata-sync: Run sqlite3 via SQLITE3 variable, to
	specify -noheader, because the user may have .headers on in .sqliterc.
	(SCAP_RES_DIR): Skip /usr/ when there's a PREFIX.

2013-02-18  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage.c (get_nvti_xml), src/omp.c (buffer_results_xml)
	(omp_xml_handle_end_element): Add output of warning message in
	CERT elements if CERT database is missing to fix errors when NVTs are
	accessed in this case.

	* src/schema_formats/XML/OMP.xml, doc/omp.html, doc/omp.rnc: Add
	warning message elements for CERT reference elements.

2013-02-18  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* tools/dfn_cert_update.xsl: Fix XSL select returning empty IDs for
	dfn_cert_cves insert.

2013-02-18  Andre Heinecke <andre.heinecke@greenbone.net>

	* report_formats/verinice-ism/gsm_verinice_ism.xsl: Add
	gsm_ism_control_cpe based on result/detection value

2013-02-14  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* INSTALL: Added some more details on how to change the encryption key.

2013-02-14  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* tools/dfn_cert_getbyname.xsl, tools/dfn_cert_update.xsl: Change to
	get ID from new <dfncert:refnum> element instead of extracting it from
	<title>.

2013-02-14  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* doc/about-cert-feed.txt: Change text for short ID elements to
	consider new <dfncert:refnum> element.

2013-02-14  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage.c (DFN_CERT_ADV_FILENAME_FMT, get_dfn_cert_adv_filename):
	Change file name format back to DFN-CERT-YYYY-n.

	* src/manage_sql.c (get_dfn_cert_adv_date): Remove.

	* src/manage_sql.h (get_dfn_cert_adv_date): Remove.

2013-02-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (NOTE_ITERATOR_TRASH_COLUMNS)
	(OVERRIDE_ITERATOR_TRASH_COLUMNS): Use trash table instead of real
	table.

2013-02-13  Werner Koch  <wk@gnupg.org>

	* src/openvasmd.c (main): Add options --encrypt-all-credentials
	and --decrypt-all-credentials.
	* src/manage_sql.c (do_encrypt_all_credentials)
	(manage_encrypt_all_credentials): New.
	* src/manage.h (manage_encrypt_all_credentials): New prototype.

	* src/lsc_crypt.c: Remove all tracepoint debug output.

2013-02-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* TODO: Remove completed and out of date items.

2013-02-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Remove test framework.

	* CMakeLists.txt: Remove testing.

	* src/CMakeLists.txt: Remove testing comments.

	* src/tests/: Remove.

2013-02-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/CMakeLists.txt (C_FILES): Add lsc_crypt.c.

2013-02-13  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* doc/about-cert-feed.txt: New. Most text by Timo Pollmeier.

2013-02-11  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/otp.c (parse_scanner_plugin_list_tags): Replace ';' with '\n' in
	tags.

2013-02-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (slave_setup): Specify levels and apply_overrides in
	GET_REPORTS call instead of relying on defaults.

2013-02-07  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* tools/openvas-scapdata-sync.in (RSYNC_DELETE): New variable.
	(do_rsync): Add RSYNC_DELETE to rsync call: Files are now deleted
	locally when they are not part of the rsync feed, analogous to
	greenbone-scapdata-sync.

2013-02-06  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* tools/greenbone-scapdata-sync: Activated RSYNC_DELETE with
	--delete --exclude=scap.db so that from now on files are deleted
	locally when deleted on the feed server.

2013-02-06  Michael Wiegand <michael.wiegand@greenbone.net>

	* doc/CMakeLists.txt: Prevent superfluous creation of "doc/html/"
	directory inside the source tree.

2013-02-06  Michael Wiegand <michael.wiegand@greenbone.net>

	* doc/footer.html: Removed obsolete file.

2013-02-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (NOTE_ITERATOR_FILTER_COLUMNS): Add more filtering
	fields.
	(NOTE_ITERATOR_COLUMNS, NOTE_ITERATOR_TRASH_COLUMNS): Add task_name and
	task_id, for filtering.

2013-02-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (OVERRIDE_ITERATOR_FILTER_COLUMNS): Add task_id.
	(OVERRIDE_ITERATOR_COLUMNS, OVERRIDE_ITERATOR_TRASH_COLUMNS): Select the
	task ID.

2013-02-05  Matthew Mundell <matthew.mundell@greenbone.net>

	Get host details with slave reports.  This makes OS detection work with
	slave tasks.

	* src/manage.c (slave_setup): Add host details when setting host end
	times.

	* src/manage_sql.c (manage_report_host_details): New function.  Body
	from manage_report_host_detail.
	(manage_report_host_detail): Call manage_report_host_details to add
	details.

	* src/manage_sql.h: Add header accordingly.

2013-02-05  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* tools/openvas-certdata-sync.in (do_sync): Fix warning message saying
	"curl" where it should be "rsync".

2013-02-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (slave_setup): Get the report with omp_get_report_ext
	in order to specify result_host_only.  Set result_host_only 0 in the
	Done case so that all the hosts show up with their end times.  Move
	setting the end times back to the Done case.  The problem with setting
	the end times while the task is Running is that the GET_REPORT could
	happen between the last result and the host end.

2013-02-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (set_scan_host_end_time, set_scan_host_end_time_otp)
	(set_scan_host_start_time, set_scan_host_start_time_otp): Quote host.

2013-02-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (slave_setup): Set the host end times after adding
	results when Running and Done, instead of only when Done.  This is
	required because the results for some hosts may only show up during the
	Running stage, for example when scanning many hosts.

2013-02-01  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* doc/omp.html, doc/omp.rnc, src/schema_formats/XML/OMP.xml: Add
	documentation for modify_agent, modify_alert, modify_port_list and
	modify_slave.

2013-02-01  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (modify_alert): Update alert event, method and
	condition and their data independently.

	* src/omp.c (omp_xml_handle_end_element): Allow non provided parameters
	to permit modifying them separately.

2013-02-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/lsc_crypt.c (get32): Shift the right direction.

2013-02-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (cleanup_manage_process): Add note on how to find
	open statements.

2013-02-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (report_count, report_count_filtered)
	(report_counts_id_filt): Also finalize the full statement.

2013-02-01  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* doc/omp.html, doc/omp.rnc, src/schema_formats/XML/OMP.xml: Update
	documentation for get_slaves, get_targets and get_tasks.

2013-02-01  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (send_to_sourcefire, send_to_verinice): Call
	cleanup_manage_process after forking.

2013-02-01  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (manage_cert_loaded): Fix comment saying SCAP
	instead of CERT.
	(ovaldef_info_iterator_deprecated): Fix comment typo.
	(get_ovaldef_short_filename): Fix wrong info in @return comment.

	* src/manage.c (get_ovaldef_filename): Fix comment typo.

2013-01-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (cleanup_manage_process): In the fork process case,
	skip the sqlite3_close because that could affect the same handle in the
	parent.
	(manage_report, manage_send_report): Call cleanup_manage_process after
	forking, and remove the "clearing the parent state" because the added
	cleanup_manage_process will clear task_db.  Thanks to Hani for
	suggesting a change like this.

2013-01-31  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* doc/omp.html, doc/omp.rnc, src/schema_formats/XML/OMP.xml: Update
	documentation for get_port_lists, get_report_format and get_schedules.

2013-01-31  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* doc/omp.html, doc/omp.rnc, src/schema_formats/XML/OMP.xml: Update
	documentation for get_lsc_credentials, get_notes, get_overrides.

2013-01-31  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Remove duplicate login and
	pass tags when targets are requested in GET_LSC_CREDENTIALS case.

2013-01-31  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* doc/omp.html, doc/omp.rnc, src/schema_formats/XML/OMP.xml: Update
	documentation for get_agents, get_configs and get_alerts commands.

2013-01-31  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (omp_xml_handle_end_element): Remove duplicate in_use
	tag in GET_AGENTS.

2013-01-31  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (setting_filter): Style fix.

2013-01-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (report_filter_term): Default levels to hmlgd to match
	print_report_xml.  This keeps GET_REPORTS backward compatible, which is
	important for example when getting the report from a slave.

2013-01-30  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (setting_filter): Restrict to global filters or
	current user's filters.

2013-01-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (OVERRIDE_ITERATOR_FILTER_COLUMNS): Add more filtering
	fields.
	(OVERRIDE_ITERATOR_COLUMNS, OVERRIDE_ITERATOR_TRASH_COLUMNS): Add
	task_name, for filtering.

2013-01-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_override, manage_restore): Clear report count
	cache when deleting or restoring an override.

2013-01-28  Werner Koch  <wk@gnupg.org>

	Support encrypted credentials.

	* src/lsc_crypt.c, src/lsc_crypt.h: New.
	* src/CMakeLists.txt: Add lsc_crypt.c to library manage.
	* src/manage.h: Include "lsc_crypt.h".
	* src/manage_sql.c (create_lsc_credential): Support encrypted
	credentials.
	(set_lsc_credential_password): Ditto.
	(lsc_credential_iterator_pass_or_priv): New.
	(lsc_credential_iterator_password): Re-implement using the new
	function.
	(lsc_credential_iterator_private_key): Ditto.
	* src/sql.c (init_prepared_iterator): Clear that field.
	(init_iterator): Ditto.
	(cleanup_iterator): Release crypto context.
	(next): Call lsc_crypt_flush.
	* src/openvasmd.c (disable_encrypted_credentials): New global
	variable.
	(main): Add options --disable-encrypted-credentials and
	--create-credentials-encryption-key.
	* doc/db_postgres.sql (lsc_credentials): Add comments.
	* INSTALL (Encrypted Credentials): New.
	* README: Update list of command line options.

2013-01-28  Werner Koch  <wk@gnupg.org>

	* doc/CMakeLists.txt: Make db_postgres.sql related rules work with
	VPATH builds.

2013-01-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (make_nvt_from_nvti): Remove time tags from tags before
	inserting into db.

2013-01-28  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage.c (DFN_CERT_ADV_FILENAME_FMT): Change to YYYY-MM format.
	(get_dfn_cert_adv_filename): Change to get filename by advisory date.

	* src/manage_sql.c (get_dfn_cert_adv_date): New function to get creation
	date of a DFN-CERT advisory.

	* src/manage_sql.h (get_dfn_cert_adv_date): New function.

	* tools/dfn_cert_getbyname, dfn_cert_update: Change URL in xmlns:dfncert
	from "https:" to "http:". Change clipping of entry IDs to use URL from
	id of the feed instead of a fixed URL.

2013-01-28  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Fix more typos.

2013-01-28  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Fix typo.

2013-01-28  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* doc/omp.rnc, doc/omp.html, src/schema_formats/XML/OMP.xml (get_info):
	Add OVAL and DFN-CERT items to get_info type attribute and response,
	including CERT references in CVEs and NVTs.

2013-01-28  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/schema_formats/XML/OMP.xml (get_info): Fix spelling mistake in
	summary for response element info and indentation for NVT and CVE.

2013-01-27  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Apply default filter when
	filter and filt_id are both null in GET_CLIENT cases.

2013-01-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (get_nvti_xml): Set uuid to oid.

2013-01-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/sql.c (sql_parse_time): Use the timezone in the string to adjust
	the time to UTC.

2013-01-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (get_nvti_xml): Add creation and modification times.

2013-01-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (get_nvti_xml): Move declarations to start of block.  Add
	spaces between function and args.  Flush trailing whitespace.

	* src/manage_sql.c (init_cve_dfn_cert_adv_iterator)
	(init_nvt_dfn_cert_adv_iterator): Indent the SQL so that the right hand
	side of an operation is always to the right of the operator, even when
	on the following line.

	* src/omp.c (buffer_results_xml): Flush trailing whitespace.

2013-01-25  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Add references to CERT for NVTs in NVT details and results.

	* src/manage.c (get_nvti_xml): Add output of CERT references.

	* src/manage.h (init_nvt_dfn_cert_adv_iterator): Add new iterator for
	DFN-CERT advisories indirectly referenced by an NVT via CVEs.

	* src/manage_sql.c (init_nvt_dfn_cert_adv_iterator): Add new iterator
	as for manage.h.

	* src/omp.c (buffer_results_xml): Add output of CERT references.

2013-01-24  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Check filt_id value is equal
	to -2 before applying default filters in CLIENT_GET cases.

2013-01-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/CMakeLists.txt: Remove omp.rnc from HTML installs from last
	commit.

2013-01-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/CMakeLists.txt: Install OMP docs too.
	(doc-omp): New target.

2013-01-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_HELP add a NULL
	guard for help_data->type.

2013-01-23  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (setting_value_int): Indentation update.

2013-01-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Improve IPv6 address validation.

	* src/manage_sql.c (validate_host): Check ::'s.  Check group count.
	(manage_max_hosts): Fail if IPv6 contains a network address or a hyphen.

2013-01-23  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* tools/openvas-scapdata-sync.in (update_sec_db): Change counting of
	OVAL xml files to use find instead of ls.

2013-01-23  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (setting_value_int): Add missing parentheses in sql
	query which led to erroneous values.

2013-01-23  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (manage_set_setting): Adapt to use fixed uuid values
	for settings filters instead of names.

2013-01-23  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* tools/greenbone-scapdata-sync (update_sec_db): Add missing update of
	last_update in scap.db table meta.

2013-01-22  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (manage_set_setting, setting_filter)
	(omp_xml_handle_end_element): Adapt to settings filters name change

2013-01-22  Matthew Mundell <matthew.mundell@greenbone.net>

	When delete of an active task is requested, ensure that the OTP stop
	request will be sent, so that the task can end and be deleted.

	* src/manage.h (TASK_STATUS_DELETE_WAITING)
	(TASK_STATUS_DELETE_ULTIMATE_WAITING): New states.

	* src/manage.c (run_status_name, run_status_name_internal, slave_setup)
	(stop_task): Handle new states.
	(manage_check_current_task): In the delete requested states, send
	STOP_WHOLE_TEST to the scanner, and switch to the delete waiting states.

	* src/manage_sql.c (task_in_use, init_manage, set_task_requested)
	(task_current_report): Handle new states.
	(request_delete_task): Request delete ultimate in the requested state,
	to match other case.
	(request_delete_task_uuid): Match delete states to ultimate flag
	correctly.

	* src/otp.c (process_otp_scanner_input): In SCANNER_TIME_SCAN_END handle
	new delete states and marked the task stopped otherwise it has a delete
	state in the trashcan.

2013-01-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db_postgres.sql: Replace tabs with spaces.

2013-01-21  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (DFN_CERT_ADV_INFO_ITERATOR_FILTER_COLUMNS)
	(DFN_CERT_ADV_INFO_ITERATOR_COLUMNS): Change cve_refs to use alias cves.

2013-01-21  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Add DFN-CERT advisories referencing CVEs to CVE get_info details.

	* src/manage.h (init_cve_dfn_cert_adv_iterator): Add new iterator for
	DFN-CERT advisories referencing CVEs.

	* src/manage_sql.c (init_cve_dfn_cert_adv_iterator): Add new iterator
	for DFN-CERT advisories referencing CVEs.

	* src/omp.c (omp_xml_handle_end_element): In case CLIENT_GET_INFO,
	"cve" info type branch add output of referencing CERT advisories.

	* tools/cert_db_init.sql: Change version number to 3.
	(dfn_cert_cves, dfn_cert_cves_adv_idx, dfn_cert_cves_cve_idx): Add table
	drops and definition as well as indices.
	(dfn_cert_cert_adv_delete): Add deletion trigger on dfn_cert_adv.

	* tools/dfn_cert_update: Add INSERT OR REPLACEs of CVEs into
	dfn_cert_cves.

	* tools/openvas-cert-sync.in (check_db_version): Add reinit on
	version 2.

2013-01-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (slave_setup): Add 404 check for remaining OMP calls in
	poll loop.

2013-01-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Add a "stop giveup" task state, that allow the user to set slave tasks
	to "stopped" when they have been isolated in one of the request states
	due loss of contact with the slave.

	* src/manage.c (run_status_name, run_status_name_internal): Handle "stop
	giveup" like "stop requested".
	(slave_sleep_connect): New function.  Loops trying to connect to slave,
	as before, but also checks for "stop giveup".
	(slave_setup): Check for "stop giveup" in the poll loop.  Call
	slave_sleep_connect to do the connecting.
	(run_slave_task): Call slave_sleep_connect to do the connecting.
	(stop_task): For slave tasks that are in the states that can orphan the
	task from the user, put the task in the new "stop giveup" state to tell
	the run_slave_task process.  The run_slave_task process will giveup on
	the slave and set the task to "stopped".
	(manage_check_current_task): Handle "stop giveup" like "stop requested".

	* src/manage.h (task_status_t): Add TASK_STATUS_STOP_REQUESTED_GIVEUP.

	* src/manage_sql.c (task_in_use, init_manage, set_task_requested)
	(task_current_report, delete_report): Handle "stop giveup" state.

2013-01-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (slave_setup): Check if the first GET_REPORT failed
	before trying the second.

2013-01-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (slave_setup): Remove trace sleep.  If the slave task or
	report is missing, or if the status is missing from the GET_TASKS
	response, then stop trying to contact the slave and put the task into
	Internal Error.

2013-01-18  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	Rename CERT-DB column num_cves to cve_refs for consistency with CPEs.
	Check CERT database availability for get_info

	* src/manage.h (dfn_cert_adv_info_iterator_num_cves): Remove, renamed to
	dfn_cert_adv_info_iterator_cve_refs.
	(dfn_cert_adv_info_iterator_cve_refs): Add, renamed from
	dfn_cert_adv_info_iterator_num_cves.

	* src/manage_sql.c (DFN_CERT_ADV_INFO_ITERATOR_FILTER_COLUMNS)
	(DFN_CERT_ADV_INFO_ITERATOR_COLUMNS): Rename num_cves to cve_refs.
	(dfn_cert_adv_info_iterator_num_cves): Remove, renamed as in manage.h.
	(dfn_cert_adv_info_iterator_cve_refs): New, renamed as in manage.h.

	* src/omp.c (omp_xml_handle_end_element): In case CLIENT_GET_INFO
	add test if CERT database is loaded.
	In "dfn_cert_adv" info type branch change <num_cves> to <cve_refs>.

	* tools/cert_db_init.sql: Change version number to 2.
	(dfn_cert_advs) Change num_cves to cve_refs.

	* tools/dfn_cert_update: Change INSERT to INSERT OR REPLACE.
	Change num_cves to cve_refs.

	* tools/openvas-cert-sync.in (check_db_version): Add reinit on
	version 1.

2013-01-18  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src.omp.c (buffer_notes_xml, buffer_overrides_xml): Increase length
	of excerpt from 40 to 60 characters. Even overlong words will not
	harm the GUI considerably at the new size.

2013-01-18  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/lsc_user.c (lsc_user_keys_create, lsc_user_rpm_create)
	(lsc_user_deb_recreate, lsc_user_exe_recreate, lsc_user_all_create):
	Call openvas_file_remove_recruse instead of openvas_file_rmdir_rf.

	* src/manage_sql.c (migrate_21_to_22, migrate_37_to_38)
	(migrate_54_to_55_format, send_to_sourcefire, send_to_verinice)
	(update_report_format_uuid, init_manage, manage_report)
	(manage_send_report, create_report_format, copy_report_format)
	(delete_report_format, manage_schema, manage_empty_trashcan): Call
	openvas_file_remove_recurse instead of openvas_file_rmdir_rf.

	* src/omp.c (strdiff): Call openvas_file_remove_recurse instead of
	openvas_file_rmdir_rf.

2013-01-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (slave_setup): New function.  Body is the setup part of
	run_slave_task.
	(run_slave_task): Let slave_setup do the setup on the slave.  If
	slave_setup fail just keep trying the entire setup again from scratch
	until it works.

2013-01-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (GET_ITERATOR_COLUMNS_PREFIX): New define.
	(GET_ITERATOR_COLUMNS): Call GET_ITERATOR_COLUMNS_PREFIX.
	(NVT_ITERATOR_COLUMNS_NVTS): New define.  NVT_ITERATOR_COLUMNS with
	"nvts." prefix.
	(select_config_nvts): Use NVT_ITERATOR_COLUMNS macros instead of naming
	the columns explicitly.  This makes the SQL compatible with the
	init_nvt_iterator accessors.

2013-01-17  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* ChangeLog: Fix date of last entry.

2013-01-17  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* ChangeLog: Clean up previous own entries for style consistency.

2013-01-17  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Remove duplicated functions which are now part of base libraries.

	* src/lsc_user.c (file_utils_rmdir_rf, file_utils_copy_file,
	file_utils_move_file): Remove functions.
	(lsc_user_keys_create, lsc_user_rpm_create, lsc_user_deb_create)
	(lsc_user_exe_create, lsc_user_all_create): Use openvas_file_copy,
	openvas_file_move, openvas_file_rmdir_rf functions from libraries
	instead of removed functions

	* src/manage_sql.c: Include openvas_file.h from base libraries.
	(file_utils_copy_file, file_utils_rmdir_rf): Remove duplicated functions.
	(migrate_21_to_22, migrate_37_to_38, migrate_54_to_55_format)
	(send_to_sourcefire, send_to_verinice, update_report_format_uuid)
	(init_manage, manage_report, manage_send_report, create_report_format)
	(create_report_format, copy_report_format, delete_report_format)
	(manage_schema): Use openvas_file functions from base libraries instead
	of removed duplicate functions.

	* src/omp.c: Include openvas_file.h from base libraries.
	(check_is_dir, file_utils_rmdir_rf): Remove duplicate functions.
	(strdiff): Use openvas_file_rmdir_rf instead.

2013-01-17  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Get specific settings filter
	for the info type queried.

	* src/manage_sql.c (manage_set_setting): Check sepecic secinfo types
	instead of secinfo.

2013-01-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* ChangeLog: Put last entry in order.

2013-01-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (RUN_SLAVE_TASK_SLEEP_SECONDS): New define.
	(slave_connect): New function.
	(run_slave_task): Connect to slave with slave_connect.  If the
	connection fails, keep trying.  If there's an error getting the slave
	task or report, keep trying.

2013-01-16  Werner Koch  <wk@gnupg.org>

	* src/manage_sql.c (DEF_ACCESS): Remove multiple identical
	definitions of this macro and the corresponding undefs.  Prefix
	one set of macro uses with "result_iterator_" to accommodate for
	one slightly different version of that macro.

2013-01-16  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_INFO fix misspelled
	opening tag to dfn_cert_adv.

2013-01-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_INFO add missing
	opening tag to dfn_cert_adv case.

2013-01-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Add multiple NVT support to GET_INFO.  Hence increase database
	version to 74.  Add database migration from version 73 to 74.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 74.

	* src/manage_sql.c (create_tables): Add standard GET columns to nvts.
	(migrate_73_to_74): New function.  Adds GET columns, including
	extracting creation and modification times from tags.
	(database_migrators): Add migrate_73_to_74.
	(init_manage_process): Create parse_time and tag SQL functions.
	(NVT_ITERATOR_COLUMNS): Add standard GET columns.
	(NVT_INFO_ITERATOR_FILTER_COLUMNS): New define.  Adjust accessor
	positions accordingly.
	(init_nvt_info_iterator, nvt_info_count): New function.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): In GET_INFO add iterator
	support for NVTs.

	* src/sql.c (sql_parse_time, sql_tag): New functions.

	* doc/db_postgres.sql (nvts): Add GET columns.

	* doc/db.png: Update from source.

2013-01-16  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Enforce check of
	user_filter size in get default filter from settings cases.

	* src/manage_sql.c (setting_filter): Update documentation.

2013-01-16  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (setting_filter): Return filter uuid directly instead
	of term. Update documentation.
	(manage_set_setting): Add SecInfo filter checking.

	* src/omp.c (omp_xml_handle_end_element): Add settings default filter
	support in GET INFO case. Update GET cases to also set the filt_id when
	setting the filter from settings filters.

2013-01-16  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Update copyright dates and authors in heading comments of various files.

	* tools/dfn_cert_getbyname.xsl, tools/dfn_cert_update.xsl:
	Update heading comment dates, authors and fix description.

	* src/CMakeLists.txt, src/manage_sql.c, src/manage_sql.h, src/manage.c,
	src/omp.c, src/manage.h, CMakeLists.txt:
	Update heading comment dates and authors.

2013-01-16  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Add basic DFN-CERT advisory support to OMP.

	* CMakeLists.txt: Add tools/dfn_cert_getbyname.xsl

	* src/CMakeLists.txt: Add "add_definitions" for CERT directories.

	* src/manage.c (DFN_CERT_ADV_FILENAME_FMT, DFN_CERT_ADV_GETBYNAME_XSL):
	Add #defines used by get_dfn_cert_adv_filename and manage_read_info.
	(get_dfn_cert_adv_filename): Add function to find file name of a
	DFN-CERT advisory.
	(manage_cert_update_time): Add function.
	(manage_read_info): Add else if for dfn_cert_adv.

	* src/manage.h (manage_read_info): Move to top of SecInfo functions.
	(manage_cert_loaded, manage_cert_update_time)
	(init_dfn_cert_adv_info_iterator, dfn_cert_adv_info_count)
	(dfn_cert_adv_info_title, dfn_cert_adv_info_summary)
	(dfn_cert_adv_info_num_cves): Add.

	* src/manage_sql.c (init_manage_process): Add attachment of CERT
	database.
	(DFN_CERT_ADV_INFO_ITERATOR_FILTER_COLUMNS)
	(DFN_CERT_ADV_INFO_ITERATOR_COLUMNS): Add #defines.
	(manage_cert_loaded, init_dfn_cert_adv_info_iterator)
	(dfn_cert_adv_info_count, dfn_cert_adv_info_title)
	(dfn_cert_adv_info_summary, dfn_cert_adv_info_num_cves): Add function
	to check if CERT database is loaded and DFN-CERT iterator functions.

	* src/omp.c (omp_xml_handle_end_element): In case CLIENT_GET_INFO add
	else if branches for dfn_cert_adv.

	* tools/dfn_cert_getbyname.xsl: Add new stylesheet to select DFN-CERT
	advisories by their ID.

2013-01-15  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/db_postgres.sql: Update to reflect added creation and modification
	times in various resource types in DB.

	* src/db.png: Update to match latest version.

2013-01-15  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (manage_set_setting): Fix comment typo. Add
	lsc_credentials and slaves filters. Remove reports filter.

	* src/omp.c (omp_xml_handle_end_element): Use resource filter from
	settings in case of default or empty filter when getting notes,
	overrides, port lists, report formats, schedules, agents, configs,
	alerts, filters, credentials, slaves, targets and tasks.

2013-01-15  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (setting_filter): New function to get a resource
	settings filter.
	(manage_set_setting): Handle per-resource filters settings.

	* src/manage.h: Add setting_filter header.

2013-01-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_TASKS remove old
	variable.

2013-01-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (task_threat_level): Use task_target instead of SQL.
	(task_trend): Return NULL for container tasks.

2013-01-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (filter_clause): For tasks, when the sort column is
	threat then collate with collate_threat.
	(collate_threat): Check for the empty string first, because in some
	SQL contexts the threat can be NULL, like for container tasks.
	(init_manage_process): Add collate_threat SQL collator.
	(task_threat_level): Return NULL for container tasks.

2013-01-14  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Add CERT advisory database and sync with a local DFN-CERT feed data.

	* CMakeLists.txt: Add CERT paths and files (see added files here).

	* tools/cert_db_init.sql: New SQL script to create new CERT database.

	* tools/dfn_cert_update.xsl: New XSLT Stylesheet to import DFN-CERT
	advisories into database.

	* tools/openvas-certdata-sync: New CERT synchronization script.
	Creates and updates CERT database using local XML files.

2013-01-14  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* ChangeLog: Fix last entry to reflect real changes.
	(was an entry for changes not actually committed).

2013-01-14  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage.c (manage_read_info): Add line break (line was >80 chars).

	* src/manage.h: Remove argument names for SCAP iterator initialization
	functions to make them more consistent.

2013-01-11  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (alert_writable, trash_alert_writable): Make alerts
	always editable.

2013-01-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_INFO correct the type
	in init_info_iterator return 2.

2013-01-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_INFO append the raw
	data with g_string_append_printf instead of xml_string_append because
	the markup in the raw data is required.

2013-01-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* ChangeLog: Add parentheses.

	* src/manage_sql.c (send_to_verinice): Neaten comment.  Indent properly.

2013-01-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Remove escaping now handled by
	xml_string_append.

2013-01-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (get_ovaldef_filename): Cleanup formatting.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_INFO indent if
	block by 2 instead of 3.

2013-01-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (copy_resource, copy_alert, copy_task, copy_target)
	(copy_config, copy_report_format, copy_port_list): Find the user inside
	the transaction, just to be safe.

2013-01-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/LaTeX/latex.xsl (notes, overrides): Format dates
	nicely.

2013-01-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/NBE/NBE.xsl (ctime): New template.
	(scan_start, scan_end, report): Generate times with ctime because that
	is the date format that the original NBE file format used.

2013-01-10  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* tools/greenbone-scapdata-sync: Fixed two bugs so that
	complex directory structures for oval data will work.

2013-01-10  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Add support to modify Alerts data and filters.

	* src/manage_sql.c (modify_alert): Modify alert's event, condition,
	method and filter. Change interface and documentation accordingly.

	* src/manage.h: Change modify_alert accordingly.

	* src/omp.c (modify_alert_t): Add event, event_data, filter_id,
	condition, condition_data, method, method_data, part_data and part_name
	elements.
	(modify_alert_data_reset): Free filter_id, event, event_data,
	condition, condition_data, method and method_data.
	(client_state_t): Add client states for alert filter, event, condition
	and method elements.
	(omp_xml_handle_start_element): Handle alert event, condition and method
	data. Fix ELSE_ERROR typos.
	(omp_xml_handle_end_element): Adapt to modify_alert interface changes.
	Handle event, condition and method data.
	(omp_xml_handle_text_element): Append data in alert event, condition and
	method tags to appropriate elements.

2013-01-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/TXT/TXT.xsl (scan_start): New template.  Formats
	date nicely.
	(scan_end): Format date nicely.
	(real-report): Call date templates for start and end dates.

2013-01-10  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* tools/greenbone-scapdata-sync: Added --help.

2013-01-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (create_agent_data_t): Align comment.

2013-01-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_INFO use
	xml_string_append in more places, because the info can contain special
	characters.

2013-01-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (OVALDEF_INFO_ITERATOR_COLUMNS): Align separator.
	(get_ovaldef_short_filename): Add space.

	* src/manage_sql.h (get_ovaldef_short_filename): Add space.  Remove name.

2013-01-10  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* tools/greenbone-scapdata-sync, tools/openvas-scapdata-sync.in:
	Change OVAL file listing to include subdirectories of oval directory.

2013-01-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* ChangeLog: Cleanup entry.

2013-01-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_cpe_info_iterator, init_cve_info_iterator)
	(init_ovaldef_info_iterator): Remove the filter GET arg when a name is
	given, because the exact entry is required and the filtering gets in the
	way.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): In GET_INFO update declaration
	accordingly.

2013-01-10  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Renamed db_init.sql to scap_db_init.sql to avoid confusion with future
	Cert database.  Changed SCAP database version and removed old migration
	scripts as re-creation of database is recommended to ensure
	consistency.

	* CMakeLists.txt: Changed db_init.sql to scap_db_init.sql.
	Removed migrate_db4.xsl.

	* tools/db_init.sql: Removed. Renamed to scap_db_init.sql.

	* tools/greenbone-scapdata-sync, tools/openvas-scapdata-sync.in:
	Changed db_init.sql to scap_db_init.sql. Changed database version to 8.
	Removed old migration scripts.

	* tools/scap_db_init.sql: Added. Renamed from db_init.sql.
	Change version to 8 and updated DROP TABLE ... queries.

	* tools/migrate_db4.xsl: Removed.

2013-01-10  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* tools/db-init.sql: Change version number to 7.

	* tools/openvas-scapdata-sync.in (update_sec_db): Fix queries for
	latest CVEs and OVAL-defs still expecting timestamps stored as strings.
	Change timestamp-based filtering of OVAL definitions to use new
	oval_timestamp.xsl and evaluate xml-file specific timestamps to a
	ccomodate possible added repositories with older timestamps.
	Sort OVAL files by timestamp date before updating so latest definitions
	are stored in database in case of duplicates.
	(list_oval_files_sorted, list_oval_files_sortable): New helper functions
	for sorting OVAL files.

	* tools/greenbone-scapdata-sync: Updated timestamp filtering.
	For details see: tools/openvas-scapdata-sync.in (update_sec_db,
	list_oval_files_sorted, list_oval_files_sortable).

	* tools/oval_timestamp.xsl: Remove surrounding SQL query to make more
	reusable.

2013-01-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_alert, delete_target, delete_config)
	(delete_schedule, delete_slave): Check if any task is using the resource
	in the "ultimate" case, to catch the case where the resource is in the
	table and the task is in the trash.

2013-01-09  Andre Heinecke  <andre.heinecke@greenbone.net>

	* src/manage_sql.c (send_to_verinice): Do not log the password in debug
	output.

2013-01-09  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (port_list_is_predefined): New function.
	(delete_port_list, port_list_in_use, port_list_writable): Use
	port_list_is_predefined adequately.

	* src/manage.h: Add port_list_is_predefined header accordingly.

2013-01-09  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (port_list_name, trash_port_list_name)
	(trash_port_list_uuid, port_list_ssh_lsc_credential): Remove unused
	functions.

	* src/manage.h: Remove headers accordingly.

2013-01-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_user_get_iterator, init_get_iterator): Wrap the
	filter clause in parentheses because it may have multiple subclauses.

2013-01-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (keyword_applies): Revert from skipping any duplicate
	column keywords, introduced in r14801, to skipping the special keywords
	on a special case basis.  This is necessary because it is valid to have
	multiple normal column keywords, for example "name=a or name=b".

2013-01-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* ChangeLog: Cleanup two entries.

2013-01-08  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (modify_alert): New function.

	* src/manage.h: add modify_alert header.

	* src/omp.c (omp_commands): Add modify_alert omp command.
	(modify_alert_data_t): New data structure.
	(modify_alert_data_reset): New function to free modify_alert_data_t's
	data.
	(command_data_t): Add modify_alert command.
	(modify_alert_data): Add parser callback for modify_alert command.
	(client_state_t): Add CLIENT_MODIFY_ALERT, CLIENT_MODIFY_ALERT_NAME and
	CLIENT_MODIFY_ALERT_COMMENT states.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text_element): Handle modify_alert case.

2013-01-08  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (filter_clause): Make sorting by column case
	insensitive.

2013-01-07  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* tools/greenbone-scapdata-sync: Fixed missing "fi".

2013-01-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_note): Allow NVT OID to be "0", for open
	ports.

2013-01-07  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (lsc_credential_writabe, trash_lsc_credential_writable):
	Make credentials always writable, even when in use by a target.

2013-01-07  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (omp_xml_handle_element): Send nvt families when details
	attribute is set.

2013-01-07  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* tools/db_init.sql: Fix OVAL definition table name mistakenly reverted
	to old name oval_def instead of correct ovaldefs.

	* tools/oval_update: Fix misspelled test causing dates of individual
	definitions not to be recognized.

2013-01-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (slave_writable, trash_slave_writable): Always return
	1.  Changing the slave should have little effect on the comparability of
	reports.
	(slave_in_use): Only consider slave in use if a regular task is using
	the slave.  This allows the user to put the slave in the trashcan when a
	trashcan task is using the slave.

2013-01-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (alert_iterator_filter_trash): New function.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In GET_ALERTS add missing
	FILTER/TRASH.

2013-01-07  Matthew Mundell <matthew.mundell@greenbone.net>

	In GET_ALERTS return the details of the right filter when the filter
	is in the trashcan.

	* src/manage_sql.c (ALERT_ITERATOR_COLUMNS)
	(ALERT_ITERATOR_TRASH_COLUMNS): Add filter location column.
	(alert_iterator_filter): Return filter_t instead of int.
	(alert_iterator_filter_uuid, alert_iterator_filter_name)
	(trash_filter_uuid, trash_filter_name): New functions.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): In GET_ALERTS get filter UUID
	and name directly from iterator.

2013-01-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (modify_filter): Use strcasecmp for type check so
	client can use any case.

2013-01-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (modify_filter): Check that type is valid if filter
	is in use.

	* src/omp.c (omp_xml_handle_end_element): In MODIFY_FILTER check for
	filter type error.

2013-01-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_alert): Check filter type.

	* src/omp.c (omp_xml_handle_end_element): In CREATE_ALERT check for
	filter type error.

2013-01-07  Michael Wiegand <michael.wiegand@greenbone.net>

	* tools/greenbone-scapdata-sync: Add support for proxy authentication.
	Based on patch submitted by Christian Schmidt.

2013-01-07  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Add modify port list functionality.

	* src/omp.c (modify_port_list_data_t): New structure.
	(modify_port_list_data_reset): New function.
	(command_data_t): Add modify_port_list element.
	(omp_commands): Add modify_port_list omp command.
	(modify_port_list_data): Add parser callback for modify_port_list
	command.
	(client_state_t): Add CLIENT_MODIFY_PORT_LIST,
	CLIENT_MODIFY_PORT_LIST_NAME and CLIENT_MODIFY_PORT_LIST_COMMENT states.

	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text_element): Handle modify_port_list case.

	* src/manage_sql.c (modify_port_list): New function.
	(modify_agent): Fix documentation.

	* src/manage.h: Add modify_port_list header.

2013-01-07  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	Individual OVAL definitions are now filtered out when older than the
	latest in the SCAP database.

	* tools/oval_update.xsl: Add parameter refdate and check of dates in
	<oval_repository> tag to filter out older definitions.

	* tools/greenbone-scapdata-sync: Add passing of parameter OVAL_REFDATE
	to xsltproc for oval_update.xsl.

	* tools/openvas-scapdata-sync.in: Add passing of parameter OVAL_REFDATE
	to xsltproc for oval_update.xsl.

2013-01-04  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	Timestamps from tag oval_repository are now used for timestamps
	of OVAL definitions.
	Improved escaping of characters in OVAL defintions to avoid XML errors
	caused by unescaped ampersands (&) in titles and descriptions.

	* src/omp.c (omp_xml_handle_end_element): In case CLIENT_GET_INFO add
	escaping of ampersands.
	Reworked indentation of OVAL code in this section.

	* tools/oval_update.xsl: Add template to get creation_date and
	modification_date from tag oval_repository if it exists.
	Change handling of quotes to replace them with double quotes in
	generated SQL queries.

2013-01-04  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (get_port_lists_data_t): Remove ranges element.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Don't use
	ranges element of get_port_lists_data as it duplicates functionality of
	details get attribute.

2013-01-04  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Add modify agent feature.

	* src/omp.c (modify_agent_data_t): New structure.
	(omp_commands): Add modify_agent omp command.
	(modify_agent_data_reset): New function.
	(command_data_t): Add modify_agent element.
	(modify_agent_data): Add parser callback for modify_agent command.
	(client_state_t): Add CLIENT_MODIFY_AGENT, CLIENT_MODIFY_AGENT_NAME and
	CLIENT_MODIFY_AGENT_COMMENT states.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text_element): Handle modify_agent case.

	* src/manage_sql.c (modify_agent): New function.

	* src/manage.h: add modify_agent header.

2013-01-03  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	Cleaned up some trailing whitespaces and lines longer than 80
	characters in OVAL sections.

	* ChangeLog: Remove trailing whitespaces.

	* src/manage.c: Remove trailing whitespaces.

	* src/manage.h: Remove trailing whitespaces, insert line breaks.

	* src/manage-sql.c: Remove trailing whitespaces, insert line breaks.

	* src/manage-sql.h: Remove trailing whitespaces.

	* tools/greenbone-scapdata-sync: Remove trailing whitespaces.

	* tools/openvas-scapdata-sync.in: Remove trailing whitespaces.

2013-01-03  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Fix non-unique names when cloning global resources. Remove some extra
	sql.

	* src/manage_sql.c: Add find_user static header.
	(copy_resource, copy_task, copy_target, copy_config, copy_alert)
	(copy_report_format, copy_port_list): uniquify based on user cloning the
	object rather than the object's owner.
	(copy_alert, copy_report_format, copy_port_list): Style update.
	(copy_report_format): Use owner value instead of subquery for user id.

2013-01-03  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (copy_report_format): Remove extra sql rollback.

2013-01-03  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Add clone ability to Report Formats.

	* src/manage_sql.c (copy_report_format): New function to copy a Report
	Format in the DB and on disk.
	(file_utils_copy_file): New function. Duplicate from lsc_users.

	* src/manage.h: Add copy_report_format header accordingly.

	* src/omp.c (create_report_format_data_t): Add copy element.
	(create_report_format_data_reset): Free copy element.
	(client_state_t): Add CLIENT_CREATE_REPORT_FORMAT_COPY.
	(omp_xml_handle_text): Copy Report Format uuid from copy element into
	create data copy element.
	(omp_xml_handle_start_element): Add Report Format copy client state.
	(omp_xml_handle_end_element): Handle Report Format copy case.

2013-01-02  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	Add output of raw data for OVAL definitions.
	Change SCAP database format to include source file of OVAL definitions.
	Change namespaces and schemas in OVAL XSL files to use OVAL ones
	instead of ones left from CPE/CVE.

	* CMakeLists.txt: Add ovaldef_getbyname.xsl

	* src/manage.c: Add raw data extraction for OVALDEF.
	(OVALDEF_GETBYNAME_XSL): Add constant for OVAL selection stylesheet.
	(get_ovaldef_filename): Add function to get full source filename.
	(manage_read_info): Add else if branch for OVALDEF.

	* src/manage.h: Add declaration of ovaldef_info_iterator_xml_file

	* src/manage_sql.c (get_ovaldef_short_filename): Add new function
	to get short xml filenames (as stored in SCAP database) of OVALDEFs.
	Change OVALDEF_INFO_ITERATOR_FILTER_COLUMNS and
	OVALDEF_INFO_ITERATOR_COLUMNS to include "xml_file"
	(ovaldef_info_iterator_xml_file): Add function to read xml_file of
	OVALDEFs.

	* src/manage_sql.h: Add declaration of get_ovaldef_short_filename.

	* src/omp.c (omp_xml_handle_end_element): In case CLIENT_GET_INFO add
	output of "xml_file" to OVALDEF.

	* tools/db_init.sql: Add column "xml_file" to table "ovaldefs"

	* tools/greenbone-scapdata-sync: Add migration to database version 7,
	Remove obsolete migration scripts.
	Update xsltproc call to pass xml file name as parameter.

	* tools/migrate_db5to6: Remove file as OVAL data has to be re-imported
	for new database version.

	* tools/openvas-scapdata-sync.in: Analogous to greenbone-scapdata-sync.

	* tools/ovaldef_getbyname.xsl: New stylesheet to select an OVAL
	definition with a given identifier.

	* tools/oval_timestamp: Remove unused namespaces,
	Update schemaLocation to OVAL schemas.

	* tools/oval_update.xsl: Remove unused namespaces,
	Update schemaLocation to OVAL schemas.
	Add xml_file to SQL query.

2013-01-02  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Add clone ability to Port Lists.

	* src/manage_sql.c (copy_port_list): New function for Port List cloning.

	* src/manage.h: Add copy_port_list header.

	* src/omp.c (create_port_list_data_t): Add copy element.
	(create_port_list_data_reset): Free copy element.
	(client_state_t): Add CLIENT_CREATE_PORT_LIST_COPY.
	(omp_xml_handle_end_element): Handle Port List copy case.
	(omp_xml_handle_start_element): Add Port List copy client state.
	(omp_xml_handle_text): Append port list id from copy tag into
	create_lsc_credential_data copy element.

2013-01-02  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (copy_alert): Return 2 when alert to copy is not
	found. Use sql_string to check for alert. Fix SQL query style.

2013-01-01  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (copy_alert): New function to clone an alert.

	* src/manage.h: Add copy_alert header.

	* src/omp.c (create_alert_data_t): Add copy element.
	(create_alert_data_reset): Free copy element.
	(client_state_t): Add CLIENT_CREATE_ALERT_COPY.
	(omp_xml_handle_start_element): Handle alert copying case.
	(omp_xml_handle_end_element): Handle case when create_alert_data copy
	element is set. Close copy tag.
	(omp_xml_handle_text_element): Append content of copy tag to
	create_alert_data copy element.

2013-01-01  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (copy_resource): Free quoted_uuid before returning.
	(copy_schedule): Style fix.

2012-12-31  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (copy_config): Check if config name exists already
	when provided name is not null or empty. Create unique name and copy
	comment for clone case when no name is provided.

	* src/omp.c (omp_xml_handle_end_element): Check copy element also when
	checking name too to permit blank name sent in clone case.

2012-12-31  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (init_user_lsc_credential_iterator): Use
	LSC_CREDENTIAL_ITERATOR_COLUMNS to follow the same order of columns used
	by init_lsc_credential_iterator as functions to access columns' values
	are shared.

2012-12-31  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (client_state_t): Add CLIENT_CREATE_LSC_CREDENTIAL_COPY.
	(create_lsc_credential_data_t): Add copy element.
	(omp_xml_handle_text): Add uuid from copy tag to
	create_lsc_credential_data copy element.
	(omp_xml_handle_end_element): Handle LSC Credential copy case.
	(omp_xml_handle_start_element): Add LSC Credential copy client state.
	(create_agent_data_reset, create_lsc_credential_data_reset)
	(create_schedule_data_reset, create_slave_data_reset)
	(create_target_data_reset): Free copy element.

	* src/manage_sql.c (copy_lsc_credential): New function
	match other resources copy functions style.

	* src/manage.h: Add copy_lsc_credential header.

2012-12-28  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (copy_agent): New function
	(agent_uuid): Change interface to take one agent_t as a parameter and
	match other resources copy functions style.

	* src/manage.h: Change agent_uuid and add copy_agent header.

	* src/omp.c (create_agent_data_t): Add copy char pointer.
	(client_state_t): Add CLIENT_CREATE_AGENT_COPY.
	(omp_xml_handle_start_element): Add agent copy state check.
	(omp_xml_handle_end_element): Handle agent copy for CLIENT_CREATE_AGENT
	case. Adapt agent_uuid call to interface change. Add log entry for Agent
	creation.
	(omp_xml_handle_text): Add content of copy tag to create_agent_data copy
	element.

2012-12-28  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (update_all_config_caches, update_config_cache):
	Initialize iterator with needed columns only instead of using
	CONFIG_ITERATOR_COLUMNS.

2012-12-27  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (CONFIG_ITERATOR_FILTER_COLUMNS)
	(CONFIG_ITERATOR_COLUMNS, CONFIG_ITERATOR_TRASH_COLUMNS): Rename
	family_count, nvt_count, families_growing and nvts_growing columns to
	families_total, nvts_total, families_trend and nvts_trend.

2012-12-27  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (init_user_config_iterator)
	(update_all_configs_caches, manage_complete_nvts_cache_update): Use
	CONFIG_ITERATOR_COLUMNS instead of CONFIG_ITERATOR_FIELDS.
	(CONFIG_ITERATOR_FIELDS): Remove unused define.

2012-12-27  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (init_config_iterator): Change interface. Take two
	parameters: iterator_t and get_data_t.
	(config_iterator_comment): Define with DEF_ACCESS.
	(config_iterator_nvt_selector, config_iterator_families_growing)
	(config_iterator_nvts_growing): Adjust column number.
	(config_iterator_family_count, config_iterator_nvt_count): New
	functions.

	* src/manage.h: Add config_iterator_nvt_count and
	config_iterator_family_count headers. Modify init_config_iterator
	header.

	* src/omp.c (get_configs_data_t): Change data strucutre to contain four
	elements: families, prefernces, get and tasks.
	(get_configs_data_reset): Use get_data_reset.
	(omp_xml_handle_start_element): Use get_data_parse_attributes in
	GET_CONFIGS case. Check tasks attribute.
	(omp_xml_handle_end_element): Adapt to new init_configs_iterator
	interface. Use SEND_GET_START, SEND_GET_COMMON and SEND_GET_END macros.
	Check details and tasks attributes.

2012-12-27  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (init_ovaldef_info_iterator): Fix use of wrong filter
	columns for OVAL definitions.

2012-12-27  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Migrate database to version 73, add creation and modification times
	to scan configs.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Set to 73.

	* src/manage_sql.c (create_tables): Add creation_time and
	modification_time columns to configs and configs_trash tables.
	(migrate_72_to_73): New function.
	(database_migrators): Add migrate_72_to_73.
	(init_manage, create_config, create_config_rc, delete_config)
	(manage_restore): Insert into creation_time and modification_time
	columns current time value.
	(insert_rc_into_config, manage_set_config_comment)
	(manage_set_config_name, manage_set_config_name_comment)
	(manage_set_config_nvts, manage_set_config_families): Update
	modification_time column to current time value.

	* doc/db.png: Update to version 73.

2012-12-27  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (config_count): New function.
	(CONFIG_ITERATOR_FILTER_COLUMNS, CONFIG_ITERATOR_COLUMNS)
	(CONFIG_ITERATOR_TRASH_COLUMNS): Add defines.

	* src/manage.h: Add config_count header.

2012-12-27  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* CMakeLists.txt: Add SCAP.db migration script migrate_db5to6.sql

	* src/manage.h (init_ovaldef_info_iterator)
	(ovaldef_info_count, ovaldef_info_iterator_version)
	(ovaldef_info_iterator_deprecated, ovaldef_info_iterator_def_class)
	(ovaldef_info_iterator_title, ovaldef_info_iterator_description):
	Add iterator function declarations for OVAL definition data (ovaldef).

	* src/manage_sql.c: Add implementations of new iterator functions
	declared in src/manage.h

	* src/omp.c (omp_xml_handle_end_element): In case CLIENT_GET_INFO
	Add XML output of basic ovaldef data.

	* tools/db_init.sql: Change database columns to include attributes
	uuid, name, comment, creation_time, modification_time. Change DB
	version to 6.

	* tools/greenbone-scapdata-sync: Add migration to new database format.

	* migrate_db5to6.sql: Add new SQL file to migrate data from SCAP DB
	version 5 to 6.

	* tools/openvas-scapdata-sync.in: Add migration to new database format

	* tools/oval_update.xsl: Change SQL queries to match new database format

2012-12-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Upgrade FIX to TODO.

2012-12-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_report_format): Make the name unique instead
	of failing, when a report format with the name exists already.  This
	matches the other importers.

2012-12-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (omp_xml_handle_start_element): In CLIENT_C_C_GCR set
	the import flag again, because the reset clears it.

2012-12-21  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (delete_report_format): Fix column name.

2012-12-21  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (trash_config_writable): New function.
	(config_writable): Base results on config_in_use.
	* src/manage.h: Add header accordingly.

2012-12-21  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (GET_ITERATOR_FILTER_COLUMNS)
	(PORT_LIST_ITERATOR_COLUMNS,PORT_LIST_ITERATOR_TRASH_COLUMNS): Use
	total, tcp and udp as names for count columns.

2012-12-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_port_list_lock): Always give the port ranges
	new UUIDs.

2012-12-21  Matthew Mundell <matthew.mundell@greenbone.net>

	Read over bogus elements when importing.

	* src/omp.c (omp_parser_t): Add importing and parent_state.
	(ELSE_ERROR): When importing go into "read-over mode".
	(omp_xml_handle_start_element): Set importing flag on omp_parser for
	import commands.
	(omp_xml_handle_end_element): In read-over mode when the parent_state is
	set then switch to that state instead of leaving it to a specific case.
	Move setting the import_config_data import flag to
	omp_xml_handle_start_element to match other commands.

2012-12-21  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (init_config_iterator): Correct configs table name.

2012-12-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_get_iterator): Add a 1 to single resource case
	of owned_and_used_by_clause because used_by_clause starts with OR.

2012-12-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_task_alert_iterator): Specify event as integer
	because it's an enum.

	* src/omp.c (omp_xml_handle_end_element): In CREATE_TASK add a fail flag
	to the alert while, because now that it's a while the breaks will break
	out of the while instead of the case.

2012-12-20  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/otp.c (parse_scanner_plugin_list_tags): Don't set the risk factor
	for the nvti anymore. Will be computed from the cvss automatically.

	* src/manage_sql.c (update_nvti_cache): Don't set the risk factor
	anymore.
	(make_nvt_from_nvti): Simplified risk factor retrieval because
	always a sensible string is return.

2012-12-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.h (get_data_t): Add type and subtype.

	* src/manage_sql.c (type_owned): New function.
	(resource_count): Pass the subtype if there is one, and check whether
	the type is owned.  This gets the get_info cases working.

	* src/omp.c (get_data_reset): Free type and subtype.
	(get_data_parse_attributes): Set type.
	(omp_xml_handle_end_element): Set subtype.

2012-12-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (get_alerts_data_t, get_overrides_data_t): Align comment.
	(omp_xml_handle_end_element): Neaten formatting.

2012-12-20  Matthew Mundell <matthew.mundell@greenbone.net>

	Add back the full count in GET_TASKS, adding to all other new-style GET
	ops at the same time.

	* src/manage_sql.c (vector_find_string): Add vector NULL check.
	(resource_count): New function.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (send_get_end): Add full count arg.
	(SEND_GET_END): Pass full count to send_get_end.
	(omp_xml_handle_end_element): Remove old code that added full count in
	GET_TASKS.

2012-12-20  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (PORT_LIST_ITERATOR_FILTER_COLUMNS): Add count_all,
	count_tcp and count_udp columns.
	(PORT_LIST_ITERATOR_TRASH_COLUMNS): Add count ports, tcp ports and udp
	ports SQL statements.

2012-12-20  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (port_list_iterator_count): Rename function to
	port_list_iterator_count_all.
	(PORT_LIST_ITERATOR_COLUMNS): Add SQL statements to count all ports, tcp
	ports and udp ports of the port_list.
	(port_list_iterator_count_all, port_list_iterator_count_tcp)
	(port_list_iterator_count_udp): Use sqlite3_column_int and
	GET_ITERATOR_COLUMN_COUNT.

	* src/manage.h: Rename port_list_iterator_count header.

	* src/omp.c (omp_xml_handle_end_element): Call
	port_list_iterator_count_all in CLIENT_GET_PORT_LSITS case.

2012-12-20  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/omp.c (get_lsc_credentials_data_t): Add targets boolean.
	(omp_xml_handle_start_element): Check targets attribute value.
	(omp_xml_handle_end_element): Refactor sending of login and type
	elements and repeated lsc_credential_iterator_public_key function call.
	Check targets boolean as a condition to send targets using the LSC
	Credential.

2012-12-19  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (init_lsc_credential_iterator): Change interface to
	use iterator_t and a get_data_t as arguments. Use init_get_iterator.
	(lsc_credential_iterator_comment): Define with DEF_ACCESS.
	(lsc_credential_iterator_login, lsc_credential_iterator_password)
	(lsc_credential_iterator_public_key)
	(lsc_credential_iterator_private_key): Adjust column.
	(lsc_credential_iterator_rpm, lsc_credential_iterator_deb): Use
	lsc_credential_iterator_name and lsc_credential_iterator_public_key
	instead of querying fields in the iterator.
	(lsc_credential_iterator_in_use): Remove inused function.

	* src/manage.h: Change init_lsc_credential_iterator header accordingly.
	Remove lsc_credential_iterator_in_use header.

	* src/omp.c (get_lsc_credentials_data_t): Add get_data_t element. Remove
	sort_field, sort_order, trash, lsc_credential_id and actions.
	(get_lsc_credentials_data_reset): Use get_data_reset.
	(omp_xml_handle_start_element): Adapt GET_LSC_CREDENTIALS case to new
	format. Use get_data_parse_attributes.
	(omp_xml_handle_end_element): Adapt to new init_lsc_credential_iterator
	interface. Use SEND_GET_START, SEND_GET_COMMON and SEND_GET_END macros.

2012-12-19  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (lsc_credential_count): New function.
	(LSC_CREDENTIAL_FILTER_COLUMNS, LSC_CREDENTIAL_ITERATOR_COLUMNS)
	(LSC_CREDENTIAL_ITERATOR_TRASH_COLUMNS): New defines.

	* src/manage.h: Add lsc_credential_count header.

2012-12-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (task_writable, trash_task_writable): Check if the
	user has write access too.

2012-12-19  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Migrate database to version 72, add creation and modification time
	to LSC Credentials.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 72.

	* src/manage_sql.c (create_tables): Add creation_time and
	modification_time columns in lsc_credentials.
	(migrate_71_to_72): New function.
	(database_migrators): Add migrate_71_to_72.
	(create_lsc_credential, delete_lsc_credential, set_lsc_credential_name)
	(set_lsc_credential_login, set_lsc_credential_comment)
	(set_lsc_credential_password, manage_restore): Insert into and update
	creation_time and modification_time lsc_credentials table columns
	accordingly.

	* doc/db.png: Update to version 72.

2012-12-19  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* tools/greenbone-scapdata-sync: Add parameter --refresh to
	run only the database update, but no downloads.

2012-12-19  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Patch developed by: Timo Pollmeier

	* tools/greenbone-scapdata-sync: Add sync of OVAL data, database
	migration to version 5 and checks if xml files for CVE and
	OVAL exist in SCAP directory.

2012-12-19  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (filter_in_use, trash_filter_in_use, target_in_use)
	(trash_target_in_use, alert_in_use, trash_alert_in_use, schedule_in_use)
	(trash_schedule_in_use, report_format_in_use)
	(trash_report_format_in_use, slave_in_use, trash_slave_in_use)
	(trash_port_list_in_use, lsc_credential_in_use)
	(trash_lsc_credential_in_use): Style update.

2012-12-18  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Patch developed by: Timo Pollmeier

	* tools/openvas-scapdata-sync.in: Add checks if xml files for CVE and
	OVAL exist in SCAP directory.

2012-12-18  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Patch developed by: Timo Pollmeier

	* CMakeLists.txt: Add the two new OVAL XSLT stylesheets to be
	installed in ${OPENVAS_SCAP_RES_DIR}

	* tools/dbinit.sql: Add creation of table "oval_def" for OVAL
	definitions. Change database version to 5.

	* tools/openvas-scapdata-sync.in: Add sync of OVAL data and database
	migration to version 5.

	* tools/oval_timestamp.xsl: New XSLT stylesheet for getting generator
	timestamps from OVAL XML files.

	* tools/oval_update.xsl: New XSLT stylesheet for creating SQL inserts
	to add definition data from OVAL XML files.

2012-12-18  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (filter_in_use, trash_filter_in_use, target_in_use)
	(trash_target_in_use, alert_in_use, trash_alert_in_use, schedule_in_use)
	(trash_schedule_in_use, report_format_in_use, trash_report_format_in_use)
	(slave_in_use, trash_slave_in_use, trash_port_list_in_use): Comply with
	function's description and return 1 for "in use" case.

	(trash_port_list_in_use): Remove inused code between "#if 0 #endif".

2012-12-18  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (lsc_credential_in_use, trash_lsc_credential_in_use)
	(lsc_credential_writable, trash_lsc_credential_writable): New functions.

	* src/manage.h: Add headers accordingly.

2012-12-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_note_iterator, init_override_iterator): Remove
	the used_by arg, because the user only ever sees his own notes and
	overrides.

2012-12-18  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Fix alert counts for
	CLIENT_GET_ALERTS case.

2012-12-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): For the assets report add an
	scap_loaded flag attribute.

2012-12-17  Andre Heinecke <andre.heinecke@greenbone.net>

	* report_formats/verinice-itg/gsm_verinice_itg.xsl: Remove redundant
	gsm_itg_result_ip as requested by verinice developers.

2012-12-17  Matthew Mundell <matthew.mundell@greenbone.net>

	Check SCAP availability every time instead of on startup.

	* src/manage_sql.c (scap_loaded): Remove.
	(init_manage_process, print_report_xml): Use manage_scap_loaded to check
	SCAP availability.
	(manage_scap_loaded): Do the actual check instead of checking
	scap_loaded.

2012-12-17  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Remove get.details check for
	CLIENT_GET_ALERTS case.

2012-12-17  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Remove superfluous in_use tags
	in CLIENT_GET_AGENTS case.

	* src/manage_sql.c (agent_writable, trash_agent_writable): Use
	agent_in_use and trash_agent_in_use functions.
	(schedule_writable, trash_schedule_writable): Style fix.

2012-12-17  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (init_target_iterator): Set to NULL used_by parameter
	which was causing sql syntax error when requesting a single target with
	target_id and actions parameters set.

2012-12-14  Hani Benhabiles <hani.benhabiles@greenbone.net>

	Move Alerts to use new GET style.

	* src/manage_sql.c (init_alert_iterator): Change interface to take an
	iterator and a get_data_t as parameters.
	(alert_iterator_filter): New function
	(alert_iterator_in_use, alert_iterator_filter_id)
	(alert_iterator_filter_name, alert_iterator_filter_trash): Remove unused
	function.
	(alert_iterator_uuid, alert_iterator_name)
	(alert_iterator_comment): Define with DEF_ACCESS.
	(alert_iterator_event, alert_iterator_condition)
	(alert_iterator_method): Adjust column position.

	* src/manage.h: Add, change and remove headers accordingly.

	* src/omp.c (get_alerts_data_t): Remove alert_id, sort_field, sort_order
	and trash. Add get and tasks.
	(get_alerts_data_reset): Use get_data_reset.
	(omp_xml_handle_start_element): Adapt GET_ALERTS to get data interfce
	changes.
	(omp_xml_handle_end_element): Use new init_alert_iterator interface in
	CLIENT_GET_ALERTS case. Check details get element when sending alert
	data. Adjust to follow same style with new get based style.

2012-12-14  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (filter_name): New function.
	(task_alert_name, task_alert_uuid, task_alert, task_alert_in_trash):
	Remove unused functions.

	* src/manage.h: Add and remove headers accordingly.

2012-12-14  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (init_task_alert_iterator, task_alert_iterator_alert)
	(task_alert_iterator_uuid, task_alert_iterator_name): New functions.
	(event): Use init_task_alert_iterator instead of init_alert_iterator.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): Use init_task_alert_iterator
	in GET_TASKS case instead of init_alert_iterator.

2012-12-14  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (alert_uuid): Change interface to match the same
	style of other objects.

	* src/manage.h: Change alert_uuid header accordingly.

	* src/omp.c (omp_xml_handle_end_element): Change alert_uuid call in
	CLIENT_CREATE_ALERT.

2012-12-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Follow overrides flag in task iterator.

	* src/manage_sql.c (TASK_ITERATOR_COLUMNS)
	(TASK_ITERATOR_TRASH_COLUMNS): Add overrides arg.
	(init_user_task_iterator): Pass 0 to columns macros, because
	get->overrides is always 0.
	(init_task_iterator, task_count): Pass the overrides value from the
	filter into the columns macros, so that the threat and trend match the
	overrides flag.
	(init_manage_process): Add extra arg to task_threat_level.
	(task_threat_level): Add overrides arg.  Update callers.

	* src/manage.h: Update header accordingly.

	* src/sql.c (sql_threat_level): Add overrides arg.

2012-12-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_get_iterator): Drop the owner clause when
	getting a single resource, because the find_resource_for_actions does
	the owner check.  This makes the iterator work again for single
	observed tasks.

2012-12-13  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Migrate database to version 71, add creation and modification time
	support to alerts.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 71.

	* src/manage_sql.c (create_tables): Add creation_time and
	modification_time to alerts.
	(migrate_70_to_71): New function.
	(database_migrators): Add migrate_70_to_71.
	(create_alert, delete_alert, manage_restore): Set creation_time and
	modification_time columns adequately.

	* doc/db.png: Update to version 71.

2012-12-13  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (alert_count, alert_in_use, trash_alert_in_use)
	(alert_writable, trash_alert_writable): New functions.
	(schedule_in_use, trash_schedule_in_use): Style fix.

	* src/manage.h: Add headers accordingly.

2012-12-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (count): Get the case working where actions are
	given.

2012-12-12  Matthew Mundell <matthew.mundell@greenbone.net>

	Support apply_overrides in GET_TASKS filter.

	* src/manage_sql.c (keyword_applies): Instead of checking only first and
	max, skip over all duplicate keyword columns.  This allows GSA to
	prepend apply_overrides for the task page.
	(filter_term_value): Compare with the actual given arg instead of
	"task_id".

	* src/omp.c (get_tasks_data_t): Remove apply_overrides.
	(omp_xml_handle_end_element): For GET_TASKS send APPLY_OVERRIDES,
	getting the value from the filter.

2012-12-12  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.h, src/manage_sql.c (port_list_iterator_writable)
	(port_list_iterator_in_use, schedule_iterator_in_use): Remove unused
	functions.

2012-12-12  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Add Alerts for GET_REPORT_FORMATS. Remove unneeded export checks.

	* src/manage_sql.c (init_report_format_alert_iterator)
	(report_format_alert_iterator_name)
	(report_format_alert_iterator_uuid): New functions.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (get_report_formats_data_t): Add alerts boolean. Remove
	export boolean.
	(omp_xml_handle_start_element): Add alerts attribute handling. Remove
	export attribute handling.
	(omp_xml_handle_end_element): Add alerts response for
	CLIENT_GET_REPORT_FORMATS case. Remove export attribute checking.

2012-12-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (TASK_ITERATOR_COLUMNS)
	(TASK_ITERATOR_TRASH_COLUMNS): Add last report date as "last", to
	replace report id as "last".

2012-12-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (TASK_ITERATOR_COLUMNS)
	(TASK_ITERATOR_TRASH_COLUMNS): Add run status name as status so that
	status filtering is by name instead of number.
	(init_manage_process): Create SQL function run_status_name.

	* src/sql.c (sql_run_status_name): New function.

	* src/sql.h: Add header accordingly.

2012-12-11  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Move Port Lists to the new GET object management style.

	* src/manage_sql.c (init_port_list_iterator): Change interface to use
	an iterator and a get_data_t parameters. Use init_get_iterator.
	(trash_port_list_in_use, port_list_writable)
	(trash_port_list_writable): New functions.

	* src/omp.c (get_port_lists_data_t): Change structure to contain ranges
	and targets booleans and get get_data_t element.
	(get_port_lists_data_reset): Adapt to change in get_port_lists_data_t.
	(omp_xml_handle_start_element): Add ranges and targets attributes. Use
	get_data_parse_attributes.
	(omp_xml_handle_end_element): Adapt to changes in
	init_port_list_iterator and use SEND_GET_START, SEND_GET_COMMON and
	SEND_GET_END macros.

	* src/manage.h: Add and modify headers accrodingly.

2012-12-11  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (REPORT_FORMAT_ITERATOR_FILTER_COLUMNS): Rename flags
	into active.
	(REPORT_FORMAT_ITERATOR_COLUMNS): Extract active flag value only from
	flags and rename it into active.

2012-12-11  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (REPORT_FORMAT_ITERATOR_FILTER_COLUMNS): Add trust,
	trust_time and flags columns.

	* src/omp.c (omp_xml_handle_end_element): Fixed counter variables for
	CLIENT_GET_REPORT_FORMATS and CLIENT_GET_SLAVES cases. Fixed typo in
	get_next parameter in CLIENT_GET_REPORT_FORMATS case.

2012-12-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (sql_task_trend, sql_threat_level): When passed a 0
	task just return "", because this happens for count queries when the
	result set is empty.

2012-12-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_get_iterator): When current_credentials.uuid is
	NULL and the resource is owned, then always grant access.  This allows the
	GET iterators to be used by the main process, and before processing the
	client OMP.
	(PORT_LIST_ITERATOR_FILTER_COLUMNS)
	(PORT_LIST_ITERATOR_TRASH_COLUMNS): Flush trailing whitespace.

2012-12-10  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (port_list_count): New function.
	(PORT_LIST_ITERATOR_FILTER_COLUMNS, PORT_LIST_ITERATOR_COLUMNS)
	(PORT_LIST_ITERATOR_TRASH_COLUMNS): New defines.

	* src/manage.h (port_list_iterator_exclude): Correct typo. Rename into
	port_range_iterator_exclude.

2012-12-10  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Migrate Database to version 70, add creation and modification time
	support to Port Lists.

	* src/manage_sql.c (migrate_69_to_70): New function.
	(database_migrators): Add migrate_69_to_70.
	(create_tables): Add creation_time and modification_time to port_lists
	and port_lists_trash tables.
	(ensure_predefined_port_lists_exist, create_port_list_lock,
	create_port_list, delete_port_list, manage_restore): Insert current time
	value into creation_time and modification_time.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 70.

2012-12-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_db_version, set_db_version)
	(init_manage_process, manage_update_nvti_cache, init_manage)
	(nvts_md5sum, set_nvts_md5sum, manage_nvt_preferences_enable): Specify
	the database for the meta table because there is a meta table in the
	SCAP db too.  In particular, this is required before the database is
	created, otherwise the meta in the SCAP makes it look like the tasks
	database has already been created.

2012-12-09  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/report_formats/HTML/HTML.xsl: Reduced all occurences of
	xsl:with-param where inly a value-of operation was inside to direct
	"select" inside with-param.
	Also reduced all /xsl:param closing tags where content was empty
	anyway. The gain was minimal. This report is fast anyway compared
	to the other report format plugins.

2012-12-09  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/report_formats/LaTeX/latex.xsl: Reduced all occurences of
	xsl:with-param where inly a value-of operation was inside to direct
	"select" inside with-param.
	This gained clearly less than 1% performance improvement.

2012-12-09  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/report_formats/TXT/TXT.xsl: Reduced all occurences of
	xsl:with-param where inly a value-of operation was inside to direct
	"select" inside with-param.
	Also reduced all /xsl:param closing tags where content was empty
	anyway. This made the report plugin 4 times faster, measured
	for a very big report (2 hours instead of 8 hours, timed twice
	because I couldn't believe that this little change brings so
	much improvement). Most effect comes from "wrap-line" that
	dropped from #0 to #7 in profiling analysis.

2012-12-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_report, manage_send_report): Use a fresh "get"
	arg to get the required report format, instead of passing in the "get"
	args from the report iterator.

2012-12-08  Matthew Mundell <matthew.mundell@greenbone.net>

	Get sorting of task columns via filter working.

	* src/manage_sql.c (TASK_ITERATOR_FILTER_COLUMNS)
	(TASK_ITERATOR_COLUMNS, TASK_ITERATOR_TRASH_COLUMNS): Add all columns.
	(init_manage_process): Init new SQL functions task_trend and
	task_threat_level.
	(task_last_report): Make global, so SQL function can use.
	(task_threat_level): Just return NULL if current_credentials is NULL,
	because this could happen now that the function is used via SQL in the
	task iterator.

	* src/manage.h: Add headers accordingly.

	* src/sql.c (sql_task_trend, sql_threat_level): New functions.

	* src/sql.h: Update headers accordingly.

2012-12-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (count): Move up in file.
	(task_count): Add get arg.  Use count function to return filtered
	count instead of total count.
	(report_format_count, report_format_iterator_trust_time): Flush trailing
	whitespace.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): Disable old TASK_COUNT for now.

2012-12-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_TASKS use
	SEND_GET_START and SEND_GET_END.

2012-12-06  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Moved closing tag for
	CLIENT_GET_CONFIGS within the appropriate else statement, which was
	causing error responses to append an extra get_configs_response tag.

2012-12-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_TASKS move sending the
	alerts from the detailed case to the common area.  This brings multiple
	alerts to the brief case, which was previously only showing one alert.

2012-12-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_TASKS share the
	creation of PREFERENCES between the brief and detailed cases.  Hence
	remove the brief case, which is now empty.

2012-12-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_TASKS share the bulk of
	the response between the brief and detailed cases.  This removes ALERT
	from the brief case, as there are multiple alerts now.  This also brings
	TRASH to CONFIG, TARGET, SLAVE and SCHEDULE in the detailed case.

2012-12-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_TASKS remove variable
	tsk_uuid, which is out of use.

2012-12-06  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Reduce amount of time spent in wrap_row to 0.15% of what
	was spent before. This lets wrap_row drop from #1 to #15
	in profiling analysis (measureing total time spent in function).
	The overall performance gain measured for a very big report was 15%.
	Main reason is that template parameter are expensive, especially
	when used in recursion.

	* src/report_formats/LaTeX/latex.xsl (wrap-row): Drop parameter "color"
	and use white.
	(wrap-row-color): A copy of the old wrap-row with parameter "color".
	(break-into-rows-indented, break-into-rows-indented-color): Dito.
	(break-into-rows, break-into-rows-color): Dito.
	(text-to-escaped-row, text-to-escaped-row-color): Dito.
	All over the code: Were other colors than white were used,
	replace the old call by the -color call.

2012-12-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_TASKS share the
	SEND_GET_COMMON and some variable inits between the brief and
	detailed cases.  This corrects the detailed version when the target,
	slave or schedule is in the trashcan.

2012-12-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_TASKS share the
	creation of SECOND_LAST_REPORT and LAST_REPORT between the brief and
	detailed cases.  This brings the report count optimisation from the
	brief case to the detailed case.

2012-12-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_TASKS for the big if
	share the creation of FIRST_REPORT.

2012-12-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_TASKS add comments
	about result counting.

2012-12-06  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/manage_sql.c (send_to_verinice, send_to_sourcefire): Ensure
	files have the correct permissions when dropping privileges.

2012-12-06  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/report_formats/LaTeX/latex.xsl (escape_verb_env): Replaced
	this template by a single call of str:replace and therefore removed
	the template and replaced 3-line calls by single line direct execution.
	This improves performance by a few percent.

2012-12-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_TASKS for the big if
	share the creation of RCFILE.

2012-12-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_TASKS for the big if
	share the progress calculation.

2012-12-05  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Port Report Formats to new GET style.

	* src/manage_sql.c (init_report_format_iterator): Follow the new GET
	style.
	(manage_report, manage_send_report, verify_report_format): Adapt to the
	new init_report_format_iterator.
	(verify_report_format): Use report_format_global instead of
	report_format_iterator_global
	(report_format_writable, trash_report_format_writable): Base result on
	return value of report_format_global, too.
	(report_format_iterator_extension, report_format_iterator_content_type)
	(report_format_iterator_summary, report_format_iterator_description)
	(report_format_iterator_signature, report_format_iterator_trust)
	(report_format_iterator_trust_time, report_format_iterator_active): Use
	GET_ITERATOR_COLUMN_COUNT as base value.
	(report_format_iterator_global): Remove unused function.

	* src/manage.h: Change and remove headers accordingly.

	* src/omp.c (get_report_formats_data_t): Add get_data_t element. Remove
	sort_field, sort_order, report_format_id and trash.
	(get_report_formats_data_reset): Adapt to new get_report_formats_data_t.
	(omp_xml_handle_start_element): Follow new style for GET_REPORT_FORMATS.
	(omp_xml_handle_end_element): Adapt GET_REPORT_FORMATS case for new
	init_report_format_iterator. Send params and file element when details
	attribute is set.

2012-12-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_TASKS for the big if
	share common variables.

2012-12-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_TASKS wrap the big if
	in a block so that common cases can be shared.

2012-12-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_TASKS check the return
	from init_task_iterator.

2012-12-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_TASKS remove the block
	that was used for the initial param check else case, indenting the
	contents in the parent block.

2012-12-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_TASKS give the initial
	param check its own return, to remove the need for the else block.

2012-12-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_TASKS remove the task
	find, because the iterator init does that now.

2012-12-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_TASKS rename variable
	"task" to "index" in the detailed case, to match the brief case.

2012-12-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_TASKS move iterator
	init up and check get.id instead of task.

2012-12-05  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/report_formats/create_signatures: Add quoting in case the RFP
	name contains a space.

2012-12-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage): Reset 65536 in port ranges to 65535.

2012-12-04  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Update modification_time value for Report Formats accordingly.

	* src/manage_sql.c (update_report_format_uuid, set_report_format_name)
	(set_report_format_active, set_report_format_summary): Update
	modification_time column to current time.

2012-12-04  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Add Report Format in_use, writable and count functions and other
	defines.

	* src/manage_sql.c (trash_report_format_in_use, report_format_in_use)
	(report_format_writable, report_format_count)
	(trash_report_format_writable): New Functions.
	(REPORT_FORMAT_ITERATOR_FILTER_COLUMNS, REPORT_FORMAT_ITERATOR_COLUMNS)
	(REPORT_FORMAT_ITERATOR_TRASH_COLUMNS): New defines.

	* src/manage.h: Add headers accordingly.

2012-12-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (make_task_complete): New function.

	* src/manage_sql.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_end_element): Call make_task_complete on
	success so that any alert runs for the status change to New.

2012-12-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (modify_schedule): Also use the duration string in
	the SQL when the duration is 0.

	* src/omp.c (omp_xml_handle_end_element): In CREATE_SCHEDULE and
	MODIFY_SCHEDULE adjust the period/duration error checks to be less than
	-1 because -1 indicates that the period/duration was NULL.

2012-12-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (modify_filter): Lowercase the type so that it is
	always lowercase in the db and in GET_FILTERS.

2012-12-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (type_db_name): Remove stray semicolon that was
	causing SecInfo to be the default.

2012-12-04  Andre Heinecke <andre.heinecke@greenbone.net>

	* report_formats/verinice-ism/classification.xsl: Classify
	cpe:/o:microsoft:windows as gsm_system_windows_unknown

2012-12-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_SCHEDULES when trying
	to convert to the simple intervals, drop the assumption that the number
	of units is smaller than the size of the next higher unit.  This caters
	for values like 36 hours, now that the GSA allows this to be input.

2012-12-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (interval_from_strings): Ensure that value fits in an
	integer.
	(omp_xml_handle_end_element): In CREATE_SCHEDULE and EDIT_SCHEDULE add
	checks for new interval out-of-range returns.

2012-12-02  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (create_tables): Added missing creation and
	modification columns.

2012-12-02  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Migrate Database to version 69, adding creation and modification time to
	Report formats.

	* src/manage_sql.c (migrate_68_to_69): New function.
	(database_migrators): Add migrate_68_to_69.
	(init_manage, create_format_report, delete_format_report)
	(manage_resotre): Insert and update creation and modification times in
	report_format and report_formats_trash accordingly.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 69.

2012-11-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (run_status_name_internal): New function.

	* src/manage_sql.h: Add header accordingly.

	* src/manage_sql.c (event): Compare with unique run status name, else
	the waiting states are considered as events.

2012-11-29  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Also send trust state and
	trust time with installer for get agents case.

2012-11-29  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): for CLIENT_GET_AGENTS case,
	agent installer is returned too when details attribute is set. Also
	repeated call to SEND_GET_COMMON in all switch cases has been
	refactored.

2012-11-29  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (init_schedule_task_iterator)
	(init_slave_task_iterator): Reverted prior change so that the name of
	tasks using them are returned ordered by name. Also added check for user
	credentials.

2012-11-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (cleanup_manage_process): Add a warning on close
	failure.

2012-11-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (type_pretty_name): Make the default "" instead of
	NULL because caller prints it directly.

2012-11-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (type_pretty_name): Remove stray semicolon that was
	causing SecInfo to be the default.

2012-11-28  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage_sql.c, src/manage.h (slave_in_use): Now checks for tasks
	using the slave independently of their location.

2012-11-28  Hani Benhabiles <hani.benhabiles@greenbone.net>

	Migrate Slave object to the new GET style object management.

	* src/manage_sql.c, src/manage.h (slave_count, slave_writable)
	(trash_slave_writable): New functions.
	(init_slave_iterator): Interface changed to take two parameters instead
	of Three. Code refactored to take advantage of new defines.
	(init_slave_task_iterator): Interface changed to take Two parameters
	instead of Five. Code refactored to use new defines.

	* src/manage_sql.c (SLAVE_ITERATOR_FILTER_COLUMNS)
	(SLAVE_ITERATOR_COLUMNS, SLAVE_ITERATOR_TRASH_COLUMNS): new defines.
	(slave_task_iterator_name): Column number value changed to Two.
	(slave_iterator_host,slave_iterator_port,slave_iterator_login)
	(slae_iterator_password): Now use GET_ITERATOR_COLUMN_COUNT accordingly.

	* src/omp.c (get_slaves_data_t): Now has two elements. get and task.
	(get_slaves_data_reset): Adapted to the modified get_slaves_data_t.
	(omp_xml_handle_start_element): Refactored CLIENT_GET_SLAVES case to use
	new GET style and refactored slave iterator. Added count and filter
	support.

2012-11-27  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (modify_filter, modify_slave): Consistently
	sql_quote() for quoted variables.

2012-11-27  Hani Benhabiles <hani.benhabiles@greenbone.net>

	Adding support for slave cloning.

	* src/omp.c (create_slave_data_t): Added copy member.
	(client_state_t): Added CLINET_CREATE_SLAVE_COPY state.
	(omp_xml_handle_start_element): Added slave copy case handling.
	(omp_xml_handle_end_element): Added handling for slave copying in slave
	creation case.
	(omp_xml_handle_text): Added CLIENT_CREATE_SLAVE_COPY value handling.

2012-11-27  Hani Benhabiles <hani.benhabiles@greenbone.net>

	Adding support for editing a slave.

	* src/omp.c (omp_command): Added MODIFY_SLAVE command.
	(modify_slave_data_t): New data structure.
	(modify_slave_data_reset): New function.
	(command_data_t): Added modify_slave.
	(client_state_t): Added states for modify slave.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Added slave modification handling.

2012-11-27  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage.h, src/manage_sql.c (modify_slave): New function.

2012-11-27  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (create_slave, delete_slave): creation_time and
	modification_time are modified appropriately.

2012-11-27  Hani Benhabiles <hani.benhabiles@greenbone.net>

	Migrate Database to version 68 to add modification_time and
	creation_time to slaves.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 68.

	* src/manage_sql.c (migrate_67_to_68): New function.
	(migrators): Add migrate_67_to_68.
	(manage_restore): Add slave creation_time and modification_time columns.

2012-11-26  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (find_target, find_schedule, find_slave): Code
	refactored to use find_resource function.

2012-11-26  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (copy_slave): New function.
	(copy_schedule): Fixed documentation.

2012-11-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (task_schedule_next_time_tz): Clear the get structure,
	to ensure that all fields are initialised, especially filt_id, which is
	used in init_get_iterator via init_schedule_iterator.

2012-11-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (type_db_name): Add NULL check, else filter ops
	segfault when type is --.

2012-11-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (CVE_INFO_ITERATOR_FILTER_COLUMNS)
	(CVE_INFO_ITERATOR_COLUMNS, CPE_INFO_ITERATOR_FILTER_COLUMNS)
	(CPE_INFO_ITERATOR_COLUMNS): Move onto SCAP page.

2012-11-23  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* ChangeLog: Detailed previous commit.

	* src/omp.c (omp_xml_handle_end_element): Moved variables declarations to
	be consistent with the coding style.

2012-11-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_get_iterator): Make the current_credentials
	assertion more accurate.
	(init_task_iterator): Use init_get_iterator in both cases, so that the
	same columns are used.

2012-11-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (task_iterator_task, task_iterator_uuid): Remove,
	there are GET iterator accessors to do this now.
	(task_iterator_run_status): Adjust column for GET change.
	(init_manage, delete_trash_tasks): Use generic accessors for task
	iterator.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_TASKS use
	generic accessors for task iterator.

2012-11-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_task_iterator): Ensure that hidden tasks are
	hidden but that it is possible to select the Example Task.

2012-11-22  Matthew Mundell <matthew.mundell@greenbone.net>

	Get tasks trash working with new style changes.

	* src/manage_sql.c (type_trash_in_table): New function.
	(init_user_get_iterator, init_get_iterator): Use the main tasks table
	for the trash cases too.  In the all trash iterator, include the extra
	WHERE clauses if given.
	(init_user_task_iterator): Move below column defines.  Use GET iterator.
	Reduce number of args.  Adjust caller.
	(schedule_iterator_first_time, schedule_iterator_period)
	(schedule_iterator_period_months): Flush trailing whitespace.

2012-11-22  Hani Benhabiles <hani.benhabiles@greenbone.net>

	Switching Schedules to the New Object Management.

	* src/manage.h, src/manage_sql.c (init_schedule_iterator): Code
	refactored. Now takes two parameters (iterator and get) instead of five.
	Also returns an integer value to reflect the success of the operation.
	Updated to use init_get_iterator.
	* src/manage_sql.c (task_schedule_next_by_tz): Updated to use the new
	init_schedule_iterator.
	(schedule_iterator_first_time, schedule_iterator_next_time)
	(schedule_iterator_period, schedule_iterator_period_months)
	(schedule_iterator_duration, schedule_iterator_timezone)
	(schedule_iterator_initial_offset): Updated to use
	GET_ITERATOR_COLUMN_COUNT.
	(schedule_iterator_next_time): Removed repetitive
	schedule_iterator_first_time calls. The check for period's value is now
	applied after the comparaison between the first and current time's
	values.
	(modify_schedule): Added check for when period_months equals zero.

	* src/omp.c (create_schedule_data_t): Added copy element for cloning.
	(get_schedules_data_t): Now has two elements: get_data_t get and int
	tasks.
	(get_schedules_data_reset): Updated for the get_schedules_data_t
	change.
	(client_state_t): Added CLIENT_CREATE_SCHEDULE_COPY.
	(omp_xml_handle_start_element): Updated GET_SCHEDULES and
	CLIENT_CREATE_SCHEDULE.
	(buffer_schedules_xml): Function removed.
	(omp_xml_handle_end_element): Updated CLIENT_GET_SCHEDULES to reflect
	schedules management changes and new schedule cloning feature.

2012-11-22  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch much of GET_TASKS to the new GET style.  As a requirement move
	many functions in manage_sql.c to better sections.

	* src/manage_sql.c (vector_find_string): Move up to General Helpers.
	(keyword_type_t, keyword_relation_t, struct keyword, keyword_t)
	(keyword_free, parse_keyword, keyword_applies, filter_free)
	(split_filter, manage_filter_controls, filter_control_int)
	(filter_control_str, manage_report_filter_controls, append_relation)
	(manage_clean_filter, get_join, filter_clause): Move up to new page
	Filter Utilities.
	(ANON_GET_ITERATOR_FILTER_COLUMNS, GET_ITERATOR_FILTER_COLUMNS)
	(ANON_GET_ITERATOR_COLUMNS, GET_ITERATOR_COLUMNS)
	(GET_ITERATOR_COLUMN_COUNT): Move up to Resources.
	(type_has_users): New function.
	(init_user_get_iterator, init_get_iterator): Move up to Resources.
	(TASK_ITERATOR_FILTER_COLUMNS, TASK_ITERATOR_COLUMNS)
	(TASK_ITERATOR_TRASH_COLUMNS): New defines.
	(init_task_iterator): Switch to GET arg and use init_get_iterator.
	(task_in_use, trash_task_in_use, task_writable)
	(trash_task_writable): New functions.
	(init_manage): Pass init_task_iterator args via GET struct.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (get_tasks_data_t, get_tasks_data_reset): Switch to GET
	field.
	(omp_xml_handle_start_element): Parse GET_TASKS GET field.
	(omp_xml_handle_end_element): IN CLIENT_GET_TASKS use the GET field and
	SEND_GET_COMMON.

2012-11-22  Matthew Mundell <matthew.mundell@greenbone.net>

	Add creation and modification times to tasks.  Hence increase database
	version to 67.  Add database migration from version 66 to 67.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 67.

	* src/manage_sql.c (create_tables): Add time fields to task.
	(migrate_66_to_67): New function.
	(migrators): Add migrate_66_to_67.
	(append_to_task_string, init_manage, task_config_in_trash, task_target)
	(task_slave, set_task_description, task_start_time, set_task_start_time)
	(set_task_schedule, set_task_parameter, set_task_parameter): Update task
	modification time.
	(make_task): Set task modification time.
	(copy_task): Enable time code.
	(manage_task_update_file, manage_task_remove_file)
	(set_task_preferences): Update task preferences.

	* doc/db.png: Update for version changes.

2012-11-21  Matthew Mundell <matthew.mundell@greenbone.net>

	Add COPY to OMP CREATE_TASK, for cloning.

	* src/manage_sql.c (copy_task): New function.

	* src/manage.h: Update header accordingly.

	* src/manage_sql.c (create_task_data_t, create_task_data_reset)
	(client_state_t): Add CREATE_TASK copy.
	(send_get_end): Remove the task in the create_task case, because it is
	created early.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add CREATE_TASK/COPY.

2012-11-21  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (manage_restore): Restore creation_time and
	modification_time too.

2012-11-21  Hani Benhabiles <hani.benhabiles@greenbone.net>

	Add modification_time and creation_time to schedules. Fixed indentation
	from previous commit.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 66, for
	adding creation_time and modification_time columns to schedules and
	schedules_trash tables.

	* src/manage_sql.c (modify_schedule): modification_time is updated too.
	(create_schedule): creation_time and modification_time are inserted and
	deleted too.
	(delete_schedule): creation_time and modification_time are inserted too
	when moving the schedule to the trash.
	(schedule_writable, schedule_in_use, SCHEDULE_ITERATOR_FILTER_COLUMNS)
	(SCHEDULE_ITERATOR_TRASH_COLUMNS): Fixed indentation.

2012-11-21  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage_sql.c src/manage.h (schedule_copy, schedule_count)
	(schedule_writable, schedule_in_use, trash_schedule_writable)
	(trash_schedule_in_use): New functions.

2012-11-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (modify_filter): Ensure type name is db style.

2012-11-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (type_pretty_name, type_db_name): New functions.
	(create_filter): Ensure type name is db style.
	(filter_iterator_type): Return pretty version of type name.

2012-11-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (valid_type): Add report_format.

2012-11-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (client_state_t): Add NVT FAMILY.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Parse
	FAMILY in CREATE_REPORT RESULT/NVT.

2012-11-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (filter_clause): Compare text with = instead of IS in
	SQL, because Sqlite3 only accepts text as rvalue of IS from 3.6.19.

2012-11-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db.png: Update for version change.

2012-11-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Set the report on the result when adding a result to a report.  Add a
	migrator to set the report in all existing results.  Hence increase
	database version to 65.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 65.

	* src/manage_sql.c (migrate_64_to_65): New function.
	(migrators): Add migrate_64_to_65.
	(init_manage, create_report): Use report_add_result to add result.
	(report_add_result): Set report on result.

2012-11-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (manage_run_wizard): Allocate empty string because it
	will be freed.

2012-11-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ompd.c (CLIENT_TIMEOUT): Remove.
	(serve_omp): Remove client timeout, because the current implementation
	causes the client to timeout right at the end of very long operations,
	like getting big reports.

2012-11-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): Remove prefix arg.  Update
	callers.
	(manage_send_report): Send the prefix by hand instead of passing it
	to print_report_xml.  This is required because the prefix is part of
	the XML that wraps the formatted report, which may be base64 encoded.

2012-11-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Mimic the new powerfilter "match entire column" term in the report filter.

	* src/manage_sql.c (where_search_phrase): Add exact arg.
	(init_result_iterator, report_scan_result_count, report_counts_match)
	(report_count_filtered, report_counts_id_filt): Add search_phrase_exact
	arg.  Update callers.
	(report_filter_term): Quote phrase.  Prepend = if exact.  Add 1 to
	first_result for 1 indexing.
	(print_report_xml): Add search_phrase_exact handling.
	(split_filter): For quotes, check for the exact case too.
	(manage_report_filter_controls): Add search_phrase_exact arg.  Switch
	first to 0 indexing.  Default max to 100 instead of all.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (buffer_notes_xml, omp_xml_handle_end_element): Update
	init_result_iterator call.

2012-11-14  Andre Heinecke <andre.heinecke@greenbone.net>

	* report_formats/verinice-ism/classification_generator.sh: Allow semicolon
	seperated files.

	* report_formats/verinice-ism/classification.xsl: Use more generic tags

	* report_formats/verinice-ism/create_report_import: Increase Version
	number and fix broken filename.

2012-11-13  Matthew Mundell <matthew.mundell@greenbone.net>

	In a powerfilter if a term begins with =, then match term entirely
	instead of as a substring.

	* src/manage_sql.c (struct keyword): Add equal flag.
	(split_filter): Flag keywords that have leading =.
	(manage_clean_filter): Add leading equal if flag set.
	(filter_clause): Add case for exact term match.

2012-11-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (task_threat_level, task_previous_threat_level)
	(init_result_iterator, init_asset_iterator, report_scan_result_count)
	(filtered_host_count): Use coalesce instead of CASE, if only to make the
	resulting SQL more readable.

2012-11-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (where_levels): Use IN instead of multiple
	comparisons.  It's neater, and apparently allows for an index to be
	used.

2012-11-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (mainpage): Remove ref to test code.

2012-11-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c, src/omp.c, src/sql.c: Clean up doc @params.

2012-11-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (parse_keyword): Add actual months instead of fixed
	approximations.

2012-11-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (parse_keyword): Add relative dates, like -7d for 7
	days ago.

2012-11-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/sql.c (sqlv): Retry a few times before giving up, to prevent the
	function from giving up every time.

2012-11-13  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* tools/openvas-scapdata-sync.in, tools/greenbone-scapdata-sync:
	Consistently use variable name SCAP_RES_DIR.

2012-11-13  Andre Heinecke <aheinecke@intevation.de>

	Add SCAP DB Migration for new CVE info

	* tools/openvas-scapdata-sync.in, tools/greenbone-scapdata-sync
	(check_db_version): Migrate to 4 instead of reinitializing.
	(migrate_3): Readded.
	(migrate_4): New. Migrate to database version 4

	* tools/migrate_db4.xsl: New. Add new CVSS information to CVE table

	* CMakeLists.txt: Install migrate_db4.xsl

2012-11-13  Andre Heinecke <andre.heinecke@greenbone.net>

	Add iterable and filterable get_info for CVE

	* src/manage_sql.c (CVE_INFO_ITERATOR_FILTER_COLUMNS)
	(CVE_INFO_ITERATOR_COLUMNS): New Defines.
	(cve_info_count): New. Count cve_info elements.
	(init_cve_info_iterator): New. Initialize cve_info iterator.
	(cve_info_iterator_vector, cve_info_iterator_complexity)
	(cve_info_iterator_authentication)
	(cve_info_iterator_confidentiality_impact)
	(cve_info_iterator_integrity_impact)
	(cve_info_iterator_availability_impact)
	(cve_info_iterator_products, cve_info_iterator_cvss)
	(cve_info_iterator_description): New. Accessors to cve_info columns.
	Updated header accordingly.

	* src/manage.c (CPE_GETBYNAME_XSL, CPE_DICT_FILENAME): Readded defines for
	direct CPE access.
	(get_cpe_filename): Readded.
	(manage_read_info): Add support for cpe again. Reduce result to only
	untampered raw data for CVE and CPE.

	* src/manage.h (manage_scap_update_time): Add prototype to header

	* src/omp.c (omp_xml_handle_end_element): Iterator based support for CVE.
	Add raw_data to get_info_result if details are requested. Add update_time
	elment to get_info responses.

	* src/schema_formats/XML/OMP.xml: Update documentation of get_info

	* tools/cve_update.xsl (cve:entry): Add more information to the database.

	* tools/db_init.sql (meta): Increase scap database version to 4
	(cves): Add vector, complexity, authentication, confidentiality_impact,
	integrity_impact, availability_impact and products column

	* tools/openvas-scapdata-sync.in, tools/greenbone-scapdata-sync
	(check_db_version): Reinitialize versions older then 4.
	(migrate_3): Removed.

	* doc/omp.html, doc/omp.rnc: Update from source.

2012-11-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (cache_report_counts): New function.  Body from
	report_counts_id_filt.  Use sql_giveup to run the SQL because it seems
	that demanding a lock for the UPDATE can deadlock if another process
	does a write.
	(report_counts_id_filt): Call cache_report_counts to cache the counts.

	* src/sql.c (sqlv): New function.  Body from sql.
	(sql): Call through to sqlv.
	(sql_giveup): New function.  Like sql but gives up if database locked
	or busy.

	* src/sql.h: Add header accordingly.

2012-11-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (override_count, init_override_iterator): Rework the
	SQL of the task case to take advantage of the new results.report column
	and to select within the statement instead of joining.  This greatly
	improves the performance of GET_OVERRIDES with a task_id when the
	database is large.

2012-11-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (note_count, init_note_iterator): Rework the SQL of
	the task case to take advantage of the new results.report column and to
	select within the statement instead of joining.  This greatly improves
	the performance of GET_NOTES with a task_id when the database is large.

2012-11-09  Matthew Mundell <matthew.mundell@greenbone.net>

	Account for nvt and task in GET_OVERRIDES count, and handle the GET_OVERRIDES
	task_id filter term correctly.

	* src/manage_sql.c (OVERRIDE_ITERATOR_FILTER_COLUMNS): Remove task_id
	because it is now handled specially.
	(override_count): Add nvt, result and task args so that the count takes
	these into account, just like init_override_iterator.  Add special handling
	of task_id in the filter because it's more complex than just a column
	match.
	(init_override_iterator): Add special handling of task_id in the filter
	because it's more complex than just a column match.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): Add nvt and task args to
	override_count in GET_OVERRIDES.

2012-11-09  Andre Heinecke <aheinecke@intevation.de>

	Version 1.1.5 of verinice ISM export

	* report_formats/verinice-ism/classification-helpers.xsl,
	report_formats/verinice-itg/classification-helpers.xsl: Moved
	classification helpers file into itg.

	* report_formats/verinice-itg/create_report_import: Update Path of
	classification-helpers.xsl file

	* report_formats/verinice-ism/classification_generator.sh: Remove check
	for detail name. Fix syntax errors.

	* report_formats/verinice-ism/gsm_verinice_ism.xsl: Include generated
	classifcation.xsl
	(extract_organization): New. Copied from classification-helpers
	(report/host_start): Only generate tags based on best_os_cpe, set
	gsm_ism_asset_type
	(syncMapping): Add gsm_ism_asset_type, change from samt_topic to control
	(create_links): Change releation from samt_topic_incident_scenario to
	rel_control_incsen

	* report_formats/verinice-ism/classification.xsl: New. generated from
	classification.csv

	* report_formats/verinice-ism/create_report_import.xsl: Update Version
	number, include classification.xsl

2012-11-08  Matthew Mundell <matthew.mundell@greenbone.net>

	Account for nvt and task in GET_NOTES count, and handle the GET_NOTES
	task_id filter term correctly.

	* src/manage_sql.c (count): Add args to give caller more control of SQL,
	as in init_get_iterator.  Update callers.
	(NOTE_ITERATOR_FILTER_COLUMNS): Remove task_id because it is now handled
	specially.
	(note_count): Add nvt, result and task args so that the count takes
	these into account, just like init_note_iterator.  Add special handling
	of task_id in the filter because it's more complex than just a column
	match.
	(init_note_iterator): Add special handling of task_id in the filter
	because it's more complex than just a column match.
	(filter_term_value): New function.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): Add nvt and task args to
	note_count in GET_NOTES.

2012-11-08  Andre Heinecke <andre.heinecke@greenbone.net>

	* report_formats/verinice-ism/classification_generator.sh: New.
	Generator to create XSL helper template for verinice system tags from
	a csv file.
	* report_formats/verinice-ism/classification.csv: New. CSV File
	containting CPE's and tags for verinice ism

2012-11-07  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* tools/openvas-scapdata-sync: Added command-line options --describe and
	--feedversion as well as needed variables.

2012-11-07  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* tools/greenbone-scapdata-sync: Add command line option --selftest
	and moved command lin eparsing to bottom.

2012-11-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (create_override, create_target): Add
	COPY.
	(delete_note, delete_override): Add attribute ultimate.
	(get_notes, get_overrides): Add new-style filter attributes and response
	elements.

	* doc/omp.html, doc/omp.rnc: Update from source.

2012-11-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db_postgres.sql (results): Add report.
	(overrides_trash): New table.

	* doc/db.png: Update from source.

2012-11-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (filter_clause): Add name special case for overrides
	as for notes.

2012-11-06  Matthew Mundell <matthew.mundell@greenbone.net>

	Add trashcan feature to overrides.

	* src/omp.c (delete_override_data_reset): Add ultimate.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add ultimate
	flag to DELETE_OVERRIDE.

	* src/manage_sql.c (create_tables): Add overrides_trash.
	(delete_override): Add ultimate arg and trashcan handling.
	(OVERRIDE_ITERATOR_TRASH_COLUMNS): Explicitly specify columns.
	(manage_restore): Add overrides.

	* src/manage.h: Update header accordingly.

2012-11-06  Matthew Mundell <matthew.mundell@greenbone.net>

	Add COPY to CREATE_OVERRIDE for cloning.

	* src/manage_sql.c (copy_override): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (create_override_data_t, create_override_data_reset): Add
	copy.
	(client_state_t): Add CLIENT_CREATE_OVERRIDE_COPY.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add COPY to CREATE_OVERRIDE.

2012-11-06  Matthew Mundell <matthew.mundell@greenbone.net>

	Add filtering to GET_OVERRIDES.

	* src/manage_sql.c (OVERRIDE_COLUMNS): Remove.
	(OVERRIDE_ITERATOR_FILTER_COLUMNS, OVERRIDE_ITERATOR_COLUMNS)
	(OVERRIDE_ITERATOR_TRASH_COLUMNS): New defines.
	(override_count): New function.
	(init_override_iterator): Update to new GET style with filter, leaving
	certain override-specific "filtering" params.  Adjust all accessors
	accordingly.
	(override_iterator_creation_time)
	(override_iterator_modification_time): Remove

	* src/manage.h: Update headers accordingly.

	* src/omp.c (get_overrides_data_t): Switch to generic GET arg.
	(omp_xml_handle_start_element): Parse generic GET data in GET_OVERRIDES.
	(buffer_overrides_xml):  Add standard GET elements.  Add count return.
	(buffer_result_overrides_xml, omp_xml_handle_end_element): Pass generic GET
	arg to iterator.

2012-11-05  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number to 4.0+beta5.

2012-11-05  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 4.0+beta4 release.

	* CHANGES: Updated.

	* doc/CMakeLists.txt: Update forgotten command to work with
	out-of-source builds.

2012-11-04  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* tools/greenbone-scapdata-sync: Added command line options
	--identify, --describe and --feedversion.

2012-11-02  Andre Heinecke <andre.heinecke@greenbone.net>

	* src/manage_sql.c (send_to_verinice, send_to_sourcefire): Do proper
	quoting.

2012-11-02  Andre Heinecke <aheinecke@intevation.de>

	* src/manage_sql.c (send_to_verinice): Correct parameter count in command.

2012-11-02  Andre Heinecke <aheinecke@intevation.de>

	* src/manage_sql.c (escalate_2): Create verinice archive with verinice-ism
	and send it with send_to_verinice.
	(send_to_verinice): Change parameters to be an url and an archive file
	instead of ip port and report. Fix call of the connector.

2012-11-02  Andre Heinecke <aheinecke@intevation.de>

	* src/manage_sql.c (manage_report): Initialize get structure

2012-11-02  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/manage_sql.c (send_to_verinice, send_to_sourcefire): Sanitize
	parameters before they reach the shell.

2012-11-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (buffer_notes_xml): Make in_use 0 so that notes can be moved
	to the trashcan.

2012-11-02  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/manage_sql.c (send_to_verinice, send_to_sourcefire): Add quotes
	to preserve space where appropriate.

2012-11-02  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/manage_sql.c (send_to_verinice, send_to_sourcefire): Drop
	privileges when run as root.

2012-11-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (append_relation, manage_clean_filter): Preserve
	quotation of keywords.

2012-11-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_asset_iterator, filtered_host_count): In the
	"Text phrase" case, move the phrase filtering out to happen after the
	host selection, as in the old slower SQL.

2012-11-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_asset_iterator, filtered_host_count): Rework
	SQL of "Text phrase" case, to take advantage of the new results report
	column and index.  For the count add report status check and in_assets
	check.

2012-11-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Improve performance of the simple case of the Assets report.  Hence
	increase database version to 64.  Add database migration from version 63
	to 64.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 64.

	* src/manage_sql.c (create_tables): Add report to results.  Add index
	results_by_report_host.
	(migrate_63_to_64): New function.
	(migrators): Add migrate_63_to_64.
	(init_asset_iterator, filtered_host_count): Rework SQL of most common
	case, to take advantage of the new results report column and index.  For
	the count add report status check and in_assets check.

2012-11-02  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/manage_sql.c (filter_clause): Let empty keywords match NULL.
	This patch was developed by Matthew Mundell.

2012-11-01  Michael Wiegand <michael.wiegand@greenbone.net>

	* CHANGES: Updated.

2012-11-01  Michael Wiegand <michael.wiegand@greenbone.net>

	* INSTALL: Update for out-of-source builds, update openvas-libraries
	dependency, mention verinice .PRO connector, replace "escalator" with
	"alert".

2012-11-01  Michael Wiegand <michael.wiegand@greenbone.net>

	Update targets for out-of-source builds.

	* doc/CMakeLists.txt: Update commands and targets to work with
	out-of-source builds.

	* doc/Doxyfile.in: Updated to work with out-of-source builds,
	harmonized with other modules.

	* doc/Doxyfile_full.in: Harmonized with Doxyfile.in.

	* src/CMakeLists.txt: Ensure that the target "splint", "rats",
	"flawfinder", "etags" and "ctags" work with out-of-source builds.

2012-11-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (modify_schedule): When intervals are -1 retain the
	existing value, instead of when intervals are 0.  This allows setting
	the value to 0.

	* src/omp.c (time_from_strings): Return -1 if value was NULL and -2 on
	error.  Adjust callers.

2012-11-01  Michael Wiegand <michael.wiegand@greenbone.net>

	Add support for sending alerts to a verinice .PRO server.

	* src/manage.h: Introduce ALERT_METHOD_VERINICE.

	* src/manage.c (alert_method_name, alert_method_from_name): Add
	support for ALERT_METHOD_VERINICE.

	* src/manage_sql.c (send_to_verinice): New function.
	(escalate_2): Add new case for ALERT_METHOD_VERINICE.

	* src/alert_methods/verinice/alert: New.

	* CMakeLists.txt: Ensure alert script is installed.

2012-10-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (modify_schedule): Update task next time too.

2012-10-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (slave_system_report): Request duration too, by using
	omp_get_system_reports_ext.

2012-10-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (modify_schedule): New command.
	(get_schedules): Add SIMPLE_PERIOD and SIMPLE_DURATION.

	* doc/omp.html, doc/omp.rnc: Update from source.

2012-10-30  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP MODIFY_SCHEDULE.

	* src/manage_sql.c (modify_schedule): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (time_from_strings): Add timezone arg.  Update caller.
	(omp_commands, command_data_t): Add modify_schedule.
	(modify_schedule_data_t): New type.
	(modify_schedule_data_reset): New function.
	(modify_schedule_data): New variable.
	(client_state_t): Add MODIFY_SCHEDULE states.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add MODIFY_SCHEDULE.
	(buffer_schedules_xml): Add SIMPLE_DURATION and SIMPLE_PERIOD to SCHEDULE
	to make it easier for basic clients to figure out the values and units.

2012-10-29  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* CMakeLists.txt: Increase dependency of openvas-libraries from 5.0.0
	to 6.0.0.

	* INSTALL: Drop Debian 5, updated pre-requisites.

2012-10-29  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* CHANGES: Prepared for the next beta release.

2012-10-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (get_schedule): Add TIMEZONE.

	* doc/omp.html, doc/omp.rnc: Update from source.

2012-10-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (buffer_schedules_xml): Skip the timezone adjustment when
	the schedule is over.

2012-10-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (buffer_schedules_xml): Use time_offset instead of
	current_offset for first_time because first_time may be the other side
	of a DST changeover.
	(omp_xml_handle_end_element): For GET_TASKS get schdule next_time with
	task_schedule_next_time_tz so that it follows the schedule's timezone.

	* src/manage_sql.c (task_schedule_next_time): Remove.
	(task_schedule_next_time_tz): New function.
	(task_schedule_iterator_stop_due): Account for schedule's timezone.

	* src/manage.h: Update headers accordingly.

2012-10-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (iso_time_tz, time_offset): New functions.
	(init_schedule_iterator): Add timezone and initial_offset.
	(schedule_iterator_timezone, schedule_iterator_initial_offset): New
	functions.
	(schedule_iterator_in_use): Adjust column number accordingly.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (buffer_schedules_xml): Add TIMEZONE to SCHEDULE.  Adjust
	next time for daylight saving.

2012-10-25  Matthew Mundell <matthew.mundell@greenbone.net>

	Handle daylight saving in schedules.  Hence increase database version to
	63.  Add database migration from version 62 to 63.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 63.

	* src/manage_sql.c (current_offset): New function.
	(create_tables): Add timezone and offset columns to schedules.
	(migrate_62_to_63): New function.
	(migrators): Add migrate_62_to_63.
	(init_manage_process): Init current_offset.
	(create_schedule): Init timezone and offset according to user's current
	timezone.
	(delete_schedule, manage_restore): Add new schedule columns.
	(init_task_schedule_iterator): Add owner and new schedule columns.
	(task_schedule_iterator_owner, task_schedule_iterator_timezone)
	(task_schedule_iterator_initial_offset): New functions.
	(task_schedule_iterator_start_due): Account for daylight saving.

	* src/manage.c (manage_schedule): Adjust times for daylight saving.

	* src/sql.c (sql_current_offset): New function.

	* src/manage.h, src/sql.h, src/manage_sql.h: Add headers accordingly.

	* doc/db_postgres.sql (schedules): Add fields.

	* doc/db.png: Update from source.

2012-10-25  Andre Heinecke <aheinecke@intevation.de>

	Use Epoch date instead of ISO date in scap.db

	* tools/openvas-scapdata-sync.in, tools/greenbone-scapdata-sync
	(migrate_3): New.
	(migrate_to_2, reinit): Renamed migrate_to_2 to reinit.
	(check_db_version): Migrate from 2 to 3.

	* tools/db_init.sql: Bump Version number to 3

	* tools/cve_update.xsl (cve:entry): Call strftime to insert times in epoch
	format. Consistently use single single quotes in sql statements.

	* tools/cpe_update.xsl (cpe:cpe-item): Use strftime to insert times in
	epoch format.

	* src/manage_sql.c (CPE_INFO_ITERATOR_COLUMNS): Use generic
	GET_ITERATOR_COLUMNS together with the specific columns.

2012-10-25  Andre Heinecke <aheinecke@intevation.de>

	* src/omp.c (omp_xml_handle_end_element): Check for manage_scap_loaded and
	send an error similiar to the one from prognostic reports otherwise.
	Reset get_info_data and break correctly when errors are detected.

2012-10-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (run_slave_task): Create target with
	omp_create_target_ext in order to specify port list.

2012-10-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): Add prefix arg.  Print it just
	before first part of report.  Change filter_term error to 2.  Update
	callers.
	(manage_send_report): Pass prefix to print_report_xml and check for 2
	return.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In GET_REPORTS for the
	standard scan report when there is a single report let
	manage_send_report handle the report heading.  This allows detection of
	the filter_term error before anything is sent to the client, and so
	the connection can stay open when this error occurs.

2012-10-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): Allocate levels in fallback case,
	as it is now allocated in the filter cases.

2012-10-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Correct command name in
	GET_AGENTS error response.

2012-10-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (filter_clause): Add trash arg.  Use notes_trash
	table if set.  Update callers.

2012-10-19  Andre Heinecke <aheinecke@intevation.de>

	Readd description to the CVE table

	* src/manage_sql.c (prognosis_where_search_phrase),
	(init_host_prognosis_iterator): Uncomment cves.description again.

	* tools/openvas-scapdata-sync.in, tools/greenbone-scapdata-sync
	(check_db_version): Handle Version 1. Correct column name of
	database_version.
	(migrate_to_2): New. Just reinitializes the database.
	(migrate_0_to_1): Removed.
	(update_sec_db): Do not delete database if refdate is empty.

	* tools/greenbone-scapdata-sync: Update script Version.

	* tools/db_init.sql: Change DB version to 2.
	(cves): Add description column.
	* tools/cve_update.xsl (cve:entry): Insert description.

2012-10-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.h (iterator_t): Add prepared flag.

	* src/sql.c (sql_double, sql_prepare, init_prepared_iterator): New
	functions.
	(init_iterator): Clear prepared flag.
	(cleanup_iterator): Skip finalize if prepared.

	* src/sql.h: Add headers accordingly.

	* src/manage_sql.c (cpe_highest_cvss): New function.
	(init_prognosis_iterator): Prepare the iterator statement once per
	process instead of every time.
	(prognosis_where_search_phrase, init_host_prognosis_iterator): Comment
	out cves.description for now.
	(print_report_xml): Only print the CVEs of the App when the details flag
	is given.  Get the highest CVSS of a CVE from the SCAP db instead of
	computing it.  These two combine to make the GSA Host Assets Table much
	faster.  Print the host prognosis once instead of for every detail.

2012-10-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* tools/openvas-scapdata-sync (SQLITE): New variable.  Replace all calls
	to sqlite3 with this, to override the users header config.
	(update_sec_db): Quotes variables in condition for empty string test.
	Replace log_write with echo, log_write is for greenbone-scapdata-sync.

2012-10-17  Matthew Mundell <matthew.mundell@greenbone.net>

	Add simple report count caching.  Hence increase database version to 62.
	Add database migration from version 61 to 62.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 62.

	* src/manage_sql.c (create_tables): Add cache columns to reports.
	(migrate_61_to_62): New function.
	(migrators): Add migrate_61_to_62.
	(init_manage, make_report): Init report cache columns.
	(reports_clear_count_cache, report_cache_counts): New functions.
	(set_scan_end_time_otp): Cache report counts.
	(report_counts_id_filt): In the "all" case try to read the counts from
	the cache, and store counts in cache after counting.
	(create_override, modify_override): Clear cached override counts in
	report.

	* doc/db_postgres.sql (reports): Add cache fields.

	* doc/db.png: Update from source.

2012-10-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In the brief GET_TASKS case
	take into account that the count for the older report will be reused
	when there are only one or two reports, and correct the name of the
	task variable passed to task_trend_counts.

2012-10-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (task_trend_calc, task_trend_counts): New functions.
	(task_trend): Call task_trend_calc.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_end_element): For the brief GET_TASKS
	version call task_trend_counts to get the trend, in order to save
	some counting.

2012-10-15  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* tools/greenbone-scapdata-sync: Fixed a wrong path.

2012-10-15  Andre Heinecke <aheinecke@intevation.de>

	Expand get_info for multiple info elements and implement iteratable CPE info

	* src/manage_sql.c (count, get_target_iterator): Add owned parameter
	to allow handling types without owner. Update callers.
	(cpe_info_count): New. Count info elements of type cpe
	(init_cpe_info_iterator): New. Initialize a get iterator for info of type
	cpe
	(cpe_info_iterator_title, cpe_info_iterator_status)
	(cpe_info_iterator_deprecated_by, cpe_info_iterator_max_cvss)
	(cpe_info_iterator_cve_refs): New functions to access iterator.
	(CPE_INFO_ITERATOR_FILTER_COLUMNS, CPE_INFO_ITERATOR_COLUMNS): New
	defines.
	(init_cpe_cve_iterator): Update column name for "cve name".
	(cpe_info_count): New function to count cpe info.
	(valid_type): Add info type

	* src/manage.h: Add header accordingly.

	* src/manage.c (get_cpe_filename): Removed.
	(manage_read_info): Remove old handling of CPEs.
	(CPE_GETBYNAME_XSL, CPE_DICT_FILENAME): Removed define.

	* src/omp.c (get_info_data_t): Add generic GET arg and add details value.
	(get_info_data_reset): Also reset the generic get_data
	(send_get_start, send_get_end): Do not send plural form of info
	(send_get_start): Send empty elements instead of (null) when an element is
	null.
	(omp_xml_handle_start_element): Parse generic GET data and details in GET_INFO
	(omp_xml_handle_end_element): Add iterator based handling for CPEs

	* src/schema_formats/XML/OMP.xml: Update get_info documentation

	* doc/omp.html, doc/omp.rnc: Update from source.

2012-10-15  Andre Heinecke <aheinecke@intevation.de>

	Allow more generic handling of SCAP Data and expand CPE/CVE info

	* tools/db_init.sql (meta): Add meta table for version information.
	(cves): Remove description but add generic data fields
	(cpes): Add generic data fields and additional columns
	(cves_delete): New. Trigger for cve deletion to correctly adopt
	affected_products.
	(affected_delete): New. Trigger to keep cached information about related
	cves accurate in the cpe table.

	* tools/greenbone-scapdata-sync, tools/openvas-scapdata-sync
	(migrate_0_to_1, check_db_version): New. support a versioned Database.

	* tools/greenbone-scapdata-sync (update_scap_db),
	tools/openvas-scapdata-sync (update_sec_db): Handle database version
	and last_updated from database.

	* tools/cve_update.xsl: Add statements to calculate cpe max_cvss and
	cve_refs values. Use new columns.

	* tools/cpe_update.xsl: Use new columns. Escape names and titles.

2012-10-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (manage_read_info): Append XML with xml_string_append,
	in case it contains special chars.

2012-10-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db_postgres.sql (notes_trash): New table.

	* doc/db.png: Update from source.

2012-10-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (create_note): Add COPY.

	* doc/omp.html, doc/omp.rnc: Update from source.

2012-10-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (note_count): Remove comment.  Extra SQL only
	needed when a subset of the notes is required (like notes on a task).

2012-10-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (buffer_notes_xml): Add count arg.  Update callers.  Match
	XML to send_get_common.
	(buffer_result_notes_xml): Add sorting.
	(omp_xml_handle_end_element): Remove targets reference code.

2012-10-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Add missing return case for
	copy_filter, copy_note and copy_target.

2012-10-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage_process): Add database to SCAP check
	otherwise it always fails.

2012-10-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage_process): Check for the cves table when
	setting scap_loaded, to ensure that the db schema has been created.

2012-10-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (nvt_selector_plugins): Always add all settings NVTs onto
	plugins preference.

	* src/manage_sql.c (init_nvt_iterator): Add category case.  Update
	callers.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_end_element): Update init_nvt_iterator call.

2012-10-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (split_filter): If there is a filter, make the
	max_return default to Rows Per Page.
	(filter_clause): Init max_return for safety.  Add a special sorting
	case for notes to get the rows sorted by text as a second field.
	(NOTE_ITERATOR_FILTER_COLUMNS, NOTE_ITERATOR_COLUMNS): Add name so
	there is something to sort by in the default case.

2012-10-08  Andre Heinecke <aheinecke@intevation.de>

	* report_formats/verinice-itg/gsm_verinice_itg.xsl (get-details):
	Look for detail named MAC instead of mac_address

2012-10-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_note): Check that NVT exists.

	* src/omp.c (omp_xml_handle_end_element): Handle new create_note return.

2012-10-05  Andre Heinecke <aheinecke@intevation.de>

	Only include application Tags in itg report.

	* report_formats/verinice-ism/classification-helpers.xsl (detail):
	Rename to generate-tags add parameter to include apps

	* report_formats/verinice-itg/gsm_verinice_itg.xsl (/):
	Use extract Organization instead of the task name as general id.
	(report/host_start): Call generate-tags instead of matching

	* report_formats/verinice-ism/gsm_verinice_ism.xsl (report/host_start):
	Call generate-tags without parameter instead of matching the template

2012-10-05  Michael Wiegand <michael.wiegand@greenbone.net>

	* tools/greenbone-scapdata-sync: Improve handling of present, but
	empty DB files.

2012-10-04  Matthew Mundell <matthew.mundell@greenbone.net>

	Add trashcan feature to notes.

	* src/omp.c (delete_lsc_credential_data_reset): Add ultimate.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add ultimate
	flag to DELETE_NOTE.

	* src/manage_sql.c (create_tables): Add notes_trash.
	(delete_note): Add ultimate arg and trashcan handling.
	(NOTE_ITERATOR_TRASH_COLUMNS): Explicitly specify columns.
	(manage_restore): Add notes.

	* src/manage.h: Add header accordingly.

2012-10-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (NOTE_ITERATOR_COLUMNS): Add missing table to column.

2012-10-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (NOTE_ITERATOR_COLUMNS): Remove duplicates.  Update
	accessors accordingly.

	* src/omp.c (buffer_notes_xml): Switch to generic accessors for common
	GET fields.

2012-10-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (NOTE_ITERATOR_COLUMNS): Add fake task_id column so
	that when the general filter clause is used there is a column to lookup.

2012-10-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (filter_clause): Exclude nvt_id from the _id
	handling.
	(ANON_GET_ITERATOR_FILTER_COLUMNS): Add nvt_id.
	(NOTE_ITERATOR_COLUMNS): Add special column for nvt_id.

2012-10-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (filter_clause): For an equal relation, when the
	column ends in "_id" then add a clause that does a UUID comparison
	across tables.
	(NOTE_ITERATOR_FILTER_COLUMNS): Add task_id to possible filter columns.

2012-10-03  Matthew Mundell <matthew.mundell@greenbone.net>

	Add COPY to CREATE_NOTE for cloning.

	* src/manage_sql.c (type_named): New function.
	(copy_resource): Check if type has name and comment.
	(copy_note): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (create_note_data_t, create_note_data_reset): Add copy.
	(client_state_t): Add CLIENT_CREATE_NOTE_COPY.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add COPY to CREATE_NOTE.

2012-10-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (target_writable, trash_target_writable): Invert
	test.

2012-10-02  Andre Heinecke <aheinecke@intevation.de>

	* tools/openvas-scapdata-sync.in (update_sec_db):
	Correct variable name used in the CPEBASE stat call

2012-10-02  Andre Heinecke <aheinecke@intevation.de>

	Improve performance of latex text escaping

	* src/report_formats/LaTeX/latex.xsl (escape_text): Avoid
	uneccessary copy of the string to escape.
	(escape_special_chars): New. Use str:replace instead of
	latex-prepend-backslash
	(latex-prepend-backslash): Removed

2012-10-01  Matthew Mundell <matthew.mundell@greenbone.net>

	Add filtering to GET_NOTES.

	* src/manage_sql.c (ANON_GET_ITERATOR_FILTER_COLUMNS)
	(ANON_GET_ITERATOR_COLUMNS): New defines.
	(init_user_get_iterator, init_get_iterator): Give caller more SQL
	flexibility.  Update callers.
	(NOTE_ITERATOR_FILTER_COLUMNS, NOTE_ITERATOR_COLUMNS)
	(NOTE_ITERATOR_TRASH_COLUMNS): New defines.
	(note_count): New function.
	(init_note_iterator): Update to new GET style with filter, leaving
	certain note-specific "filtering" params.  Adjust all accessors
	accordingly.

	* src/manage.h: Update headers accordingly.
	(get_data_t): Add details.

	* src/omp.c (get_data_parse_attributes): Add details.
	(get_notes_data_t): Switch to generic GET arg.
	(omp_xml_handle_start_element): Parse generic GET data in GET_NOTES.
	(buffer_result_notes_xml, omp_xml_handle_end_element): Pass generic GET
	arg to iterator.  Use correct command in CLIENT_GET_TARGETS error.

2012-10-01  Michael Wiegand <michael.wiegand@greenbone.net>

	* tools/openvas-scapdata-sync.in: Do not use the timestamp of $SEC_DB
	to decide which CPEs/CVEs to add/update. Use the timestamp of the last
	modified CVE in the DB instead.

2012-09-28  Michael Wiegand <michael.wiegand@greenbone.net>

	* report_formats/verinice-ism/create_report_import: Bump version
	number.

2012-09-28  Andre Heinecke <aheinecke@intevation.de>

	* report_formats/verinice-ism/gsm_verinice_ism.xsl (create_links):
	Correct relationId's

	* report_formats/verinice-ism/gsm_verinice_ism.xsl (get-details):
	Only use the hostname for the asset if available instead of hostname - ip

2012-09-27  Andre Heinecke <aheinecke@intevation.de>

	* report_formats/verinice-ism/generate: Use _ instead of - as the
	separator between Scan Name and Date for file attachment names.

2012-09-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (config_writable): Add location and hidden check as
	in config_in_use.
	(manage_set_config_preference, manage_set_config_nvts)
	(manage_set_config_families): Add hidden clause to "config in use"
	check.  Thanks to Sebastien Aucouturier for pointing this out.

2012-09-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (client_state_t, omp_xml_handle_end_element): Remove
	spurious state.  Correct command name in error message.

	* src/schema_formats/XML/OMP.xml: Add modify_target.

	* doc/omp.html, doc/omp.rnc: Update from source.

2012-09-25  Michael Wiegand <michael.wiegand@greenbone.net>

	* report_formats/verinice-ism/create_report_import: Bump version
	number.

2012-09-25  Andre Heinecke <aheinecke@intevation.de>

	* report_formats/verinice-ism/gsm_verinice_ism.xsl: Remove scan name from
	group names.

2012-09-25  Andre Heinecke <aheinecke@intevation.de>

	* report_formats/verinice-ism/gsm_verinice_ism.xsl: Use filename as ID.

	* report_formats/verinice-ism/generate: Include task name and current
	date in filenames for attachments.

2012-09-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_start_element): Move CREATE_AGENT and
	CREATE_TARGET name init to name element, to match filters.
	(omp_xml_handle_end_element): Check that NAME exists in CREATE_AGENT
	and CREATE_TARGET, as in CREATE_FILTER.

2012-09-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (modify_target): Add assertions.

	* src/omp.c (omp_xml_handle_end_element): In MODIFY_TARGET check for
	target_id and port_list_id, and add missing return case.

2012-09-21  Michael Wiegand <michael.wiegand@greenbone.net>

	* report_formats/verinice-ism/create_report_import: Bump version
	number.

2012-09-20  Matthew Mundell <matthew.mundell@greenbone.net>

	Serve OMP even when the scanner is down.

	* src/manage.c (scanner_up): New variable.
	(run_task, start_task, stop_task, pause_task, resume_paused_task): Check
	that scanner is up.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_end_element): Handle new "scanner down"
	returns from task commands.
	(scanner_is_up): New function.

	* src/omp.h: Add header accordingly.

	* src/omp.c (serve_omp): Only interact with the scanner when it is up.
	If the scanner init fails then set the scanner down.  Loop while the
	initial write is interrupted, in order to tell if the connection
	succeeds.

2012-09-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage): Add WHERE to SQL that ensures that the
	the Localhost target has the right port list, otherwise all targets are
	set the Default port list on startup.

2012-09-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (range_compare): Treat args correctly, as pointers to
	array pointers.  Order start ascending instead of descending.

2012-09-20  Andre Heinecke <aheinecke@intevation.de>

	* report_formats/verinice-ism/classification-helpers.xsl
	(extract_organization): Fix xpath expressions for looking up the
	organization name from comments.

2012-09-20  Andre Heinecke <aheinecke@intevation.de>

	* report_formats/verinice-ism/gsm_verinice_ism.xsl: Add gsm_ip_address
	field to allow easier parsing of the address in verinice

2012-09-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (create_target_data_reset): Free make_name_unique.

2012-09-19  Michael Wiegand <michael.wiegand@greenbone.net>

	* tools/greenbone-scapdata-sync: Do not use the timestamp of $SCAP_DB
	to decide which CPEs/CVEs to add/update. Use the timestamp of the last
	modified CVE in the DB instead.

2012-09-19  Michael Wiegand <michael.wiegand@greenbone.net>

	* tools/greenbone-scapdata-sync: Re-add copyright year lost in last
	commit, spotted by Felix Wolfsteller.

2012-09-19  Michael Wiegand <michael.wiegand@greenbone.net>

	* tools/greenbone-scapdata-sync: Fix script name in log entries.

2012-09-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (report): Add new filters.
	(create_filter, delete_filter, get_filters, modify_filter): New commands.
	(create_alerts, get_alerts, get_agents, get_reports): Add new filters.
	(get_targets): Add new filters.  In examples add missing elements and
	make UUIDs match.
	(help): Add new commands.

	* doc/omp.html, doc/omp.rnc: Update from source.

2012-09-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db_postgres.sql (agents, agents_trash, targets, targets_trash): Add
	times.
	(alerts, alerts_trash): Add filters.
	(filters, filters_trash, settings): New tables.

	* doc/db.png: Update from source.

2012-09-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (escalate_2): Use associated filter in Sourcefire
	method.

2012-09-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (report_filter_term, print_report_xml)
	(manage_report_filter_controls): Remove apply_overrides from filtering
	to match the GSA report behaviour.

	* src/manage.h: Update header accordingly.

2012-09-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): Pass the filter instead of the
	NULL term to manage_report_filter_controls when the filter is given as
	a string in the GET params.
	(manage_report_filter_controls): Add default values, to prevent memory
	errors in the caller.

2012-09-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (report_filter_term): Add delta_states.
	(print_report_xml): Pass delta states to filter functions.
	(manage_report_filter_controls): Add delta_states parsing.

	* src/manage.h: Update header accordingly.

2012-09-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_alert): Neaten doc.
	(alert_filter_id): New function.
	(escalate_2): Get filter from new location in database.
	(print_report_xml): Set the filter parameters from the filter term
	if a filter is given.  Was previously done in callers.
	(manage_report): Let print_report_xml do the filter choice, and pass the
	filter into print_report_xml so that it appears in the report.
	(manage_send_report): Let print_report_xml do the filter choice.

2012-09-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (escalate_2): Check manage_report return.

2012-09-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_report, manage_send_report): Free filter
	strings.

2012-09-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Add ALERTS to GET_FILTERS response, governed by "alerts" attribute.

	* src/manage_sql.c (init_filter_alert_iterator)
	(filter_alert_iterator_name, filter_alert_iterator_uuid): New functions.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (get_filters_data_t): Rename tasks to alerts.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Send Alerts
	in GET_FILTERS if requested.

2012-09-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Handle Alert filters explicitly, both at OMP and database level.  In the
	process manage the trashcan dependency between Alert and Filter
	properly.  This makes Alerts more consistent with other resource types.

	Hence increase database version to 61.  Add database migration from
	version 60 to 61.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 61.

	* src/manage_sql.c (create_tables): Add filter columns to alerts and
	alerts_trash.
	(migrate_60_to_61): New function.
	(migrators): Add migrate_60_to_61.
	(create_alert): Add filter_id param.
	(delete_alert): Insert alert filter into trashcan.
	(init_alert_iterator): Add columns for filter ID, name and trash state.
	(alert_iterator_filter_id, alert_iterator_filter_name)
	(alert_iterator_filter_trash, agent_in_use, trash_agent_in_use): New
	functions.
	(delete_filter): Add in use checks.  Update filter location when moving
	to trash.
	(filter_in_use, trash_filter_in_use): New functions.
	(manage_restore): Add in use check, and restore alert filter info.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (create_alert_data_t, create_alert_data_reset): Add
	filter_id.
	(send_get_common, SEND_GET_COMMON): Add in_use arg.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add FILTER
	to OMP CREATE_ALERT.  Improve restore error message.  Add FILTER to ALERT
	in OMP GET_ALERTS.  Remove IN_USE from CLIENT_GET_TARGETS case because
	it's now generic in send_get_common.

	* doc/db.png: Update for version change.

2012-09-11  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* CMakeLists.txt: Fix installation of renamed alert.

2012-09-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (send_to_sourcefire): Change script name "escalator"
	to "alert".

	* src/escalator_methods, src/escalator_methods/Sourcefire,
	src/escalator_methods/Sourcefire/escalate: Remove.  Now name with alert.

	* src/alert_methods, src/alert_methods/Sourcefire,
	src/alert_methods/Sourcefire/alert: New.  Escalator rename.

2012-09-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (get_filters_data_t, get_filters_data_reset)
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Remove
	beginnings of implementation of type attribute for GET_FILTERS.  The
	client can control the type via the "filter" attribute.

2012-09-10  Matthew Mundell <matthew.mundell@greenbone.net>

	Add report filtering to email alerts.

	* src/manage_sql.c (escalate_2): Pass filt_id to manage_report in email
	case.
	(print_report_xml): Add NULL checks on "get".
	(manage_report): Add filt_id arg.  Set filter controls according to this
	filter if given.  Add NULL checks on "get".
	(count, init_user_get_iterator, init_get_iterator): Add asserts.

	* src/manage.h: Update header accordingly.

2012-09-07  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Adding new report format plugin that produces XML output
	for the Open Source ISMS Tool Verinice, specifically handling
	content of a IT-Grundschutz Scan using the GSHB NVTs.

	The plugin was implemented by Andre Heinecke and Michael Wiegand.

	* report_formats/verinice-itg,
	report_formats/verinice-itg/gsm_verinice_itg.xsl,
	report_formats/verinice-itg/create_report_import,
	report_formats/verinice-itg/generate,
	report_formats/verinice-itg/README.txt: New.

2012-09-06  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Adding new report format plugin that produces XML output
	for the Open Source ISMS Tool Verinice.

	The plugin was implemented by Andre Heinecke and Michael Wiegand.

	* report_formats/verinice-ism,
	report_formats/verinice-ism/classification-helpers.xsl,
	report_formats/verinice-ism/gsm_verinice_ism.xsl,
	report_formats/verinice-ism/create_report_import,
	report_formats/verinice-ism/generate,
	report_formats/verinice-ism/README.txt: New.

2012-09-06  Matthew Mundell <matthew.mundell@greenbone.net>

	Add new-style filtering to the existing GET_REPORTS filtering.

	* src/manage_sql.c (report_filter_term): New function.
	(print_report_xml): Add GET op data arg.  Set new-style filter from GET
	args if given, otherwise generate the new-style filter term from the
	old-style args.
	(manage_send_report): Add GET op data arg.  Generate old-style args from
	new-style filter if given.
	(filter_control_int, filter_control_str)
	(manage_report_filter_controls): New functions.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (get_reports_data_t, get_reports_data_reset): Add generic
	GET arg.
	(omp_xml_handle_start_element): Parse GET arg for GET_REPORTS and pass
	on to manage_send_report.

2012-09-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (valid_type): Add filter.
	(filter_clause): Allow the keyword string to be empty if there's a
	column specifier, like comment="".
	(count): Take the GET info as a single param.  Use filter from ID if
	there is one.
	(target_count, agent_count, filter_count): Pass GET info as single
	param.
	(init_user_get_iterator): Use filter given by ID if there is one.
	(init_get_iterator): Adjust for filter ID returns.  Use filter given by
	ID if there is one.  Add used_by param so caller can control what type
	the resource is used by.
	(init_user_target_iterator): Clear get so filt_id is NULL.
	(init_target_iterator, init_agent_iterator, init_filter_iterator): Add
	used_by to calls.
	(filter_term): New function.
	(create_filter, modify_filter): Let type be "" instead of NULL to
	indicate any type.
	(filter_iterator_type): Return "" if NULL.

	* src/manage.h: Update headers accordingly.
	(get_data_t): Add filt_id.

	* src/omp.c (get_data_reset, get_data_parse_attributes): Add filt_id.
	(send_get_end): Remove max which was replaced by filters.  Get filter
	from ID if one was given.  Add filter ID to XML.
	(omp_xml_handle_start_element): Init MODIFY_FILTER type in case it's
	empty.  Handle new returns from GET iterators.  Adjust GET op count
	calls.

2012-08-29  Matthew Mundell <matthew.mundell@greenbone.net>

	Add filters, including OMP GET_FILTERS, CREATE_FILTER, DELETE_FILTER and
	MODIFY_FILTER.

	* src/manage_sql.c (resource_t): Remove.  Now in manage.h
	(find_resource_for_actions): Move to Resources page.
	(valid_type, find_resource, find_resource_for_actions)
	(copy_resource, agent_writable, trash_agent_writable, find_filter)
	(find_filter_for_actions, filter_uuid, create_filter, copy_filter)
	(delete_filter, filter_writable, trash_filter_writable): New functions.
	(create_tables): Add filters and filters_trash.
	(FILTER_ITERATOR_FILTER_COLUMNS, FILTER_ITERATOR_COLUMNS)
	(FILTER_ITERATOR_TRASH_COLUMNS): New defines.
	(filter_count, init_filter_iterator, filter_iterator_type)
	(filter_iterator_term, modify_filter): New functions.
	(manage_restore, manage_empty_trashcan): Add filters.

	* src/manage.h: Add headers accordingly.
	(filter_t): New type.
	(resource_t): New type.  From manage_sql.h.

	* src/omp.c (omp_commands, command_data_t, client_state_t)
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add filter commands.
	(create_filter_data_t, delete_filter_data_t, get_filters_data_t)
	(modify_filter_data_t): New types.
	(create_filter_data_reset, delete_filter_data_reset)
	(get_filters_data_reset, modify_filter_data_reset): New functions.
	(create_filter_data, delete_filter_data, get_filters_data)
	(modify_filter_data): New variables.
	(send_get_common): Add writable arg.
	(SEND_GET_COMMON): Pass writable in generic way.  Convert type arg to
	token.  Update callers.

	* src/sql.c (sql_nquote, sql_quote): Assert string exists.

2012-08-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (omp_xml_handle_end_element): In CLIENT_MODIFY_TASK
	correct the direction of the alerts comparison and add the missing
	comment check.

2012-08-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (task_schedule_iterator_stop_due): Consider duration
	even for once-off tasks, in case people want this.

2012-08-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (validate_host): Skip leading whitespace too.

2012-08-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (end_char): Remove.
	(contains_alpha): New function.
	(manage_max_hosts): Check entire part for alphanumeric chars when
	checking for a hostname.

2012-08-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_set_config_name)
	(manage_set_config_name_comment): Add missing owner clause.

2012-08-21  Matthew Mundell <matthew.mundell@greenbone.net>

	Add a flag to OMP CREATE_TARGET which indicates that the Manager must
	make the target name unique.

	* src/manage_sql.c (create_target): Add make_name_unique argument.
	Update all callers.

	* src/manage: Update header accordingly.

	* src/omp.c (create_target_data_t, client_state_t)
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add MAKE_UNIQUE to TARGET/NAME.

	* src/schema_formats/XML/OMP.xml (create_target): Add MAKE_UNIQUE to
	TARGET/NAME.

	* doc/omp.html, doc/omp.rnc: Update from source.

	* src/wizards/quick_first_scan.xml: Add MAKE_UNIQUE to CREATE_TARGET
	command.

2012-08-17  Matthew Mundell <matthew.mundell@greenbone.net>

	Add family to NVT in results.  Based on patch by Sebastien Aucouturier.

	* src/manage_sql.c (result_iterator_nvt_family): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (buffer_results_xml): Add NVT family to response.

	* src/schema_formats/XML/OMP.xml (result): Add NVT family.

	* doc/omp.html, doc/omp.rnc: Update from source.

2012-08-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Add RUN_WIZARD.

	* doc/omp.html, doc/omp.rnc: Update from source.

2012-08-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Move the RUN_WIZARD implementation out of the parser.

	* src/manage.c (manage_run_wizard): New function.  Body from
	omp_xml_handle_end_element RUN_WIZARD in omp.c

	* src/omp.c (omp_xml_handle_end_element): Move RUN_WIZARD implementation
	to manage_run_wizard.
	(process_omp_write): Add a trace message similar to ompd_send_to_client.
	(name_value_t): Remove.  Now in manage.h.

	* src/manage.h: Add header accordingly.
	(name_value_t): New type.  From manage_sql.c.

	* src/manage_sql.c (name_value_t): Remove.  Now in manage.h.

2012-08-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In RUN_WIZARD remove
	temp files after use.

2012-08-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/wizards/quick_first_scan.xml: Remove TODO now that params are
	escaped.

2012-08-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Escape RUN_WIZARD params
	for XML file.

2012-08-15  Matthew Mundell <matthew.mundell@greenbone.net>

	Add setting Wizard Rows.

	* src/manage_sql.c (init_manage): Ensure setting exists.

2012-08-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In RUN_WIZARD add name check
	and correct command in error message.

2012-08-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In RUN_WIZARD adjust the fail
	cases because they break out of the while now, free 'entity' after
	last use instead of inside the loop, close xml_file, remove testing
	elements from responses and use a dedicated entity when checking the
	response.

2012-08-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In RUN_WIZARD free entity
	properly and exit if the command for any step fails.

2012-08-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Add new OMP command RUN_WIZARD.  Add first wizard quick_first_scan.

	* src/manage.c (xsl_transform): Export.

	* src/manage_sql.c (manage_send_report): Add new arg to param types
	of send function.

	* src/omp.c (omp_commands, command_data_t, client_state_t): Add
	RUN_WIZARD.
	(omp_parser_t, omp_parser_new, send_element_error_to_client)
	(send_find_error_to_client, send_get_start, send_get_common)
	(send_get_end, send_requirement, send_dependency, send_nvt)
	(send_reports, init_omp_process): Add new arg to type of send function.
	(run_wizard_data_t): New type.
	(run_wizard_data_reset): New function.
	(run_wizard_data): New variable.
	(send_to_client): Simply call through to the send function provided by
	the caller, which now does all the work.  This allows process_omp to
	use its own send function and have full control of what it does.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add new arg
	to type of send function.  Handle RUN_WIZARD.
	(omp_xml_handle_text): Handle RUN_WIZARD.
	(process_omp_write, process_omp): New functions.  For processing an OMP
	command during the processing of an OMP command.

	* src/manage.h, src/omp.h: Update headers accordingly.

	* src/ompd.c (ompd_send_to_client): New function.  Body from
	omp.c send_to_client.
	(serve_omp): Add new arg to type of send function.  Pass
	ompd_send_to_client as this send function.

	* src/wizards, src/wizards/quick_first_scan.xml: New files.

	* CMakeLists.txt: Install wizard.

2012-08-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (MAX_CHECKS_DEFAULT, MAX_HOSTS_DEFAULT): New defines.
	(send_task_preferences): Use new defines.
	(run_slave_task): Create task with max_checks and max_hosts preferences.

2012-08-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_asset_iterator, filtered_host_count): Quote
	search phrase for SQL.

2012-08-01  Matthew Mundell <matthew.mundell@greenbone.net>

	Make the ARF report format predefined.

	* CMakeLists.txt: Install predefined ARF.

	* src/manage_sql.c (init_manage): Ensure predefined ARF exists.
	(report_format_predefined): Add predefined ARF.

	* src/report_formats/ARF/, src/report_formats/ARF/ARF.xsl,
	src/report_formats/ARF/generate: New directory and files.

	* report_formats/arf: Remove.

2012-07-30  Matthew Mundell <matthew.mundell@greenbone.net>

	Expose the already implemented multiple alert feature in OMP.

	* src/omp.c (create_task_data_t, create_task_data_reset)
	(modify_task_data_t, modify_task_data_reset): Replace alert with array
	of alerts.
	(omp_xml_handle_start_element, omp_xml_handle_end): In CREATE_TASK,
	GET_TASKS and MODIFY_TASK handle multiple ALERTs instead of just one.

	* src/manage_sql.c (init_alert_iterator): Add separate case for when
	event is 0.
	(set_task_alert): Remove.  Now set_task_alerts.
	(set_task_alerts): New function.

	* src/manage.h: Update headers accordingly.

	* src/schema_formats/XML/OMP.xml (create_task): Add multiple alerts.

	* doc/omp.html, doc/omp.rnc: Update from source.

2012-07-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_report_iterator): When getting all reports, get
	only the visible reports for the current user.

2012-07-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (omp_xml_handle_start_element): Clear preference data
	in case there are multiple preferences.

2012-07-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_otp_pref_iterator): Include the special
	timeout.OID preferences, so that these user-defined NVT timeouts
	are sent to the scanner.

2012-07-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (type_name): Use xsd:Name.

	* doc/omp.html, doc/omp.rnc: Update from source.

2012-07-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (modify_config): Note that value must be
	base64.  Add example of modifying scanner preference.

	* doc/omp.html: Update from source.

2012-07-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): Add COMMENT to TASK.

2012-07-25  Matthew Mundell <matthew.mundell@greenbone.net>

	Add task preference "in_assets" which controls whether the task is
	considered by the asset management.  Hence increase database version to
	60.  Add database migration from version 59 to 60.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 60.

	* src/manage_sql.c (migrate_59_to_60): New function.  Ensures each task
	has an in_assets preference.
	(migrators): Add migrate_59_to_60.
	(init_asset_iterator, host_nthlast_report_host): Add the condition that
	the task's in_assets preference must be "yes", to the SQL.
	(make_task): Add in_assets task preference for the task.

	* src/omp.c (omp_xml_handle_end_element): Send in_assets preference with
	task preferences.

	* doc/db.png: Update for version change.

2012-07-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_REPORTS cleanup
	the iterator early when a particular report was requested.  This allows
	the main manager process to lock the database for task scheduling during
	generation of large reports.  Also remove two stray cleanup_iterator
	calls.

2012-07-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ompd.c (serve_omp): Correct comment typo.

2012-07-23  Werner Koch  <wk@gnupg.org>

	Documentation update.

	* src/ompd.c (serve_omp): s/fds/fd_info/.  Add a few comments.

2012-07-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Import host details when importing reports.

	* src/manage_sql.c (host_detail_free): New function.
	(create_report): Add details arg.

	* src/manage.h: Update headers accordingly.
	(host_detail_t): New type.

	* src/omp.c (create_report_data_t, create_report_data_reset)
	(client_state_t): Add host details.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Parse and store host details for CREATE_REPORT,
	and hand over to create_report function.

2012-07-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (split_filter, manage_filter_controls): When
	"rows" is left out, include all rows instead of including "Rows
	Per Page" rows.  This keeps OMP backwards compatibility.
	(append_relation): New function.
	(manage_clean_filter): Append with append_relation, which converts the
	"rows" value to "Rows Per Page" if "rows" is -2.  This is convenient for
	client because they can request Rows Per Page and still get the actual
	value back in the filter.  Previous they just left out "rows" and this
	would happen.

2012-07-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OTP 1.1 handling.

	* src/ompd.c (write_to_scanner): Send OTP/1.1 for normal mode, OTP/1.0 for
	NVT cache mode.  In normal mode go to DONE state after sending password.

	* src/otp.c (process_otp_scanner_input): Also check for OTP/1.1.

	* src/oxpd.c (OTP_INIT_STRING_2): New define.
	(read_protocol): Also compare OTP 1.1 string.

2012-07-09  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/manage.c (manage_read_info): Replace g_strcasecmp with
	g_ascii_strcasecmp. The g_strcasecmp function has been deprecated
	since glib 2.2 and is no longer available in recent glib versions.

2012-07-09  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/manage_sql.c (print_report_xml, manage_filter_controls): Remove
	assigned but unused variables to address compiler warnings.

2012-07-06  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/tests/CMakeLists.txt: Ensure that linking with modern gccs works
	by moving linker flags from LINK_FLAGS to target_link_libraries.

2012-06-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_filter_controls): Correct doc brief.

2012-06-27  Matthew Mundell <matthew.mundell@greenbone.net>

	When the GET filter defines an empty set and "first" is above 1, then
	respond with "first" equal 1.  This prevents the user from jumping into
	blank space after the rows.

	* src/omp.c (send_get_start): Just send start tag.
	(send_get_end): Move fields from send_get_start into here so that they're
	sent after the iteration.
	(get_next): New function.  Does next check for GET operation iteration,
	resetting the iteration to the beginning with first=1 in the filter if the
	result set is empty.
	(omp_xml_handle_end_element): Use get_next to do next check while sending
	rows.

2012-06-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage_process): Create common_cve.
	(where_autofp, init_result_iterator, column_auto_type)
	(report_counts_autofp_match): Use common_cve to check for the partial CVE
	match, because both CVEs could be lists and a pattern match fails if they
	are.

	* src/sql.c (sql_common_cve): New function.

	* src/sql.h: Add header accordingly.

2012-06-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (filter_free): New function.
	(manage_filter_controls, manage_clean_filter, filter_clause): Free split
	filter with filter_free.

2012-06-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otp.c (blank_control_chars): Skip newlines.
	(process_otp_scanner_input): g_strcompress the field from the scanner
	before converting it to UTF8, because since r13022 the scanner
	g_strescapes messages instead of doing simple escaping.

2012-06-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (get_data_parse_attributes): Remove first and max as they are
	in the filter now.

2012-06-25  Matthew Mundell <matthew.mundell@greenbone.net>

	Move GET_TARGETS rows and max into the filter, and make it easier for the
	client to handle the sorting being in the filter.

	* src/manage_sql.c (keyword_applies, split_filter): Add first and rows.
	(manage_filter_controls): New function.
	(filter_clause): Add first and max args.  As a result reindent entire
	function.  Update callers.
	(init_get_iterator, init_user_get_iterator): Get first and max from first=
	and max= in filter, instead of from params.  Update caller.

	* src/manage.h: Add header accordingly.

	* src/omp.c (send_get_start): Get the "filter controls" from the filter
	instead of from params.  Add SORT to response.

2012-06-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (split_filter): Silence compiler warning suddenly
	appearing with this patch.
	(manage_clean_filter): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (send_get_start): Send cleaned filter, with redundant terms
	removed.

2012-06-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (keyword_applies): New function.
	(split_filter): Check if keyword applies before adding.  This skips all
	sort= keywords after the first.

2012-06-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (filter_clause): Add column checks to the operator
	checks, otherwise "column=and" is treated as plain "and".

2012-06-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (filter_clause): Clear last_was_not if the column is
	not found for the equal relation, to match the other relations.

2012-06-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (filter_clause): Rename asc and desc to sort and
	sort-reverse.

2012-06-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Move GET_TARGETS sorting into filter.

	* src/manage.c (run_slave_task): Update init_user_target_iterator call.

	* src/manage_sql.c (filter_clause): Add order return arg.  Update callers.
	(init_user_get_iterator, init_get_iterator): Get order clause from
	filter_clause instead of sort params.
	(init_target_task_iterator): Remove ascending arg.
	(verify_agent): Move sorting to filter.

	* src/manage.h: Update headers accordingly.
	(get_data_t): Remove sort fields.

	* src/omp.c (get_data_reset, get_data_parse_attributes): Remove
	sort_field.
	(omp_xml_handle_end_element): Update init_target_task_iterator call.

2012-06-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (init_task_schedule_iterator): Skip trashcan tasks and
	example task.

2012-06-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (send_user_rules_empty): New function.
	(send_user_rules): Skip over empty lines.  Also send the rules when the
	file contained only newlines and/or empty lines.

2012-06-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (modify_setting): Correct description.

	* doc/omp.html: Update from source.

2012-06-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (commands): Add GET_SETTINGS.  Correct
	MODIFY_SETTING.
	(get_settings): New command.
	(help): Add GET_SETTINGS.
	(modify_settings): Add UUID param.

	* doc/omp.rnc, doc/omp.html: Update from source.

2012-06-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_DELETE_PORT_LIST
	add g_log to case 3.

2012-06-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (report): Add REPORT_FORMAT.

	* doc/omp.rnc, doc/omp.html: Update from source.

2012-06-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): Init some vars to prevent warnings
	from older compilers.

2012-06-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage): Update report format UUIDs before
	predefined check.

2012-06-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage, report_format_predefined): Update LaTeX
	report format UUID everywhere.

2012-06-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (result_notes, result_overrides): New
	elements.
	(result): Add NOTES and OVERRIDES to RESULT and DELTA.
	(get_results): Move notes and overrides to new element.

	* doc/omp.rnc, doc/omp.html: Update from source.

2012-06-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (result): Add ORIGINAL_THREAT and DELTA.
	Add missing NVT elements.

	* doc/omp.rnc, doc/omp.html: Update from source.

2012-06-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* CMakeLists.txt: Update LaTeX based report format UUIDs for 2012-06-01
	date format commit.

	* src/manage_sql.c: Update LaTeX based report format UUIDs in database.

2012-06-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (update_report_format_uuid)
	(update_report_format_uuids): New functions.  Mechanism for updating the
	report format UUIDs on startup.  This first version does that same work as
	migrate_58_to_59.
	(init_manage): Call update_report_format_uuids.

2012-06-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (report_count): Access column by hand to get position
	right.
	(report_count_filtered, report_counts_id_filt): Skip the autofp test for
	Logs and False Positives.

2012-06-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage): Set port list when creating predefined
	target.  Ensure that list is correct if target exists already.

2012-06-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (report_counts_autofp_match): Remove extra SQL paren.

2012-06-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (report, get_reports): Add GET_REPORTS
	autofp and show_closed_cves.

	* doc/omp.rnc, doc/omp.html: Update from source.

2012-06-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/TXT/TXT.xsl (real-report): Note whether vendor
	updates are trusted.  Add Closed CVEs table.

2012-06-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/LaTeX/latex.xsl (results-overview): Note whether
	vendor updates are trusted.
	(results-per-host-single-host-closed-cves): New template.
	(results-per-host-single-host): Add Closed CVEs table.

2012-06-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/HTML/HTML.xsl (real-report): Note whether vendor
	updates are trusted.  Add Closed CVEs table.

2012-06-05  Matthew Mundell <matthew.mundell@greenbone.net>

	Add show_closed_cves attribute to GET_REPORTS to control the presence
	of the Closed CVEs host detail.

	* src/manage_sql.c (escalate_2): Add show_closed_cves arg.
	(escalate_1): Pass 0 for show_closed_cves.
	(print_report_xml): Add show_closed_cves arg.  Add value to filters.
	Pass to alert.  Only include Closed CVEs host detail when true.
	(manage_report, manage_send_report): Add show_closed_cves arg.  Pass
	through to print_report_xml.

	* src/manage.h: Update header accordingly.

	* src/omp.c (get_reports_data_t): Add show_closed_cves.
	(omp_xml_handle_start_element): Parse show_closed_cves.
	(omp_xml_handle_end_element): Pass show_closed_cves to report functions.

2012-06-01  Matthew Mundell <matthew.mundell@greenbone.net>

	Make the date formats of the LaTeX based reports nicer.

	* src/report_formats/LaTeX/latex.xsl (scan_start, scan_end): New
	templates.
	(abstract, results-per-host-single-host): Call new templates for dates.

2012-05-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (buffer_cve): New function.
	(print_report_xml): Add the "Closed CVEs" host detail for the case when
	result_hosts_only is false.

2012-05-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): Report extra loop left in earlier
	today.

2012-05-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (task_debugs_size, task_false_positive_size)
	(task_holes_size, task_infos_size, task_logs_size)
	(task_warnings_size): Remove.  Old functions.

2012-05-31  Matthew Mundell <matthew.mundell@greenbone.net>

	Use 1 instead of 'False Positive' to mark autofp false positives in the
	auto_type column, to work around some SQL complications with using a
	string.

	* src/manage_sql.c (where_levels_auto, result_iterator_type): Test
	auto_type for 1 instead of a string.
	(init_result_iterator, column_auto_type): Set auto_type to 1 for false
	positives.

2012-05-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (array_find_string): Move up in file.
	(compare_strings): New functions.
	(print_report_xml): Add a "Closed CVEs" host details listing all closed
	CVEs.

2012-05-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_report_host_details_iterator): Add the NVT name
	as the description of the Closed CVE details.

2012-05-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_result_iterator): Shorten long lines.

2012-05-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (column_auto_type): New function.
	(report_count_filtered, report_scan_result_count): Use column_auto_type.

2012-05-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (report_count_filtered): Fold host case into other
	cases.
	(report_counts_id): Doc typo.

2012-05-30  Matthew Mundell <matthew.mundell@greenbone.net>

	Migrate alert method data to reflect report format UUID changes in
	database version 55.  Hence increase database version to 59.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 59.

	* src/manage_sql.c (migrate_58_to_59): New function.
	(migrators): Add migrate_58_to_59.
	(escalate_2): Align args.  Update TXT UUID.

	* doc/db.png: Update for version change.

2012-05-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (report_scan_result_count): Generate the autofp SQL
	always, whatever the value of override is.

2012-05-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (report_scan_result_count)
	(report_counts_autofp_match, report_count_filtered): Clean up SQL
	alignment.

2012-05-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (get_results_data_t, omp_xml_handle_start_element)
	(omp_xml_handle_end_element): Add autofp arg to GET_RESULTS.

	* src/manage_sql.c (init_result_iterator): Add autofp result case.

2012-05-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_start_element): Correct variable name in
	GET_REPORTS attribute parsing.

2012-05-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_result_iterator): Remove host case, as host is
	always NULL.  Update callers.

	* src/manage.h: Update header accordingly.

	* src/omp.c: Update init_result_iterator callers.

2012-05-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (report_counts_id_filt): Set filtered_debugs if given.

2012-05-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (report_scan_result_count): Add missing SQL to
	auto_type default case.

2012-05-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (where_autofp, init_result_iterator)
	(report_scan_result_count, report_counts_autofp_match)
	(report_count_filtered): In the SQL for the partial case put the CVE
	clause inside the inner NVT SELECT and use an EXISTS, instead of doing a
	LIKE between a multi-row select and a single value.

2012-05-24  Matthew Mundell <matthew.mundell@greenbone.net>

	Convert the results closed by autofp into false positives, instead of just
	excluding them.

	* src/manage_sql.c (where_levels_auto): New function.
	(where_autofp): Correct SQL.
	(init_result_iterator): Treat closed results as false positives by adding
	an auto_type column to the query
	(original_type): Doc typo.
	(result_iterator_type): Take new auto_type column into account.
	(result_iterator_descr, result_iterator_nvt_cvss_base_double): Increment
	for new column.
	(report_scan_result_count): Add auto_type to query, as above.
	(report_counts_autofp_match): Add special case for open ports.  Correct
	SQL.
	(report_count_filtered): Add a False Positive special case for autofp.

2012-05-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (validate_host): Only do the length check when the last
	octet is a number, because hostnames can have any number of parts.

2012-05-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (init_report_host_details_iterator): Add closed CVEs.

2012-05-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_TASKS brief case use the
	correct variable to get the task preferences.

2012-05-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (where_autofp, report_counts_autofp_match): Take the
	NOCVE case into account.

2012-05-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (report_counts_id_filt): Add missing column to query.

2012-05-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (where_autofp, report_counts_autofp_match): If autofp
	is 2 then do partial CVE matching.
	(report_counts_match): Pass autofp to report_counts_autofp_match.
	(print_report_xml): Respond with actual value of autofp instead of 1 or 0.

2012-05-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Add autofp filtering to the counts too.

	* src/manage_sql.c (create_table): Add indexes
	report_host_details_by_report_host_and_name_and_value and
	report_hosts_by_host.
	(report_scan_result_count, report_counts_match)
	(report_count_filtered, report_counts, report_counts_id_filt)
	(report_counts_id): Add autofp arg.  Update callers.
	(report_counts_autofp_match): New function.

	* src/manage.h: Update headers accordingly.

	* src/omp.c: Add autofp for updated manage_sql.c functions.

2012-05-15  Matthew Mundell <matthew.mundell@greenbone.net>

	Add creation and modification times to the powerfilter.

	* src/manage_sql.c (parse_keyword): Add date format with hour and minute.
	(GET_ITERATOR_FILTER_COLUMNS, GET_ITERATOR_COLUMNS): Add created and
	modified.
	(GET_ITERATOR_COLUMN_COUNT): Increase.

2012-05-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Add autofp attribute to OMP GET_RESULTS.  When given filter out results
	which have an EXIT_CODE host detail with value EXIT_NOTVULN.  Slight
	modification of patch from Henri Doreau.

	* src/manage_sql.c (escalate_2): Add autofp arg.  Update caller.
	(LSC_FAMILY_LIST): New define.
	(where_autofp): New function.
	(init_result_iterator): Add autofp arg.  If given add autofp WHERE
	clause to SQL.  Update callers in omp.c.
	(print_report_xml): Add autofp arg.  Print in XML, pass to iterator.
	(manage_report_report): Add autofp arg.  Pass to printer or escalator.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (get_reports_data_t, omp_xml_handle_start_element)
	(omp_xml_handle_end_element): Add autofp attribute to GET_RESULTS.

2012-05-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (run_task): Set the report run status explicitly, because
	set_task_run_status only does this when current_scanner_task is set and
	current_scanner_task is set at the end of the function.

2012-05-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (client_state_t, omp_xml_handle_start_element)
	(omp_xml_handle_end_element): Add DETECTION and NVT/XREF to RESULT
	in report import.

2012-05-07  Matthew Mundell <matthew.mundell@greenbone.net>

	Implement the filtered count for GET_AGENTS.

	* src/manage_sql.c (TARGET_ITERATOR_COLUMNS)
	(TARGET_ITERATOR_TRASH_COLUMNS): Move up in file.
	(count): New function.  Body adapted from target_count.
	(target_count): Call through to count.
	(agent_count): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_AGENTS enable
	filtered count.

2012-05-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In MODIFY_TARGET require NAME
	and HOSTS or TARGET_LOCATOR, instead of asserting this.

2012-05-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Replace ctime with iso_time everywhere.
	(iso_time): New type.

	* doc/omp.rnc, doc/omp.html: Update from source.

2012-05-04  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number to 4.0+beta4.

2012-05-04  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 4.0+beta3 release.

	* CHANGES: Updated.

2012-05-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML-brief, src/schema_formats/XML-brief/OMP.xml,
	src/schema_formats/XML-brief/generate: New files.  For --disabled-cmds
	commit.

2012-05-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Remove extra arg from
	manage_schema call, leftover from experiment.

2012-05-03  Matthew Mundell <matthew.mundell@greenbone.net>

	Add --disabled-cmds to disable a list of OMP commands.  Adjust HELP
	to skip disabled commands.

	* CMakeLists.txt: Install new schema format.

	* src/omp.c (command_t): New type.
	(help_text): Remove.
	(omp_commands): New variable.
	(STATUS_SERVICE_UNAVAILABLE, STATUS_SERVICE_UNAVAILABLE_TEXT): New
	definitions.
	(omp_parser_t, omp_parser_free): Add disabled_commands.
	(omp_parser_new): Add disable arg.
	(command_disabled): New function.
	(help_data_t, help_data_reset): Add type.
	(XML_ERROR_UNAVAILABLE): New macro.
	(omp_xml_handle_start_element): In the authentic states check if the
	given command is enabled.  In the simple HELP case only print those
	commands that are enabled.  Add a HELP flage "type", and print a
	simple response when the type is "brief".
	(init_omp_process): Add disable arg.

	* src/manage.h, src/ompd.h: Update headers accordingly.

	* src/ompd.c (init_ompd_process, serve_omp): Add disable arg.

	* src/openvasmd.c (disabled_commands): New variable.
	(serve_client, fork_connection_for_schedular): Pass disabled_commands to
	omp handlers.
	(cleanup): Free disabled_commands too.
	(update_or_rebuild_nvt_cache): Add dummay serve_omp arg.
	(main): Add --disable-cmds.

2012-04-30  Matthew Mundell <matthew.mundell@greenbone.net>

	Add creation and modification times to agents and targets.  Hence increase
	database version to 58.  Add database migration from version 57 to 58.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 58.

	* src/manage_sql.c (create_tables): Add time columns.
	(migrate_35_to_36_duplicate_target): New function.  Was duplicate_target.
	(migrate_35_to_36): Adjust call for rename.
	(migrate_57_to_58): New function.  Agent and target time migrator.
	(database_migrators): Add migrate_57_to_58.
	(init_manage): Add times.
	(duplicate_target): Remove for rename.  Superceded by copy_target, and
	migrator functions must be specific to the migrator.
	(create_target, copy_target, delete_target, modify_target, create_agent)
	(delete_agent): Handle time columns too.
	(GET_ITERATOR_COLUMNS): Add time columns.
	(GET_ITERATOR_COLUMN_COUNT): New define.  Adjust all target and agent
	iterator access function offsets to be relative to this.
	(set_target_hosts): Set modification time too.
	(get_iterator_creation_time, get_iterator_modification_time): New
	functions.
	(manage_restore): Handle agent and target time columns.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (send_get_common): Add times.

	* src/schema_formats/XML/OMP.xml (get_agents, get_targets): Add times to
	response.

	* doc/db.png, doc/omp.rnc, doc/omp.html: Update from source.

2012-04-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage_process, duplicate_target): Add arg to
	uniquify.
	(copy_target): Append " Clone" to new target name, before unique number.

	* src/sql.c (sql_uniquify): Take a fourth arg as suffix before unique part
	of name.

2012-04-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (copy_target): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (create_target_data_t, client_state_t)
	(omp_xml_handle_end_element, omp_xml_handle_text): Add CREATE_TARGET/COPY.

2012-04-25  Matthew Mundell <matthew.mundell@greenbone.net>

	Setup an OMP GET response style where the common part of the response
	to a GET command is done by support code instead of being done in each
	command.  Convert GET_TARGETS and GET_AGENTS to this style.

	* src/manage_sql.c (GET_ITERATOR_FILTER_COLUMNS)
	(GET_ITERATOR_COLUMNS): New defines.  Increment agent iterator
	access functions to match.
	(TARGET_ITERATOR_COLUMNS, TARGET_ITERATOR_TRASH_COLUMNS)
	(TARGET_ITERATOR_FILTER_COLUMNS, AGENT_ITERATOR_FILTER_COLUMNS)
	(AGENT_ITERATOR_COLUMNS): Use GET column definitions.
	(target_iterator_hosts, target_iterator_comment): Match to positions in
	GET columns.
	(get_iterator_resource, get_iterator_uuid, get_iterator_name)
	(get_iterator_comment): New functions.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (send_get_start, send_get_common, send_get_end): New
	functions.
	(SEND_GET_START, SEND_GET_COMMON, SEND_GET_END): New macros.
	(omp_xml_handle_end_element): In GET_AGENTS and GET_TARGETS send the
	common part of the response with the new send_get functions.

2012-04-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (serve_and_schedule): Check that the second socket is in
	use before trying to call FD_ISSET on it.

2012-04-25  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number to 4.0+beta3.

2012-04-25  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 4.0+beta2 release.

	* CHANGES: Updated.

2012-04-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch GET_AGENTS to the GET iterator.

	* src/manage_sql.c (verify_agent): Pass single arg to init_agent_iterator.
	(AGENT_ITERATOR_FILTER_COLUMNS, AGENT_ITERATOR_COLUMNS)
	(AGENT_ITERATOR_TRASH_COLUMNS): New definitions.
	(init_agent_iterator): Use the generic initialiser.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): Pass single arg to GET_AGENTS
	iterator init, and handle return.

2012-04-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_user_get_iterator): Add "_trash" to table name
	in SQL for trash cases.
	(TARGET_ITERATOR_COLUMNS): Add missing dummy columns.

2012-04-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (find_resource_for_actions): Pass type to
	user_has_access_uuid instead of static string.
	(init_get_iterator): Correct order of iterator args.

2012-04-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Update OMP version to 4.0.

2012-04-18  Matthew Mundell <matthew.mundell@greenbone.net>

	Add a generic iterator for GET commands, and call it in the GET_TARGETS
	iterator.

	* src/manage_sql.c (find_resource_for_actions): New function.
	(TARGET_ITERATOR_COLUMNS): Set to SQL columns.  Filter columns now defined
	by TARGET_ITERATOR_FILTER_COLUMNS.
	(target_count): Update for rename.
	(init_user_get_iterator, init_get_iterator): New functions.
	(TARGET_ITERATOR_FILTER_COLUMNS, TARGET_ITERATOR_TRASH_COLUMNS): New
	definitions.
	(init_user_target_iterator, init_target_iterator): Call through to generic
	counterparts.

	* src/omp.c (get_data_t): Remove.  Now in manage.h.

2012-04-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/omp.rnc, doc/omp.html: Update from source.

2012-04-18  Matthew Mundell <matthew.mundell@greenbone.net>

	Simplify the GET_TARGETS iterator init slightly.

	* src/manage.h (get_data_t): New type.  From omp.c.
	(init_target_iterator): Update header.

	* src/manage_sql.c (init_target_iterator): Group the generic get args into
	one.

	* src/omp.c (get_data_t): Remove.  Now in manage.h.
	(omp_xml_handle_end_element): Pass get_targets_data directly to
	init_target_iterator.

2012-04-18  Matthew Mundell <matthew.mundell@greenbone.net>

	Move GET_TARGETS find into the iterator initialiser.

	* src/manage_sql.c (init_target_iterator): Convert target arg from
	target_t to uuid string.  Add return accordingly.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): Pass the target UUID directly
	into the iterator init, instead finding the target first.

2012-04-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (get_agents): Make IN_USE 0 in examples
	because it's always so.
	(get_port_lists, get_targets): Add WRITABLE.

2012-04-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (port_list_iterator_in_use): Remove consideration of
	predefined state.
	(port_list_iterator_writable): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_end_element): Add WRITABLE to GET_PORT_LIST.

2012-04-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_port_list): Add missing argument to sql_int.
	Change associated return so that error message can be more correct.

	* src/omp.c (omp_xml_handle_end_element): Handle new return from
	delete_port_list.

2012-04-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Add missing case to
	create_target switch.

2012-04-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (target_writable, trash_target_writable): New
	functions.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): Add WRITABLE to GET_TARGETS,
	to indicate when a target is in_use or predefined.

2012-04-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (get_join): New function.
	(filter_clause): Add NOT handling.

2012-04-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_target): Prevent removal of predefined target.

	* src/omp.c (omp_xml_handle_end_element): Handle new return from delete
	target.

2012-04-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_port_range_iterator)
	(init_port_list_target_iterator): Add explicit "all" case, otherwise the
	selection is always empty.

2012-04-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (get_port_lists): Move details attrib
	from response to request.

	* doc/omp.rnc, doc/omp.html: Update from source.

2012-04-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (find_attribute, append_attribute): Move up in file.
	(get_data_t): New struct.
	(get_data_reset, get_data_parse_attributes): New function.
	(get_agents_data_t, get_agents_data_reset, get_targets_data_t)
	(get_targets_data_reset): Use the generic get structure.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Use generic
	get for agents and targets.

2012-04-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_target_iterator): Add AS for port_list.

2012-04-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Add quotation to the index case of the the powerfilter.  This allows
	spaces in the index filters, like name="Debian Machines".

	* src/manage_sql.c (parse_keyword): Remove the relation parsing which is
	now done in split_filter.
	(split_filter): Parse index quotations.

2012-04-16  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/openvasmd.c (main): Updated Copyright years.

2012-04-16  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number to 4.0+beta2.

2012-04-16  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Preparing the openvas-manager 4.0+beta1 release.

	* CHANGES: Updated.

2012-04-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Add integer and date handling to the powerfilter.  If an keyword like
	"ids>2" has the above (>) or below (<) relation and the keyword part is a
	number or a date of the form 2011-3-23 then compare the column as a
	number instead of as text.

	* src/manage_sql.c (keyword_type_t, keyword_relation_t): New enums.
	(struct term, term_t): Remove.  Now keyword.  Update callers.
	(struct keyword, keword_t): New type.
	(keyword_free, parse_keyword): New function.
	(split_filter): Setup more info about the keyword, using parse_keyword.
	Also remove a decrement that was chopping off the last char of phrases.
	(filter_clause): Remove the parsing that's now done by split_filter.  Add
	casts in the SQL to ensure the column is compared correctly.  Add the
	number cases to to the above and below cases.

2012-04-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (scan_start, scan_end): Format date nicely.

	* src/report_formats/HTML/HTML.xsl (real-report): Add start and end
	columns to host summary.

2012-04-13  Michael Wiegand <michael.wiegand@greenbone.net>

	* tools/greenbone-scapdata-sync: Add switch to disable the sync script.

2012-04-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (modify_target): Only validate port when there's an SSH
	credential.  Add 0 tests for credentials.

2012-04-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Add IP count to GET_TARGETS filtering.  Also better control which database
	columns are searched.

	* src/manage_sql.c (init_manage_process): Create max_hosts SQL function.
	(filter_clause): Remove automatic filtering by all table columns.  Instead
	filter only on given columns.
	(TARGET_ITERATOR_EXTRA_COLS): Remove.
	(TARGET_ITERATOR_COLUMNS): New define.  TARGET_ITERATOR_EXTRA_COLS with
	all columns.
	(target_count, init_user_target_iterator, init_target_iterator): Switch to
	new filter_clause behaviour.  Add ips to SQL so that filters can access
	value as column.

	* src/sql.c (sql_max_hosts): New function.

	* src/sql.h: Add header accordingly.

2012-04-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (filter_clause): Duplicate column names in index filter
	with g_ascii_strdown so that the user can use any case.

2012-04-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP MODIFY_TARGET.

	* src/manage_sql.c (modify_target): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (help_text, command_data_t, client_state_t): Add
	modify_target.
	(modify_target_data_t): New structure.
	(modify_target_data_reset): New function.
	(modify_target_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add MODIFY_TARGET handling.

2012-04-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_set_setting): Add uuid arg.  Set Rows Per Page
	setting if given.
	(setting_value_int): New function.

	* src/manage.h: Update header accordingly.

	* src/omp.c (modify_setting_data_t, modify_setting_data_reset)
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add setting_id
	to MODIFY_SETTING.  Pass to manage_set_setting if given.

2012-04-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_target_iterator): If max is -2 then get max from
	Rows Per Page setting.
	(setting_value_int): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_start_element): Let GET_TARGETS max be any
	negative.
	(omp_xml_handle_end_element): If GET_TARGETS max is -2 then set is from
	Rows Per Page setting.

2012-04-06  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP GET_SETTINGS.

	* src/manage_sql.c (create_tables): Add settings.
	(init_manage): Ensure default settings exist.
	(target_count): Remove dangling SQL clause.
	(SETTING_ITERATOR_EXTRA_COLS): New define.
	(setting_count, init_setting_iterator, setting_iterator_uuid)
	(setting_iterator_name, setting_iterator_comment)
	(setting_iterator_value): New function.

	* src/omp.c (help_text): Add GET_SETTINGS.
	(get_settings_data_t): New type.
	(get_settings_data_reset): New function.
	(command_data_t, client_state_t): Add get_settings.
	(get_settings_data): New variable.
	(xml_handle_start_element, xml_handle_end_element): Add GET_SETTINGS.

	* src/manage.h: Add headers accordingly.
	(setting_t): New type.

2012-04-04  Matthew Mundell <matthew.mundell@greenbone.net>

	Add the option to serve OMP on a second address.

	* src/openvasmd.c (manager_socket_2, manager_address_2): New variables.
	(serve_client, accept_and_maybe_fork): Add server_socket arg.  Update
	callers.
	(cleanup, fork_update_nvt_cache): Close manager_socket_2.
	(serve_and_schedule): Add second listening socket to select.
	(main): Add --listen2 and --port2, and serve on this address if given.

2012-04-04  Michael Wiegand <michael.wiegand@greenbone.net>

	* tools/greenbone-scapdata-sync: Add ssh options to disable strict
	host key checking. Patch suggested by Lukas Grunwald.

2012-04-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_target_iterator): Bring first and max into range
	if they are out.

	* src/omp.c (omp_xml_handle_start_element): Bring GET_TARGETS first and
	max into range if they are out.

2012-04-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (split_filter): Set quoted on end term from in_quote.

2012-04-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (struct term, term_t): New type.
	(split_filter): Return array of terms, which have quotation flags.
	(filter_clause): Adjust for new split type.  If term is quoted skip the
	index check.

2012-04-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (TARGET_ITERATOR_EXTRA_COLS, target_count)
	(init_user_target_iterator, init_target_iterator): Make the names of the
	extra columns match the names of the columns on the GSA Targets page.

2012-04-03  Matthew Mundell <matthew.mundell@greenbone.net>

	Add index filtering to the GET_TARGETS.  Syntax is like "name~test and
	port_list_name~iana or hosts=localhost".

	* src/manage_sql.c (vector_find_string): New function.
	(filter_clause): Check term for index prefix and adjust SQL accordingly.
	Also return NULL if the result is the empty string.

2012-04-03  Matthew Mundell <matthew.mundell@greenbone.net>

	Add quotation to the GET_TARGETS filtering.

	* src/manage_sql.c (split_filter): New function.
	(filter_clause): Call split_filter to split the filter term into parts.

2012-04-03  Matthew Mundell <matthew.mundell@greenbone.net>

	Add the names of the port list and credentials to the filtering in
	GET_TARGETS.

	* src/manage_sql.c (filter_clause): Add extra_columns arg.
	(TARGET_ITERATOR_EXTRA_COLS): New define.
	(target_count, init_user_target_iterator, init_target_iterator): Pass
	extra_columns to filter_clause.  Add extra columns to name so that the
	filter clause can access them by name.

2012-03-30  Matthew Mundell <matthew.mundell@greenbone.net>

	Add pagination to GET_TARGETS.

	* src/manage_sql.c (target_count): New function.
	(init_user_target_iterator, init_target_iterator): Add first and max args.

	* src/manage.h: Update headers accordingly.

	* src/manage.c (run_slave_task): Update caller.

	* src/omp.c (get_targets_data_t): Add first and max.
	(omp_xml_handle_start_element): Parse first and max attribs.
	(omp_xml_handle_end_element): In GET_TARGETS add TARGETS and TARGET_COUNT
	and pass first and max through to the iterator.

2012-03-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_TARGETS add a
	NULL check on the filter.

2012-03-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (filter_clause): Add AND and OR, as a test.

2012-03-28  Matthew Mundell <matthew.mundell@greenbone.net>

	Add simple keyword filtering to GET_TARGETS.

	* src/manage_sql.c (filter_clause): New function.
	(init_user_target_iterator, init_target_iterator): Add filter arg.

	* src/manage.h: Update headers accordingly.

	* src/manage.c (run_slave_task): Update caller.

	* src/omp.c (get_targets_data_t, get_targets_data_reset): Add filter.
	(omp_xml_handle_start_element): Append filter attrib.
	(omp_xml_handle_end_element): Pass filter to init_target_iterator.

2012-03-28  Matthew Mundell <matthew.mundell@greenbone.net>

	Rename Escalators to Alerts.  Hence increase database version to 57.  Add
	database migration from version 56 to 57.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 57.

	* src/sql.c (sql_rename_column, iterator_column_count)
	(iterator_column_name): New functions.

	* src/sql.h: Add headers accordingly.

	* src/manage_sql.c: Everywhere replace escalator with alert.
	(migrate_56_to_57): New function.
	(database_migrators): Add migrate_56_to_57.

	* src/manage.c, src/manage.h, src/manage_sql.h, src/omp.c,
	doc/db_postgres.sql: Everywhere replace escalator with alert.

	* src/schema_formats/XML/OMP.xml: Everywhere replace escalator with alert.
	(version): Increment to 4.

	* doc/db.png, doc/omp.rnc, doc/omp.html: Update from source.

2012-03-28  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Post branch version bump.

	* CMakeLists.txt: Updated version number.

2012-03-28  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* CMakeLists.txt, INSTALL: Set dependency for glib and gnutls
	to minimum of what openvas-libraries requires.

2012-03-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (validate_host): Check whether the octets are empty.
	Jump instead of leaking.
	(manage_max_hosts): Check whether the octets are empty.  Return with error
	if there is a trailing -.

2012-03-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_max_hosts): Ensure the octets are within
	numeric range.  Require the 127.0.0.1/24 form to have all four octets.

2012-03-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (validate_host): Improve validation significantly.
	(manage_max_hosts): In the range cases add checks for empty octets.

2012-03-27  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* CMakeLists.txt: Fixed svn revisioning.

2012-03-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (set_task_parameter): Pass quoted value to sql instead
	of original.

2012-03-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_text): Correct CLIENT_C_C_GCR_CONFIG_COMMENT
	variable name.  The was causing the comment of imported configs to come
	out empty.

2012-03-26  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* CHANGES: Replaced leftover 2.0 description by 3.0 description.

2012-03-26  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number to 3.0.1.

2012-03-26  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Preparing the openvas-manager 3.0.0 release.

	* CHANGES: Updated.

	* INSTALL: Increased dependency for openvas-libraries to ">= 5.0.0".

	* CMakeLists.txt: Bumped version to 3.0.0.

2012-03-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (run_slave_task): Set SO_KEEPALIVE on slave socket.

2012-03-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CREATE_OVERRIDE and
	MODIFY_OVERRIDE find the result and task with the for_actions versions of
	the find functions, so that the owners resource is found when the user is
	observing the task.

2012-03-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CREATE_NOTE and MODIFY_NOTE
	find the result and task with the for_actions versions of the find
	functions, so that the owners resource is found when the user is observing
	the task.

2012-03-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (run_slave_task): Add the missing case where the
	credential has a key, now that there is OMP support for this.

2012-03-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (serve_client): Set SO_KEEPALIVE to 1 on the scanner
	socket, because the connection may be idle for long periods, for example
	when the task is paused.

2012-03-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (main): Create PID file earlier.

2012-03-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (find_user): Sort backwards to get the most recently
	added user, because there can be old users in the db.

2012-03-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_scap_loaded): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_end_element): Check whether SCAP is available
	before attempting prognostic report, otherwise the SQL will fault.

2012-03-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (set_task_observers): Allow ',' to separate names too.
	Skip over empty names.

2012-03-16  Michael Wiegand <michael.wiegand@greenbone.net>

	Clean up CMake infrastructure and ensure that compilation with modern
	gccs works.

	* CMakeLists.txt: Remove setting of OPENVAS_LIB_INSTALL_DIR and
	OPENVAS_HEADER_INSTALL_DIR as they are retrieved via pkg-config now.

	* src/CMakeLists.txt: Remove handling of now superfluous
	OPENVAS_LIB_INSTALL_DIR and OPENVAS_HEADER_INSTALL_DIR. Set link
	libraries via target_link_libraries and not via LINK_FLAGS since this
	breaks compilation with more modern gccs. Take libraries from
	pkg-config output instead of hardcoding them.

	* INSTALL: Removed reference to now obsolete variables.

2012-03-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_target): Quote name later to simplify early
	returns.  Add missing free.

2012-03-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (user_owns_uuid, user_has_access_uuid): Add special
	case for results.
	(find_result_for_actions): New function.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_RESULTS use the
	action versions of the find functions, in case the user is an observer on
	the result's task.

2012-03-15  Matthew Mundell <matthew.mundell@greenbone.net>

	Make the extra report formats work standalone.

	* report_formats/IVIL/IVIL.xsl (/): Move body to report.  Swallow wrapper.
	(report): New template.

	* report_formats/arf/arf.xsl (openvas:report): New function.
	(host-report): Remove absolute ref.
	(/): New template.

	* report_formats/simple_bar_chart/plot-plt.xsl (/): Move body to report.
	Swallow wrapper.
	(report): New template.  Body from /.  Add report format param checks so
	that the format works with exported XML reports.

	* report_formats/simple_bar_chart/plot.xsl (openvas:report): New
	function.
	(/): Remove absolute refs.

	* report_formats/simple_map_plot/report_to_csv_host.xsl (report): Iterate
	using host instead of host_start.
	(/): New template.

	* report_formats/simple_pie_chart/pieplot.xsl (newline): New template.
	(/): Move body to report.  Swallow wrapper.
	(report): New template.  Body from /.  Add report format param checks so
	that the format works with exported XML reports.

	* report_formats/simple_topo_plot/generate: Add report format param check
	so that the format works with exported XML reports.

	* report_formats/simple_topo_plot/hostvisdot-summary.xsl (newline): New
	template.
	(report): Add report format param checks so that the format works with
	exported XML reports.
	(/): New template.

	* report_formats/sourcefire/sourcefire.xsl (/report): Make relative.
	(/): New template.

2012-03-15  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number to 3.0+rc2.

2012-03-15  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Preparing the openvas-manager 3.0+rc1 release.

	* CHANGES: Updated.

	* CMakeLists.txt: Bumped version to 3.0+rc1.

2012-03-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (cvss_threat): Change param to a double.
	(prognosis_iterator_cvss_double): New function.
	(print_report_xml): Get the CVSS from the prognosis iterator as a double,
	to preserve the fraction, otherwise the rounding can give the result the
	wrong threat level.

2012-03-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/LaTeX/latex.xsl
	(results-per-host-single-host-port-findings): Select host from ip element,
	now that the caller interates over hosts instead of host_starts.

2012-03-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/LaTeX/latex.xsl
	(result-details-host-port-threat): Use \sim for the tilde, because it
	aligns better.

2012-03-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OID to detection results in predefined report formats.

	* src/report_formats/HTML/HTML.xsl (result [issue]): Add OID.

	* src/report_formats/TXT/TXT.xsl (result [issue]): Add OID.

	* src/report_formats/LaTeX/latex.xsl
	(result-details-host-port-threat): Add OID.

2012-03-14  Matthew Mundell <matthew.mundell@greenbone.net>

	In the remaining predefined report formats, handle the wrapper report
	element present in exported XML reports.

	* src/report_formats/CPE/CPE.xsl (report): New template.  Swallow wrapper
	report if present, then apply as / did before.
	(/): Just apply report.

	* src/report_formats/ITG/ITG.xsl (report): New template.  Swallow wrapper
	report if present, then apply as / did before.
	(/): Just apply report.

	* src/report_formats/NBE/NBE.xsl (/): Swallow wrapper report if present.

2012-03-14  Matthew Mundell <matthew.mundell@greenbone.net>

	In the HTML, TXT and LaTeX report formats, handle the wrapper report
	element present in exported XML reports.  Adjust or remove absolute path
	references accordingly.

	* src/report_formats/HTML/HTML.xsl (overide): Remove apply_overrides test.
	Now in caller.
	(result [issue]): Replace absolute report refs with report param.
	(report): Move body to real-report.  Swallow wrapper report if present.
	(real-report): New template.  Body from report.  Remove absolute refs.

	* src/report_formats/TXT/TXT.xsl (overide): Remove apply_overrides test.
	Now in caller.
	(result [issue]): Add apply_overrides test.
	(report): Move body to real-report.  Swallow wrapper report if present.
	(real-report): New template.  Body from report.  Remove absolute refs.
	(/): Move body to report.

	* src/report_formats/LaTeX/latex.xsl: Everywhere replace absolute
	references to /report with a call to openvas:report.
	(openvas:report): New function.
	(report): Move body to real-report.  Swallow wrapper report if present.
	(real-report): New template.  Body from report.  Remove absolute refs.
	(/): New template.

2012-03-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/TXT/TXT.xsl (report): Restrict the mention of the
	full count to the normal scan report, because the count is only available
	there.

	* src/report_formats/HTML/HTML.xsl (report): Restrict the mention of the
	full count to the normal scan report, because the count is only available
	there.

	* src/report_formats/LaTeX/latex.xsl (results-overview): Restrict the
	mention of the full count to the normal scan report, because the count is
	only available there.

2012-03-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/TXT/TXT.xsl (result [prognostic-issue]): New
	template.
	(report): Add prognostic summary.  Skip overrides, notes, times and ports
	for prognostic.  Iterate over hosts instead of host_starts, because
	prognostic reports only have hosts.  Special case the prognostic result
	template.
	(/): Add prognostic heading.

2012-03-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/HTML/HTML.xsl (template): Add prognostic title.
	(abstract): Add prognostic cases.
	(results-overview): Skip overrides and notes for prognostic.
	(prognostic-result, results-per-host-prognostic): New templates.
	(results-per-host-single-host): Expect current element to be host instead
	of host_start.  Skip times for prognostic.  Special case the prognostic
	result template.
	(results-per-host): Iterate over hosts instead of host_starts, because
	prognostic reports only have hosts.

2012-03-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): Add type when delta.

2012-03-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/HTML/HTML.xsl (result [issue]): Add a separate
	prognostic case.
	(report): Add prognostic summary.  Skip notes, overrides, port summary and
	start time for prognostic.  Iterate over hosts instead of host_starts, because
	prognostic reports only have hosts.

2012-03-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/TXT/TXT.xsl (nvt): Remove lines around References
	section, so that it matches the other sections.
	(notes, overrides): Add delta case.
	(result [issue]): Add delta state marker to heading.  Add extra delta
	sections.  Pass delta arg to notes and overrides templates.
	(report, /): Modify heading and summary in delta case.

2012-03-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/HTML/HTML.xsl (report): Remove typo.

	* src/report_formats/LaTeX/latex.xsl (header): Add colours chunk, line_new
	and line_gone.  Modify heading for delta.
	(text-to-escaped-diff-row): New template.
	(abstract): Add delta versions.
	(notes, overrides): Add delta case.
	(result-details-host-port-threat): Add delta state marker and extra
	sections.  Pass delta arg to notes and overrides templates.

2012-03-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/HTML/HTML.xsl (override): Add delta arg.
	(result [issue]): Add missing override delta case.

2012-03-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/HTML/HTML.xsl (highlight-diff)
	(highlight-diff-line): New function.
	(note): Add delta param.
	(result [issue]): Add delta cases.
	(report): Add delta version of descriptions, and times.

2012-03-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (CLOSE, CLOSE_READ_OVER): New macros.
	(omp_xml_handle_end_element): Replace simple element closes with macro
	calls.

2012-03-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c: Remove prospective GET_CERTIFICATES code.  This can be added
	back if ever really needed.

2012-03-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (ELSE_ERROR): New macro.
	(omp_xml_handle_start_element): Replace element error else clauses with
	ELSE_ERROR call.

2012-03-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_start_element): Remove the explicit checks for
	bogus children of empty elements.  Add a generic bogus element error in
	the default case, as a replacement.

2012-03-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (APPEND): New macro.
	(handle_text): Use APPEND to neaten things slightly.

2012-03-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/HTML/HTML.xsl (result [issue]): Add product detection
	block.

	* src/report_formats/TXT/TXT.xsl (result [issue]): Add product detection
	block.

	* src/report_formats/LaTeX/latex.xsl (result-details-host-port-threat): Add
	product detection block.

2012-03-05  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/manage_sql.c (delete_config): Prevent deletion of "Full and Fast"
	Scan Config. Spotted by Matthew Mundell.

2012-03-02  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/manage_sql.c (delete_config): Removed duplicate condition
	spotted by cppcheck.

2012-03-02  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/manage_sql.c (manage_set_setting): Fixed compilation against
	latest openvas-libraries.

2012-02-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_ranges_all_tcp_nmap_5_51_top_100.c
	(make_port_ranges_all_tcp_nmap_5_51_top_100): Correct upper TCP bound.

	* src/manage_ranges_all_tcp_nmap_5_51_top_1000.c
	(make_port_ranges_all_tcp_nmap_5_51_top_1000): Correct upper TCP bound.

2012-02-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (clean_hosts): Add max arg.  Adjust for duplicates.
	(create_targets): Pass max to clean_hosts, and check max for size
	after clean_hosts, in case of duplicates.

	* src/sql.c (sql_clean_hosts): Add clean_hosts arg.

2012-02-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otp.c (array_find_string): New function.
	(clean_hosts): Buffer the cleaned strings in an array temporarily, to
	prevent textual duplicates.

2012-02-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otp.c (append_debug_message): Remove.
	(append_error_message): New function.  Was append_debug_message.
	(scanner_state_t): Rename states.
	(process_otp_scanner_input): Convert DEBUG message parsing to ERRMSG
	parsing.

2012-02-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (validate_host): New function.
	(manage_max_hosts): Improve validation of hosts.

2012-02-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_max_hosts): Allow newlines to separate hosts.
	(clean_hosts): Allow newlines to separate hosts.  Prevent a leading comma
	in the hosts string when the first host is empty.
	(create_target): Also return an error if the host count is zero, in the
	import case.

2012-02-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_max_hosts): Count over empty elements.
	(create_target): Also return an error if the host count is zero.  This
	ensures that a target always has at least one host.

2012-02-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (port): New type.
	(commands): Add port list commands and responses.
	(create_port_list, create_port_range): New commands.
	(create_target): Add PORT_LIST.
	(delete_port_list, delete_port_range, get_port_lists): New commands.
	(get_targets): Add TARGET/PORT_LIST.
	(help): Update text response in example.

	* doc/omp.rnc, doc/omp.html: Update from source.

2012-02-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_port_list_unique): Remove out of use ranges
	arg.  Update caller.  Remove note about freeing item, because array_free
	does it.
	(create_port_list): Remove note about freeing item, because array_free
	does it.
	(create_port_range): Correct return.

2012-02-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Add details flag to OMP GET_PORT_LISTS.

	* src/omp.c (help_text): Correct command name.
	(get_port_lists_data_t): Add details.
	(omp_xml_handle_start_element): Parse details flag.
	(omp_xml_handle_end_element): In CLIENT_GET_PORT_LISTS send all info
	only when details flag is true.

2012-02-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db_postgres.sql (port_lists, port_lists_trash, port_ranges)
	(port_ranges_trash): New tables.
	(targets, targets_trash): Switch port ranges to port lists.

	* doc/db.png: Update from source.

2012-02-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_tables): Add note about overlapping ranges.

2012-02-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_port_range): If the new range overlaps any
	existing range then return an error instead of trying to deal with the
	complexity of combining the ranges.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_PORT_RANGE
	adjust create_port_range return for new meaning.

2012-02-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_port_range): If last precedes first, swap them.

2012-02-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_port_range): Handle overlapping ranges.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_PORT_RANGE add
	new create_port_range return.

2012-02-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (range_compare, ranges_sort_merge): New functions.
	(create_port_list_lock): Merge overlapping ranges before inserting them.

2012-02-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (omp_xml_handle_end_element): In CLIENT_GET_PORT_LISTS
	send start for end if end is NULL.

2012-02-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_port_range_iterator): If sort_field is NULL sort
	by type then start, instead of by ROWID.  This improves sorting of ranges
	in GET_PORT_LISTS.

2012-02-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (port_range_ranges): Clear range on allocation so that
	the fields are initialised.
	(port_list_in_use): Lowercase UUID and add missing arg.

2012-02-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (port_list_iterator_count)
	(port_list_iterator_count_tcp, port_list_iterator_count_udp): New
	functions.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): Add port counts to
	GET_PORT_LISTS response.

2012-02-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_port_list): Add missing SQL statement.

2012-02-21  Matthew Mundell <matthew.mundell@greenbone.net>

	Add importing of port list to OMP CREATE_PORT_LIST.

	* src/manage_sql.c (struct range, range_t): Remove.  Now exported.
	(create_port_list_lock): Add ID arg, and handle IDs in ranges.  Update
	callers.
	(create_port_list): Add import case.

	* src/manage.h: Add header accordingly.  Remove empty page.
	(struct range, range_t): New type.  From manage_sql.c.

	* src/omp.c (struct create_port_list_range, create_port_list_range_t): New
	type.
	(create_port_list_data_t, create_port_list_data_reset): Add import ranges.
	(client_state_t): Add import states.
	(xml_handle_start_element, xml_handle_end_element)
	(omp_xml_handle_text): Add import to CREATE_PORT_LIST.
	(convert_to_manage_ranges): New function.

2012-02-17  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP DELETE_PORT_RANGE.

	* src/manage_sql.c (find_port_range, delete_port_range): New
	functions.
	(delete_port_range): Tidy doc.

	* src/omp.c (help_text): Add delete_port_range.
	(delete_port_range_data_t): New type.
	(delete_port_range_data_reset): New function.
	(command_data_t, client_state_t): Add delete_port_range.
	(delete_port_range_data): New variable.
	(xml_handle_start_element, xml_handle_end_element): Add DELETE_PORT_RANGE.

	* src/manage.h: Add headers accordingly.

2012-02-17  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP CREATE_PORT_RANGE.

	* src/manage_sql.c (create_port_range, port_range_uuid)
	(port_list_in_use): New functions.

	* src/omp.c (create_port_range_data_t): New type.
	(create_port_range_data_reset): New function.
	(command_data_t, client_state_t): Add create_port_range.
	(create_port_range_data): New variable.
	(xml_handle_start_element, xml_handle_end_element, xml_handle_text): Add
	CREATE_PORT_RANGE.

	* src/manage.h: Add headers accordingly.

2012-02-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (validate_port_range): Refer to port range by protocol
	in doc.
	(otp_port_range_ranges): Remove.  Now port_range_ranges.
	(port_range_ranges): New function.  Renamed to better fit purpose.  Update
	callers.

2012-02-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (validate_port_range, otp_port_range_ranges): Allow
	newlines, empty ranges and space between tokens.

2012-02-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_port_list): Correct condition in last commit.

2012-02-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_port_list): Prevent removal of predefined port
	lists.
	(port_list_iterator_in_use): Always consider predefined port lists in use.

2012-02-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/CMakeLists.txt (manage, C_FILES): Add new port range files.

2012-02-15  Matthew Mundell <matthew.mundell@greenbone.net>

	Add rest of predefined port lists.

	* src/manage_sql.c (PORT_LIST_UUID_ALL_TCP_NMAP_5_51_TOP_100)
	(PORT_LIST_UUID_ALL_TCP_NMAP_5_51_TOP_1000)
	(PORT_LIST_UUID_ALL_IANA_TCP_2012)
	(PORT_LIST_UUID_ALL_IANA_TCP_UDP_2012): New defines.
	(ensure_predefined_port_lists_exist): Add new lists.

	* src/manage_ranges_all_tcp_nmap_5_51_top_100.c,
	src/manage_ranges_all_tcp_nmap_5_51_top_1000.c,
	src/manage_ranges_iana_tcp_2012.c, src/manage_ranges_iana_tcp_udp_2012.c,
	src/manage_ranges_nmap_5_51_top_2000_top_100.c: New files.  Port ranges
	for the new predefined port lists.

2012-02-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/sql.c, src/sql.h: New files.  SQL helpers and iterators from
	manage_sql.

	* src/manage_sql.c (clean_hosts, clean_hosts): Export for sql.c.
	(task_db, sql_nquote, sql_quote, sql_insert, sql, sql_quiet, sql_x)
	(sql_int, sql_string, sql_int64, sql_make_uuid, sql_hosts_contains)
	(sql_clean_hosts, sql_uniquify, sql_iso_time, sql_now): Move to sql.c.
	(init_iterator, iterator_int64, iterator_string, cleanup_iterator)
	(next): Move to sql.c.

2012-02-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (PORT_LIST_UUID_ALL_TCP, PORT_LIST_UUID_ALL_PRIV_TCP)
	(PORT_LIST_UUID_ALL_PRIV_TCP_UDP): New defines.
	(ensure_predefined_port_lists_exist): Add more lists.

2012-02-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP CREATE_PORT_LIST and add PORT_LIST to OMP CREATE_TARGET.

	* src/manage_sql.c (make_port_ranges_openvas_default): New function.
	(ensure_predefined_port_lists_exist): Move range creation out to
	make_port_ranges_openvas_default.
	(create_target): Add port_list_id arg.  Associate target with this list if
	given.
	(create_port_list_lock): Add assertion.  Remove redundant free.
	(create_port_list, port_list_uuid): New functions.

	* src/omp.c (create_port_list_data_t): New type.
	(create_port_list_data_reset): New function.
	(create_target_data_t, create_target_data_reset): Add port_list_id.
	(command_data_t): Add CREATE_PORT_LIST.
	(client_state_t): Add CREATE_PORT_LIST states.  Add
	CLIENT_CREATE_TARGET_PORT_LIST.
	(create_port_list_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_text): Add CREATE_PORT_LIST.
	(omp_xml_handle_end_element): Add CREATE_PORT_LIST.  Add PORT_LIST to
	CREATE_TARGET.

	* src/manage.h: Update headers accordingly.

2012-02-10  Matthew Mundell <matthew.mundell@greenbone.net>

	Add port lists.  Switch targets to refer to port lists instead of OTP
	style port ranges.  Hence increase database version to 56.  Add
	database migration from version 55 to 56.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 56.

	* src/manage_sql.c (PORT_LIST_UUID_DEFAULT): New definition.
	(create_tables): Add port_lists, port_lists_trash, port_ranges and
	port_ranges_trash.  Add port_list location to targets_trash.
	(migrate_55_to_56): New function.
	(database_migrators): Add migrate_55_to_56.
	(RANGE): New macro.
	(ensure_predefined_port_lists_exist): New function.
	(init_manage): Call ensure_predefined_port_lists_exist.
	(validate_port_range): Align doc param.
	(create_target): Autogenerate a port list for the target from the OTP port
	range.
	(delete_target): Set port_list_location.
	(init_user_target_iterator, init_target_iterator): Add port list name and
	UUID.
	(target_iterator_port_range): Remove.  Replaced by target_port_range.
	(target_iterator_port_list_uuid, target_iterator_port_list_name)
	(target_iterator_port_list_trash, target_port_list): New functions.
	(target_port_range): Generate the ranges from the port list.
	(struct range, range_t): New type.
	(find_port_list, create_port_list_lock, otp_port_range_ranges)
	(create_port_list_unique, delete_port_list, init_port_list_iterator)
	(port_list_iterator_port_list, port_list_iterator_uuid)
	(port_list_iterator_name, port_list_iterator_comment)
	(port_list_iterator_in_use, init_port_range_iterator)
	(port_range_iterator_uuid, port_range_iterator_comment)
	(port_range_iterator_start, port_range_iterator_end)
	(port_range_iterator_type, port_range_iterator_type_int)
	(port_range_iterator_exclude, init_port_list_target_iterator)
	(port_list_target_iterator_uuid, port_list_target_iterator_name): New
	functions.
	(manage_restore, manage_empty_trashcan): Add port lists.

	* src/manage.h: Add and remove headers accordingly.
	(port_protocol_t): Prescribe numbers.
	(port_list_t, port_range_t): New types.

	* src/omp.c (help_text, command_data_t, client_state_t): Add port list
	ops.
	(delete_port_list_data_t, get_port_lists_data_t): New types.
	(delete_port_list_data_reset, get_port_lists_data_reset): New function.
	(delete_port_list_data, get_port_lists_data): New variables.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add port list
	ops.

2012-01-25  Henri Doreau <henri.doreau@greenbone.net>

	Wrap storage of the scanner security messages into transactions. This
	improves performances by several order of magnitude against message
	bursts.

	* src/otp.c (write_message): Open transaction (if needed) before
	inserting a new message into the database.
	(process_otp_scanner_input): Close any pending transaction.

	* src/manage.c (manage_check_current_task): Close pending and inactive
	transactions.

	* src/manage_sql.c (TIMEVAL_SUBTRACT_MS, manage_transaction_start)
	(manage_transaction_stop): New.

	* src/manage_sql.h: Update headers accordingly.

	* src/omp.c (process_omp_client_input): Close pending transactions.

2012-01-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (lookup_report_format): Add current user condition, as
	many users may have report formats with the given name.

2012-01-24  Michael Wiegand <michael.wiegand@greenbone.net>

	* tools/greenbone-scapdata-sync: Set RSYNC_DELETE to empty by default
	to avoid removing scap.db on every run.

2012-01-18  Henri Doreau <henri.doreau@greenbone.net>

	* report_formats/arf/create_report_import: Leave name, description and
	summary out of the plugin signature as they can be changed by the
	user.

2012-01-18  Henri Doreau <henri.doreau@greenbone.net>

	Added new report format plugin to produce NIST asset identification
	format 1.1 compliant documents.

	* report_formats/arf/arf.xsl,
	report_formats/arf/create_report_import,
	report_formats/arf/generate: new.

2012-01-17  Henri Doreau  <henri.doreau@greenbone.net>

	* src/manage_sql.c (init_asset_iterator, host_nthlast_report_host)
	(filtered_host_count): Only wait for host (instead of task) completion
	to use the gathered host details.

2012-01-17  Henri Doreau  <henri.doreau@greenbone.net>

	* src/manage_sql.c (init_report_host_details_iterator): Added comment
	about the filtering of internal product detection fields.

2012-01-17  Henri Doreau  <henri.doreau@greenbone.net>

	* src/manage_sql.c (trim_partial_report): Don't delete host details
	for already-completed hosts when resuming a stopped scan.

2012-01-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_target, manage_restore): Add missing port_range
	field to target movement.

2012-01-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage): Remove the requirement that the trash
	directory exists, in the code that syncs the trash directory with the
	database.

2012-01-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (omp_xml_handle_end_element): In GET_REPORTS add NULL
	owner checks to the brief case, as in the detailed case.  Can be NULL with
	example task.

2012-01-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage): Ensure that the report formats trash
	directory matches the database.

2012-01-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_report_format): Use correct variable in
	message.
	(manage_empty_trashcan): Remove the report formats on disk too.

2012-01-09  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* INSTALL: Re-arranged text a bit and added some Debian 6 info.

2012-01-04  Henri Doreau <henri.doreau@greenbone.net>

	* src/report_formats/TXT/TXT.xsl (nvt): Wrap BID lists to 80 columns.
	(wrapped_cve_list): Renamed into wrapped_list. Changed to handle
	arbitrary elements per line.

2012-01-03  Henri Doreau <henri.doreau@greenbone.net>

	* src/report_formats/TXT/TXT.xsl (nvt): New. Added a reference box
	to report CVE/BID/Xrefs of each result.
	(wrapped_cve_list): New. Smartly cut long CVE lists into 80 columns-wide
	lines.

2012-01-03  Henri Doreau <henri.doreau@greenbone.net>

	* src/report_formats/LaTeX/latex.xsl (references): New. Added a reference box
	to report CVE/BID/Xrefs of each result.

2012-01-03  Henri Doreau <henri.doreau@greenbone.net>

	* src/report_formats/HTML/HTML.xsl (nvt): New. Added a reference box to
	report CVE/BID/Xrefs of each result.

2011-12-22  Henri Doreau <henri.doreau@greenbone.net>

	* src/manage_sql.c (update_nvti_cache): Add xref to the NVTI cache.

2011-12-22  Henri Doreau <henri.doreau@greenbone.net>

	* src/manage_sql.c (result_iterator_nvt_xref): New function. Get NVT
	XREF from a result iterator.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (buffer_results_xml): Add xref element to scan results.

2011-12-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (get_reports): Add host filter attribs.
	Add prognostic report type.  Add delta attribs.
	(modify_config): Add NAME and COMMENT.
	(report): Add DELTA, FILTERS/HOST and FILTERS/DELTA.
	(create_report): Add TASK.

	* doc/omp.rnc, doc/omp.html: Update from source.

	* ChangeLog: Correct command name.

2011-12-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (version): Update.
	(authenticate): Add ROLE and TIMEZONE to response.
	(modify_settings): New command.
	(help): Add new commands to plain response.  Update AUTHENTICATE response
	in schema example.

	* doc/omp.rnc, doc/omp.html: Update from source.

2011-12-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (actions): Remove trailing dot.
	(create_note, create_override, modify_note, modify_override, get_notes)
	(get_overrides): Add ACTIVE and END_TIME.

	* doc/omp.rnc, doc/omp.html: Update from source.

2011-12-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (result): New element.  From report.
	Add details and detection.
	(report): Call through to result.

	* doc/omp.rnc, doc/omp.html: Update from source.

2011-12-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (parse_iso_time): Also try parse the special %FT%TZ ISO
	format, because this is what's in the report when the timezone was UTC.

2011-12-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_start_element): In CREATE_TASK remove task if
	setting observers fails.

2011-12-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_result_iterator): In the result ordering convert
	NULL CVSS bases to 0.0 before sorting.  This ensures that the ordering is
	the same as the ordering expected by the delta comparison functions.

2011-12-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (migrate_53_to_54, migrate_53_to_54): Ensure that the table
	exists before altering it.

2011-12-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (run_slave_task): Try the old XML UUID if the new one
	fails.

2011-12-05  Matthew Mundell <matthew.mundell@greenbone.net>

	Update the UUIDs of the predefined report formats because the signing
	technique has changed.  Hence increase database version to 55.  Add
	database migration from version 54 to 55.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 55.

	* src/manage_sql.c (migrate_54_to_55_format, migrate_54_to_55): New
	functions.
	(database_migrators): Add migrate_54_to_55.
	(init_manage, report_format_predefined): Update report format UUIDs.

	* src/omp.c (omp_xml_handle_start_element)
	(omp_xml_handle_end_element): Update report format UUIDs.

	* src/manage.c (run_slave_task): Update report format UUIDs.

	* doc/db.png: Update for version change.

2011-12-05  Henri Doreau <henri.doreau@greenbone.net>

	Implemented CR#57 (NVT Feed Product Detection Improvements).

	* src/manage_sql.c (result_detection_reference): New function.
	(init_report_host_details_iterator): Filter out product detection host
	details when generating reports.

	* src/manage.h: Update header accordingly.

	* src/omp.c (buffer_results_xml): Add product detection block to the
	vulnerability detection results.

2011-12-02  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number.

2011-12-02  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 3.0+beta8 release.

	* CHANGES: Updated.

2011-12-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/HTML/HTML.xsl (note, override): Add "active until".
	(report): Add hostname in Host Summary.

	* src/report_formats/LaTeX/latex.xsl (result-overview)
	(results-overview-table-single-host-row): Add hostname in Host Summary.
	(notes, overrides): Add "active until".

	* src/report_formats/TXT/TXT.xsl (note, override): Add "active until".
	(report): Add hostname in Host Summary.

2011-11-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (report_counts_id_filt): Account for host in override
	case.

2011-11-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (report_count_filtered): Add missing paren in SQL.

2011-11-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_note): Add missing active param.
	(note_iterator_end_time, note_iterator_active): Correct position.

	* src/manage.h: Update header accordingly.

	* src/omp.c (create_note_data_t, create_note_data_reset)
	(client_state_t): Add active elements.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add ACTIVE to CREATE_NOTE.  Missing from last
	patch.

2011-11-22  Matthew Mundell <matthew.mundell@greenbone.net>

	Add note end times.  Hence increase database version to 54.  Add
	database migration from version 53 to 54.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 54.

	* src/manage_sql.c (create_tables): Add end_time to notes.
	(migrate_53_to_54): New functions.
	(database_migrators): Add migrate_53_to_54.
	(modify_note): Add active param.
	(NOTE_COLUMNS): Add active fields.
	(note_iterator_end_time, note_iterator_active): New functions.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (modify_note_data_t, modify_note_data_reset)
	(client_state_t): Add active.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add ACTIVE to MODIFY_NOTE and CREATE_NOTE.
	(buffer_notes_xml): Add ACTIVE and END_TIME to NOTE.

	* doc/db_postgres.sql (notes): Add column end_time.

	* doc/db.png: Update from source.

2011-11-23  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number.

2011-11-23  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 3.0+beta7 release.

	* CHANGES: Updated.

2011-11-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage): Check for the predefined report formats
	by UUID instead of by name.  This prevents them from being duplicated when
	the user changes the name.

2011-11-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/create_signatures: Remove editable values from
	content for signing.

2011-11-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (compare_files): New function.
	(create_report_format): Sort the files alphabetically, to match the order
	used in verify_report_format.

	* report_formats/simple_bar_chart/create_report_import,
	report_formats/simple_map_plot/create_report_import,
	report_formats/simple_pie_chart/create_report_import,
	report_formats/simple_topo_plot/create_report_import,
	report_formats/sourcefire/create_report_import: Remove editable values
	from content for signing, to match Manager.  Order files alphabetically.

2011-11-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_report_format, verify_report_format): Remove
	name, summary, description and parameter values from content for signing.
	This insures that the trust stays the same, even if the report format is
	edited.

2011-11-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (iso_time): Make public.

	* src/manage.h: Update header accordingly.

	* src/omp.c (ctime_strip_newline): Remove.  Out of use.
	(buffer_notes_xml, buffer_overrides_xml, buffer_overrides_xml)
	(buffer_schedules_xml, buffer_schedules_xml, omp_xml_handle_end_element)
	(omp_xml_handle_end_element, omp_xml_handle_end_element)
	(omp_xml_handle_end_element): Send ISO times instead of ctime.

2011-11-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (parse_ctime): Parse ctime using the current timezone.
	(parse_iso_time): Call parse_ctime instead of parse_iso_time, so that old
	reports are imported using the current timezone.

2011-11-21  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch report times to ISO 8601 format.

	* src/manage_sql.c (ctime_strip_newline): Remove.  Out of use.
	(sql_ctime): Remove.  Rename to sql_iso_time.
	(sql_iso_time): New function.  Was sql_ctime.  Switch to ISO format.
	(parse_iso_time, iso_time): New functions.
	(init_manage_process): Rename ctime SQL function to iso_time.  Rename in
	all callers too.
	(set_task_start_time, create_report, set_scan_start_time)
	(set_scan_end_time, set_scan_host_end_time)
	(set_scan_host_start_time): Expect ISO time instead of ctime.
	(set_task_start_time_otp, set_scan_start_time_otp)
	(set_scan_start_time_otp, set_scan_host_end_time_otp)
	(set_scan_host_start_time_otp): New function.  Copy of old ctime version.
	(report_timestamp): Switch to ISO format.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): Update version to reflect
	change.

	* src/otp.c (process_otp_scanner_input): Call ctime variants of time
	functions.

2011-11-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_report): Swap host_starts and host_ends args
	to match documentation and callers.

2011-11-16  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number.

2011-11-16  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 3.0+beta6 release.

	* CHANGES: Updated.

2011-11-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (init_asset_iterator, filtered_host_count): Add
	apply_overrides arg.
	(print_report_xml): Pass apply_overrides flag through to iterator
	initialisers and counting functions, in the assets and prognostic
	case.

2011-11-14  Michael Wiegand <michael.wiegand@greenbone.net>

	* tools/greenbone-scapdata-sync: Fix location of log file.

2011-11-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (migrate_51_to_52): Update comment from previous
	migrator.

2011-11-10  Michael Wiegand <michael.wiegand@greenbone.net>

	* CMakeLists.txt: Adjust source locations in install command to enable
	installation from an out-of-source build.

2011-11-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_start_element): Compare ultimate flag with "0"
	instead of "ultimate".  This is the intended behaviour, clients would only
	have been affected if they passed "0" explicitly.

2011-11-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_tables): Add index results_by_host.

2011-11-08  Matthew Mundell <matthew.mundell@greenbone.net>

	Include override active state in MODIFY_OVERRIDE and CREATE_OVERRIDE.

	* src/manage.c (create_override, modify_override): Add active argument.
	Set end_time accordingly.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (create_note_data_reset, create_override_data_reset)
	(modify_override_data_t, modify_override_data_reset, client_state_t): Add
	active.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add ACTIVE to CREATE_OVERRIDE and MODIFY_OVERRIDE.
	(buffer_overrides_xml): Only generate the end time when there is one.

2011-11-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (manage_scap_update_time): Format time like SCAP times.

2011-11-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (SCAP_TIMESTAMP_FILENAME): New define.
	(manage_scap_update_time): New function.
	(manage_read_info): Send SCAP update time with CVE and CPE.

2011-11-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Quote in attributes with single
	quotes because double quotes breaks the syntax.

2011-11-04  Matthew Mundell <matthew.mundell@greenbone.net>

	Add override end times.  Hence increase database version to 53.  Add
	database migration from version 52 to 53.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 53.

	* src/manage_sql.c (sql_now, migrate_52_to_53): New functions.
	(create_tables): Add end_time to overrides.
	(database_migrators): Add migrate_52_to_53.
	(init_manage_process): Create SQL now function.
	(task_threat_level, task_previous_threat_level, init_result_iterator)
	(report_scan_result_count, report_count, report_count_filtered)
	(report_counts_id_filt, modify_override): Add end_time to override check.
	(override_iterator_end_time, override_iterator_active): New functions.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (buffer_overrides_xml): Add ACTIVE and END_TIME.

	* doc/db_postgres.sql (overrides): Add column end_time.

	* doc/db.png: Update from source.

2011-11-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (buffer_notes_xml, buffer_overrides_xml): Copy ctime return to
	preserve it across multiple calls.

2011-11-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (cvss_threat, prognosis_where_levels): Match CVSS
	threat boundaries to update of CR 42.

2011-11-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): Correct detail descriptions in
	assets case.

2011-11-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): In the prognostic case, use the
	host buffer length instead of filtered_host_count, because the host buffer
	accounts for first_result and max_results.

2011-11-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): In the prognostic case, calculate
	the filtered total from the other totals, to include the level filtering.
	Only skip the host if result_hosts_only is set.  Move the host buffering
	out of the result loop, and add a result_hosts_only check there too.  Add
	missing iterator cleanup.

2011-11-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): Buffer the host only if it has
	results on the current page.

2011-11-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (struct buffer_host): New structure.
	(buffer_host_t): New type.
	(free_buffer): New function.
	(print_report_xml): In the prognostic case, buffer the hosts and print
	them after the results, so that all results occur in the one RESULTS
	and all hosts occur in one HOSTS.  Also do the first and max filtering by
	hand instead of passing them to the result iterator, because that only
	works for single hosts.  And count the filtered_result_count by hand too,
	otherwise it includes all threat levels.

2011-11-01  Henri Doreau <henri.doreau@greenbone.net>

	* tools/cpe_getbyname.xsl: Return an empty item if nothing was found.

2011-10-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (prognostic_report_result_count): Increment the return
	counts instead of setting them.
	(print_report_xml): Skip prognostic hosts that have 0 results.

2011-10-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): Neaten prognostic result wording
	slightly.

2011-10-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (prognostic_report_result_count): New function.
	(print_report_xml): Count the filtered results with separately, in order
	to count all the filtered results.

2011-10-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (PRINT_XML): New macro.
	(print_report_xml): Use PRINT_XML to output strings that already have the
	XML tags in them.

2011-10-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (PRINT): Print to a string first, for XML escaping.

2011-10-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_TASKS add NULL checks on
	owner, because owner is NULL for the example task.

2011-10-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In the brief version of
	GET_REPORTS, move the second last report generation to precede the last
	report.  This allows the counts from the first report to be reused
	correctly.  Also include the second last report in the reuse check of
	the last report.

2011-10-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In the brief version of
	GET_REPORTS, move the first_report_id free to follow the last use, and
	compare the report IDs with strcmp because they're strings.

2011-10-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In the brief version, merge the
	false positives count variables into a single variable in a broader scope,
	as is done with the other counts.  Do the same for all the counts of
	second last report case of the brief version.  This ensures that these
	variables are always initialised.

2011-10-24  Matthew Mundell <matthew.mundell@greenbone.net>

	Add to GET_INFO CPE a list of CVEs to which the CPE is vulnerable.

	* src/manage.c (manage_read_info): Add CVEs to CPE.

	* src/manage_sql.c (init_cpe_cve_iterator, cve_iterator_name)
	(cve_iterator_cvss): New function.

	* src/manage.h: Add headers accordingly.

2011-10-21  Matthew Mundell <matthew.mundell@greenbone.net>

	Add NVTs that address the CVE to GET_INFO CVE.

	* src/manage.c (manage_read_info): Add NVTs to CVE.

	* src/manage_sql.c (NVT_ITERATOR_COLUMNS): New define.
	(init_nvt_iterator): Use NVT_ITERATOR_COLUMNS.
	(init_cve_nvt_iterator): New function.

	* src/manage.h: Add header accordingly.

2011-10-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (manage_read_info): Wrap SCAP CVE and CPE elements in CVE
	and CPE tags.

	* src/schema_formats/XML/OMP.xml (get_info): Update example to match.

	* doc/omp.html: Update from source.

2011-10-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_report): Set task status to New if it was the
	last report.

2011-10-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (set_task_schedule): Stop task if it is paused, when
	changing schedule.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): Handle new set_task_schedule
	return.

2011-10-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_override_iterator): Remove ORDER BY from single
	override case.  Add NVT name column to ordering cases.

2011-10-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_report): Use correct format specifier for end
	time.

2011-10-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_note_iterator): Remove ORDER BY from single note
	case.  Add NVT name column to ordering cases.

2011-10-10  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number.

2011-10-10  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 3.0+beta5 release.

	* CHANGES: Updated.

	* CMakeLists.txt: Update openvas-libraries dependency.

	* INSTALL: Document updated openvas-libraries dependency.

2011-10-06  Henri Doreau <henri.doreau@greenbone.net>

	* src/omp.c (get_nvti_xml, category_name): Move functions to manage.c.

	* src/manage.c (get_nvti_xml, category_name): Added.

	* src/manage.h: Update header accordingly.

2011-10-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_set_setting): Add Password case.

	* src/omp.c (omp_xml_handle_end_element): Add Password to
	CLIENT_MODIFY_SETTING message.

2011-10-05  Henri Doreau <henri.doreau@greenbone.net>

	* src/omp.c (get_nvti_xml): New function, from a refactoring of
	send_nvt().
	(send_nvt): Refactored to export the XML generation part.

	* src/manage.c (manage_read_info): Handle NVT details.

2011-10-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (sql_ctime): Return empty string if epoch_time is 0, as
	0 is the initial state.

2011-10-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (migrate_51_to_52_sql_convert): Cater for empty times.

2011-10-05  Henri Doreau <henri.doreau@greenbone.net>

	* src/schema_formats/XML/OMP.xml (get_nvts): Fix typos.

	* doc/omp.html: Update from source.

2011-10-04  Matthew Mundell <matthew.mundell@greenbone.net>

	Migrate the textual times in the db to seconds since the epoch.  Hence
	increase database version to 52.  Add database migration from version 51
	to 52.

	The migrator assumes that the times in the database are in the current
	timezone.  This allows the sysadmin to set TZ to whatever the Scanner has
	been using.

	From here on the Manager expects the Scanner to send time in UTC, so the
	sysadmin must either explicity arrange this, or use the upcoming
	Scanner revision which forces UTC.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 52.

	* src/manage_sql.c (ctime_strip_newline, sql_ctime, parse_otp_time)
	(manage_migrate_needs_timezone, migrate_51_to_52_sql_convert)
	(migrate_51_to_52): New functions.
	(database_migrators): Add migrate_51_to_52.
	(init_manage_process): Create SQL ctime function.
	(init_manage): Use epoch times in SQL.
	(task_start_time, set_task_start_time, create_report, init_host_iterator)
	(scan_start_time, set_scan_start_time, scan_end_time, set_scan_end_time)
	(set_scan_host_end_time, set_scan_host_start_time, reset_task): Switch to
	epoch times in db.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_end_element): Enable use of user's timezone.

	* src/openvasmd.c (main): Skip setting TZ if required by migrator.

	* doc/db.png: Update for version change.

2011-09-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Turn off last change because
	some of the dates in the database are specific to current timezone.

2011-09-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Set the timezone to the user's
	timezone when authentication succeeds, so that all commands use it.

2011-09-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In the authentication response
	if the timezone is empty send UTC.

2011-09-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_start_element): Init value in MODIFY_SETTING,
	in case the value is empty.

2011-09-28  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP MODIFY_SETTING.

	* src/manage_sql.c (set_setting): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (help_text, command_data_t, client_state_t): Add
	MODIFY_SETTING.
	(modify_setting_data_t): New type.
	(modify_setting_data_reset): New function.
	(modify_setting_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add MODIFY_SETTING handling.

2011-09-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Add support for storing the user's timezone in the db.  Hence increase
	database version to 51.  Add database migration from version 50 to 51.
	Include user timezone and role in the AUTHENTICATE response.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 51.

	* src/manage_sql.c (create_tables): Add timezone to users.
	(migrate_50_to_51): New function.
	(database_migrators): Add migrate_50_to_51.
	(authenticate): Set credentials role and timezone.

	* src/omp.c (omp_xml_handle_end_element): Add ROLE and TIMEZONE to
	AUTHENTICATE response.

	* doc/db_postgres.sql (users): Add timezone.

	* doc/db.png: Update from SQL.

2011-09-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (cvss_threat, prognosis_where_levels): Use the CVSS
	threat mapping from CR 42.

2011-09-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (result_iterator_nvt_cvss_base_double): New function.
	(result_cmp): Include CVSS base in comparison, as this was recently added
	to the init_result_iterator sorting.

2011-09-25  Henri Doreau <henri.doreau@greenbone.net>

	* src/manage.c, src/CMakeLists.txt, CMakeLists.txt: Fix path to the
	SCAP data directory.

2011-09-23  Henri Doreau <henri.doreau@greenbone.net>

	* src/omp.c (get_info_data_t, get_info_data_reset, command_data_t)
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Relocated
	get_info code.

2011-09-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Correct last commit.

2011-09-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Only send observers when the
	user owns the task.

2011-09-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db.png: Really update from SQL.

2011-09-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In all CREATE commands, if user
	is observer respond with an error.

2011-09-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db_postgres.sql (task_users): New table.

	* doc/db.png: Update from SQL.

2011-09-22  Henri Doreau <henri.doreau@greenbone.net>

	* src/schema_formats/XML/OMP.xml (get_info): Rewrapped lines for
	readability.

2011-09-22  Henri Doreau <henri.doreau@greenbone.net>

	* src/schema_formats/XML/OMP.xml (get_info): Relocated get_info
	documentation to honor alphabetical sorting. Rewrapped lines.

	* doc/omp.rnc, doc/omp.html: Update from source.

2011-09-22  Henri Doreau <henri.doreau@greenbone.net>

	* src/schema_formats/XML/OMP.xml (get_info): Document new operation.

	* doc/omp.rnc, doc/omp.html: Update from source.

2011-09-22  Henri Doreau <henri.doreau@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Removed superfluous check,
	the variable cannot be NULL there.

2011-09-22  Henri Doreau <henri.doreau@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Removed a bogus ">" in
	get_info_responses.

2011-09-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* ChangeLog: Correct dates.

2011-09-22  Henri Doreau <henri.doreau@greenbone.net>

	Add new get_info command and support to retrieve CPE and CVE details
	through OMP.

	* src/omp.c (get_info_data_t, get_info_data_reset, command_data_t)
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add get_info command.

	* src/manage.c (get_cpe_filename, get_cve_filename, xsl_transform)
	(manage_read_info): New functions.

	* src/manage.h: Update header accordingly.

	* tools/cpe_getbyname.xsl, tools/cve_getbyname.xsl: New files.

	* CMakeLists.txt: Install cpe_getbyname.xsl and cve_getbyname.xsl.

	* src/CMakeLists.txt: Export path to the SCAP resource directory as a
	preprocessor define.

2011-09-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (actions, user_list): New types.
	(create_task, modify_task, get_configs, get_lsc_credentials, get_nvts)
	(get_targets, get_tasks): Add actions param and OBSERVERS.

	* doc/omp.rnc, doc/omp.html: Update from source.

2011-09-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (create_task_data_t, create_task_data_reset): Add observers.
	(client_state_t): Add CLIENT_CREATE_TASK_OBSERVERS.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add OBSERVERS to CREATE_TASK.

2011-09-21  Matthew Mundell <matthew.mundell@greenbone.net>

	Add task observers.

	* src/omp.c (get_configs_data_t, get_configs_data_reset)
	(get_lsc_credentials_data_t, get_lsc_credentials_data_reset)
	(get_nvts_data_t, get_nvts_data_reset, get_targets_data_t)
	(get_targets_data_reset, get_tasks_data_t, get_tasks_data_reset): Add
	actions.
	(modify_task_data_t, modify_task_data_reset): Add observers.
	(client_state_t): Add CLIENT_MODIFY_TASK_OBSERVERS.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add OBSERVERS to MODIFY_TASK and GET_TASK.  Move
	CLIENT_GET_CONFIGS cleanup_iterator into right position.  Add actions flag
	to GET_TASKS, GET_TARGETS, GET_CONFIGS, GET_LSC_CREDENTIALS and GET_NVTS.

	* src/manage_sql.c (user_t): New type.
	(parse_actions, user_has_access_uuid): New functions.
	(create_tables): Add table task_users.
	(DEF_ACCESS): Move up in file.
	(init_task_user_iterator, task_user_iterator_task)
	(task_user_iterator_user, task_user_iterator_actions)
	(task_user_iterator_name, init_user_task_iterator, task_observers)
	(find_user, set_task_observers, find_task_for_actions)
	(find_report_for_actions, find_target_for_actions)
	(init_user_target_iterator, find_config_for_actions)
	(init_user_config_iterator, find_lsc_credential_for_actions)
	(init_user_lsc_credential_iterator): New functions.
	(init_task_iterator, init_task_iterator, init_config_iterator)
	(init_lsc_credential_iterator): Add actions arg to include other
	users' tasks to which user has given access.  Update callers.
	(report_counts): Count GET accessible tasks.

	* src/manage.h: Update headers appropriately.
	(action_t): New type.

	* src/manage.c: Update iterator init callers.

2011-09-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): Add renaming TODO.

2011-09-19  Michael Wiegand <michael.wiegand@greenbone.net>

	* CMakeLists.txt: Add -D_FILE_OFFSET_BITS=64 to the default flags to
	improve support for large files on 32-bit platforms.

2011-09-15  Matthew Mundell <matthew.mundell@greenbone.net>

	Add host filters to GET_REPORTS for prognostic case.

	* src/manage_sql.c (print_report_xml): Add host filters for prognostic
	report.  Enable multi-host prognostic case.  Update caller.
	(manage_send_report): Add host filters for prognostic report.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (get_reports_data_t, get_reports_data_reset)
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add host
	filters to GET_REPORTS.

2011-09-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): Remove SCAP details from prognostic
	report.

2011-09-15  Matthew Mundell <matthew.mundell@greenbone.net>

	Add single host prognostic reports.

	* src/manage_sql.c (init_prognosis_iterator): Add description and CPE
	name.
	(prognosis_iterator_description, prognosis_iterator_cpe)
	(prognosis_where_search_phrase, prognosis_where_levels)
	(prognosis_where_cvss_base, init_host_prognosis_iterator): New functions.
	(print_report_xml, manage_send_report): Add type "prognosis".

	* src/omp.c (omp_xml_handle_start_element): Add missing min_cvss_base
	attrib for GET_REPORTS.
	(omp_xml_handle_end_element): Add prognostic type to GET_REPORTS.

2011-09-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (sql): Check for SQLITE_LOCKED after sqlite3_prepare.
	After sqlite3_step check if the reset return is BUSY or LOCKED.
	(cleanup_manage_process): Remove DETACH scap.  Seems to result in blocking
	failures in error cases when run in sigabrt.

2011-09-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage_process): Uppercase SQL keyword.
	(cleanup_manage_process): DETACH scap.

2011-09-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): Reluctantly init run_status.

2011-09-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* INSTALL: Typo.

2011-09-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): Add detail for threat of highest
	CVSS.

2011-09-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (scap_loaded): New variable.
	(init_manage_process): Set scap_loaded when SCAP db present.
	(print_report_xml): Only send SCAP data when db present.

2011-09-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (cvss_threat): New function.
	(init_manage_process): Attach SCAP database.
	(DEF_ACCESS): New macro.
	(init_prognosis_iterator, prognosis_iterator_cve)
	(prognosis_iterator_cvss, prognosis_iterator_cvss_int): New functions.
	(print_report_xml): Include SCAP info for each App.

2011-09-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_set_config_name, manage_set_config_comment)
	(manage_set_config_name_comment): New functions.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (modify_config_data_t, modify_config_data_reset)
	(client_state_t): Add comment and name.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add NAME and COMMENT to MODIFY_CONFIG.

2011-09-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (host_report_count): Count only visible finished
	reports belonging to the user.

2011-09-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (get_reports): Add host and pos args.

	* doc/omp.rnc, doc/omp.html: Update from source.

2011-09-05  Matthew Mundell <matthew.mundell@greenbone.net>

	Add host and pos args to GET_REPORTS.

	* src/manage_sql.c (host_last_report_host): Remove for rename.
	(host_nthlast_report_host): New function.  Was host_last_report_host.
	Add pos arg.
	(print_report_xml): Add host and pos host args, for getting single host
	and for specifying which report to use.  Update callers.
	(manage_send_report): Add host and pos host args.

	* src/manage.h: Update header accordingly.

	* src/omp.c (get_reports_data_t, get_reports_data_reset): Add host and
	pos.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add host and
	pos to GET_REPORTS.

2011-09-05  Henri Doreau <henri.doreau@greenbone.net>

	Generate the openvas-scapdata-sync script at compile time, with the
	correct prefix and destination directories.

	* CMakeLists.txt: Updated to generate the sync script.

	* tools/openvas-scapdata-sync.in: (formerly openvas-scapdata-sync).
	Read helper scripts from the correct directory.

2011-09-02  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/report_formats/LaTeX/latex.xsl: Correct two typos in the
	escaping functions which could cause the output to be mangled in case
	a $ or {} was contained in strings the escape_text template was called
	upon. Patch suggested by Andre Heinecke.

2011-09-01  Henri Doreau <henri.doreau@greenbone.net>

	Created a `tools' directory with files required for SCAP data
	management and synchronization.

	* tools/cpe_update.xsl (new): Helper script which generates SQL
	statements to update the SCAP database from CPE entries.

	* tools/cpe_youngerthan.xsl (new): Helper script which filters CPE
	entries younger than a given date.

	* tools/cve_update.xsl (new): Helper script which generates SQL
	statements to update the SCAP database from CVE entries.

	* tools/cve_youngerthan.xsl (new): Helper script which filters CVE
	entries younger than a given date.

	* tools/db_init.sql (new): SCAP database initialization script.

	* tools/greenbone-scapdata-sync (new): SCAP data synchronization
	script for GSF.

	* tools/openvas-scapdata-sync (new): SCAP data synchronization script
	for the OpenVAS feed.

2011-08-18  Matthew Mundell <matthew.mundell@greenbone.net>

	Drop the UNIQUE constraint in task_preferences.  The task name pair is
	what should be unique.  This was segfaulting Manager on the second task
	create.  Hence increase database version to 50.  Add database migration
	from version 49 to 50.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 50.

	* src/manage_sql.c (create_tables): Remove UNIQUE from task_preferences.
	(migrate_49_to_50): New function.
	(database_migrators): Add migrate_49_to_50.

	* doc/db.png: Update for version change.

2011-08-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Adjust the delta filtered counts during the comparison, as is done for
	the page results.

	* src/manage_sql.c (compare_and_buffer_results): Add would_use argument
	to indicate if full filtered report would have used the result.
	(print_report_xml): Adjust orig_f_* counts alongside the f_* counts.
	In the counting after reaching max_results, adjust the orig_f_* counts
	instead of the f_* counts.

2011-08-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): In the delta case for the grand
	total also send the total count of filtered results, instead of the page
	count.

2011-08-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): In the delta case send the total
	count of filtered results, instead of the page count.

2011-08-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (create_task, modify_task)
	(get_tasks): Add preferences.

	* doc/omp.rnc, doc/omp.html: Update from source.

2011-08-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (end_char): New function.
	(manage_max_hosts): Check last char instead of char following hyphen to
	see if a host is a hostname.

2011-08-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Add an error response to CREATE_REPORT for asset reports.  Parse over
	new asset report elements so that the Manager reaches the error.  Add type
	to GET_REPORTS XML REPORT to identify the asset report.

	* src/omp.c (create_report_data_t, create_report_data_reset): Add type
	field.
	(client_state_t): Add asset states for CREATE_REPORT.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Parse type for
	CREATE_REPORT.  Parse over HOST_COUNT and HOSTS in CREATE_REPORT.  Ensure
	that CREATE_REPORT type is scan.

	* src/manage_sql.c (print_report_xml): Add type to asset report.

	* src/schema_formats/XML/OMP.xml (report): Add type attribs.

	* doc/omp.rnc, doc/omp.html: Update from source.

2011-08-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Update with Asset changes.

	* src/schema_formats/XML/OMP.xml (report): Add host_count and hosts.  Add
	missing any on host.
	(get_report): Add type attribute.

	* doc/omp.rnc, doc/omp.html: Update from source.

2011-08-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_REPORTS add check
	on type.

	* src/manage_sql.c (filtered_host_count): Add "scan" to doc.
	(print_report_xml): Add NULL check.
	(manage_report): Require type to be NULL or "scan".
	(manage_send_report): Add full type check.

2011-08-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_asset_iterator, print_report_xml): Cleanup
	indenting after rename.

2011-08-10  Matthew Mundell <matthew.mundell@greenbone.net>

	Use "assets" in naming instead of "inventory".

	* src/manage_sql.c (init_inventory_iterator)
	(inventory_iterator_ip): Rename.  Update callers.
	(init_asset_iterator, asset_iterator_ip): New functions.  Renamed
	from "inventory".
	(print_report_xml, manage_send_report): Rename "inventory" report type to
	"assets".

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_REPORTS rename
	"inventory" report type to "assets".

2011-08-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_inventory_iterator, filtered_host_count)
	(host_last_report_host): Only consider results of tasks owned by the user
	making the request.  Remove hacks to exclude example task, as it has a
	null user.

2011-08-10  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch the host of the example result to an IP.  Hence increase
	database version to 49.  Add database migration from version 48 to 49.
	In the migrator also ensure that the result has the right UUID.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 49.

	* src/manage_sql.c (migrate_48_to_49): New function.
	(database_migrators): Add migrate_48_to_49.
	(init_manage): Replace "localhost" with "127.0.0.1" in example result and
	result_host.

	* doc/db.png: Update for version change.

2011-08-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (filtered_host_count): Add the finished report
	and trashcan checks to the "all hosts" case.

2011-08-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_inventory_iterator, filtered_host_count)
	(host_last_report_host): Only consider finished scans.

2011-08-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_inventory_iterator, filtered_host_count)
	(host_last_report_host): Skip reports on tasks that are in the trashcan.

2011-08-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_inventory_iterator, filtered_host_count): Add
	missing search_phrase length checks.

2011-08-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_inventory_iterator, filtered_host_count): Add CPE
	and port number to text phrase filtering.

2011-08-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_inventory_iterator, filtered_host_count): Add
	OS to text phrase filtering.

2011-08-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_tables): Add index report_hosts_by_host.
	(init_inventory_iterator, filtered_host_count): Add hostname to text
	phrase filtering.

2011-08-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_inventory_iterator, filtered_host_count): Add
	search_phrase arg.
	(print_report_xml): Pass search phrase to init_inventory_iterator and
	filtered_host_count.

2011-08-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_inventory_iterator): Add levels arg.
	(filtered_host_count): New function.
	(print_report_xml): Pass levels to init_inventory_iterator.  Do filtered
	count with filtered_host_count.

2011-08-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_inventory_iterator): Add first_result and
	max_results args.
	(host_count): New template.
	(print_report_xml): Add HOST_COUNT and HOSTS to REPORT.  Pass first and
	max to init_inventory_iterator.

2011-08-03  Matthew Mundell <matthew.mundell@greenbone.net>

	Add database migrator, from version 47 to 48, in order to change "app"
	host details to "App".

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 48.

	* src/manage_sql.c (migrate_47_to_48): New function.
	(database_migrators): Add migrate_47_to_48.

	* doc/db.png: Update for version change.

2011-08-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): Skip the example task host in the
	inventory.

2011-08-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (where_search_phrase): Add host.

2011-08-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): Count inventory results by host.

2011-08-01  Matthew Mundell <matthew.mundell@greenbone.net>

	Add a basic host inventory, as a new type of GET_REPORT report.

	* src/manage_sql.c (report_host_t): Remove.  To manage.h.
	(init_host_iterator): Add report_host arg, to iterate over single
	report_host.  Update callers.
	(host_iterator_report, host_iterator_report_uuid, init_inventory_iterator)
	(inventory_iterator_ip, host_last_report_host, host_report_count): New
	functions.
	(print_report_xml): Add type arg for type of report.  Include entire host
	inventory when type is inventory, using existing OMP entities.
	(manage_report, manage_send_report): Add type arg.

	* src/manage.h: Update headers accordingly.
	(report_host_t): New type.  From manage_sql.c.

	* src/manage.c (send_user_rules): Update init_host_iterator callers.

	* src/omp.c (get_reports_data_t, get_reports_data_reset): Add type.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add type to
	GET_REPORTS.  Add case for "inventory" type.

2011-07-21  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number.

2011-07-21  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 3.0+beta4 release.

	* CHANGES: Updated.

2011-07-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db_postgres.sql (task_preferences): New table.

	* doc/db.png: Update from SQL.

2011-07-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Move scan performance parameters max_checks and max_hosts from configs
	to tasks.  Hence increase database version to 47.  Add database migration
	from version 46 to 47.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 47.

	* src/manage_sql.c (create_tables): Add table task_preferences.
	(migrate_46_to_47): New function.
	(database_migrators): Add migrate_46_to_47.
	(request_delete_task_uuid, delete_task, delete_trash_tasks): Remove task
	preferences too.
	(init_otp_pref_iterator, init_nvt_preference_iterator): Skip performance
	prefs.
	(init_task_preference_iterator, task_preference_iterator_name)
	(task_preference_iterator_value, task_preference_iterator_task_value)
	(task_preference_value, set_task_preferences): New functions.
	(name_value_t): New type.

	* src/manage.h: Add headers accordingly.

	* src/manage.c (send_task_preferences): New function.
	(run_task): Send task preferences.

	* src/omp.c (name_value_t): New type.
	(create_task_data_t, create_task_data_reset, modify_task_data_t)
	(modify_task_data_reset): Add preferences.
	(client_state_t): Add preference states.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add preference setting to MODIFY_TASK and
	CREATE_TASK.  Send task preferences in GET_TASKS.

2011-07-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_result_iterator): Add CVSS to sorting.

2011-07-11  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/manage_sql.c: Change value of MAX_CONTENT_LENGTH from 2000 to
	20000.

2011-06-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_report_data_t): Add field "wrapper".
	(omp_xml_handle_start_element): In CLIENT_CREATE_REPORT if REPORT contains
	a format_id attribute then treat it as the usual wrapper report, otherwise
	treat it as the embedded report that should be in the wrapper.
	(omp_xml_handle_end_element): In CLIENT_CREATE_REPORT_RR set the state
	depending on the wrapper flag.

2011-06-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (_GNU_SOURCE): New define.  For strcasestr.
	(report_counts_match): Check the search string case sensitively, as done
	by the iterator which generates the results.  Also search for the string
	in the port and NVT.

2011-06-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Add report 2 result notes and overrides to GET_RESULTS delta case.

	* src/manage_sql.c (compare_and_buffer_results): Always pass the delta
	results to buffer_results_xml, letting the new changed arg indicate a
	changed result.
	(print_report_xml): Update buffer_results_xml calls.

	* src/omp.c (buffer_result_notes_xml, buffer_result_overrides_xml): New
	functions.
	(buffer_results_xml): Add changed arg.  Include delta DIFF when arg set.
	Print delta notes and overrides too, if requested.  Update callers.

2011-06-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_report): Allow NULL host end times, as this
	can happen, for example if the task is stopped.

	* src/omp.c (omp_xml_handle_end_element): Remove host end assertion from
	CLIENT_CREATE_REPORT_RR_HOST_END case.

2011-06-24  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number.

2011-06-24  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 3.0+beta3 release.

	* CHANGES: Updated.

2011-06-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_result_iterator): Apply overrides in the result
	only case, if requested.

2011-06-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (strdiff): Set LANGUAGE and LC_ALL to C around diff
	call, so that missing line break messages are in English.

2011-06-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (buffer_results_xml): Convert delta description newlines too.

2011-06-20  Matthew Mundell <matthew.mundell@greenbone.net>

	Include scan start and end times in report import.

	* src/omp.c (create_report_data_t, create_report_data_reset): Add
	scan_start and scan_end.
	(omp_xml_handle_start_element): Pass scan start and end times to
	create_report.
	(omp_xml_handle_text): Read scan start and end.

	* src/manage_sql.c (create_report): Add scan_start and scan_end args.  Set
	times on report.

	* src/manage.h: Update header accordingly.

2011-06-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (strdiff): New function.  Compare texts with the diff command.
	(buffer_results_xml): Add a "diff" of the result descriptions when there's
	a delta result.

2011-06-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (buffer_results_xml): Add delta_results arg.  If given print
	delta RESULT inside DELTA.  Update callers.

	* src/manage_sql.c (compare_and_buffer_results): Pass delta_results to
	buffer_results_xml in "changed" case.

2011-06-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): Add run status and times to
	REPORT/DELTA/REPORT.

2011-06-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_host_ports_desc, print_host_ports_by_type): Free
	array afterwards.

2011-06-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_host_ports_desc)
	(print_host_ports_by_type_desc, print_host_ports_by_type_asc): New
	functions.
	(print_host_ports_by_type): Add ascending flag.
	(print_report_xml): Ensure that the port list is sorted in the right
	order.

2011-06-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (array_add_port, compare_ports_threat)
	(print_host_ports_by_type): New functions.
	(print_report_xml): Ensure that the port list is sorted by the right
	field.

2011-06-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (add_port, print_host_port, print_host_ports)
	(free_host_ports): New functions.
	(print_report_xml): For the port list, separate the delta and normal
	cases, accumulating the delta ports during the result comparisons.

2011-06-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (compare_and_buffer_results): Skip actual buffering
	if buffer is NULL.
	(print_report_xml): Skip full counts if delta.  Add count decreasing when
	there are extra results in 'results'.  Iterate through the remaining
	results after hitting the page max, to get the filtered counts right.

2011-06-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (compare_and_buffer_results): Take into account the
	filter arguments, when setting "used".
	(print_report_xml): If the result was skipped, then adjust the result
	counts.  Ditto if the delta result was used instead of the report result.

2011-06-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (compare_and_buffer_results): Add used flag.  Set when
	buffering result.
	(print_report_xml): Only add the result_hosts_only host when the result
	was actually printed.

2011-06-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (compare_and_buffer_results): Add more tracing.
	(print_report_xml): When printing the hosts, check the second report if
	the host is missing from the first report.

2011-06-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (compare_and_buffer_results): Add first_results arg,
	decrement and skip result if positive.
	(print_report_xml): In the delta case, always get the first result in the
	report, and skip output of results up to the requested first_result.

2011-06-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (compare_and_buffer_results): Add max_results arg,
	decrement when buffering the result.
	(print_report_xml): Remove done sorting todo.  Select all the results in
	the delta case.  Limit to max_results results explicitly, while comparing.
	This ensures there are always enough results to do the comparison.

2011-06-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (result_cmp): Remove description comparisons.
	(compare_results): Remove the changed/same comparison and make the
	changed/same depend entirely on the description.  Now results are
	identified only by their position in the selection, so some changed
	results may appear to be new-gone pairs, however more results should
	appear as changed when just the description changes.

2011-06-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (result_cmp): Invert comparison returns with arithmetic
	instead of logical negation, because the returns are arithmetic.

2011-06-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): In the delta case add the host
	to result_hosts according to the delta state of the result.

2011-06-08  Matthew Mundell <matthew.mundell@greenbone.net>

	Improve the delta comparison.

	* src/manage_sql.c (init_result_iterator): Add sorting by NVT so that
	delta selections are comparable.  Add description sorting to host case.
	(result_greater): Remove.  Rename to result_cmp.
	(result_cmp): New function.  Was result_greater.  Improve doc slightly.
	Add descriptor and NVT to comparison.  Add tracing.
	(compare_results): Add tracing.  Correct result_cmp return checks.
	(print_report_xml): Add delta tracing.

2011-06-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_result_iterator): Add sorting by description so
	that delta selections are comparable.

2011-06-08  Henri Doreau <henri.doreau@greenbone.net>

	* src/manage_sql.c (setup_full_config_prefs): Added network_scan to
	the list of scanner preferences.

2011-06-07  Matthew Mundell <matthew.mundell@greenbone.net>

	Add container task report imports.

	* src/omp.c (create_report_data_t, create_report_data_reset): Add task_id.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add attrib
	task_id to CREATE_REPORT.

	* src/manage_sql.c (create_report): Add task_id arg, if given import into
	this task.

	* src/manage.h: Update header accordingly.

2011-06-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Add delta state filtering to delta reports.

	* src/omp.c (get_reports_data_t, get_reports_data_reset): Add delta_states.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add attrib
	delta_states to GET_REPORTS.

	* src/manage_sql.c (compare_and_buffer_results): Add delta state args.
	Only print result if state is selected.
	(print_report_xml): Filter results according to new delta_states param.
	Update callers.

	* src/manage.h: Update header accordingly.

2011-05-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): Move the result count printing to
	follow the result printing.  Adjust the result counts for new results
	during delta result printing.

2011-05-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (result_greater): New function.
	(compare_results): Add sorting args.  Compare new and gone results
	better.
	(compare_and_buffer_results): Add sorting args.
	(print_report_xml): In the delta case store the iteration state in
	temporary variables, because the "done" field refers to the next
	iteration.  Also print all the extra 'results' results, instead of just
	the first.  Pass sort fields to compare_and_buffer_results.

2011-05-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (escalate_2): Correct doc.
	(compare_results, compare_and_buffer_results): Add doc.
	(create_lsc_credential): Doc all args.

2011-05-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Add very basic delta reporting.

	* src/manage_sql.c (compare_results_t): New type.
	(compare_results, compare_and_buffer_results): New functions.
	(print_report_xml): Add delta arg.  If given print delta results.  Update
	callers.
	(manage_send_report): Add delta_report arg.  Pass through to
	print_report_xml.

	* src/manage.h: Update header accordingly.

	* src/omp.c (get_reports_data_t, get_reports_data_reset): Add
	delta_report_id.
	(omp_xml_handle_start_element): Parse delta_report_id.
	(buffer_results_xml): Add delta arg.  Append to result if given.
	(omp_xml_handle_end_element): In GET_REPORTS pass delta report to
	manage_send_report.

2011-05-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_report): Wait on the child PID, just to be
	sure.

2011-05-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_send_report): Wait on the child PID, just to be
	sure.

2011-05-24  Matthew Mundell <matthew.mundell@greenbone.net>

	Quiet compiler warnings.  Thanks to Stephan Kleine for original patch.

	* src/manage_sql.c (manage_report, manage_send_report): Remove old
	variable.
	(months_between): Remove stray variable.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_MODIFY_TASK remove
	variable "first" which is only used by an assertion.

2011-05-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (nvts_size, family_nvt_count, family_nvt_count): Count
	over the "Credentials" family.
	(make_nvt_from_nvti): Remove "Credentials" exclusion, because the NVTs
	need to be in the db for the results they generate.
	(init_family_iterator): Exclude the "Credentials" family.

2011-05-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (email): Add support for a single attachment.
	(REPORT_ATTACH_FORMAT, MAX_ATTACH_LENGTH): New defines.
	(escalate_2): Add a third notice value for attaching the report.

2011-05-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (trim_whitespace): Remove.  Rename to trim_hosts.
	(trim_hosts): New function.  Was trim_whitespace.

2011-05-19  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number.

2011-05-19  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 3.0+beta2 release.

	* CHANGES: Updated.

2011-05-18  Matthew Mundell <matthew.mundell@greenbone.net>

	Add database migrator from version 45 to new version 46, to ensure that
	the target hosts fields are clean.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 46.

	* src/manage_sql.c (sql_clean_hosts, migrate_45_to_46): New functions.
	(database_migrators): Add migrate_45_to_46.
	(init_manage_process): Add SQL function clean_hosts.

	* doc/db.png: Update for version change.

2011-05-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (trim_whitespace, clean_hosts): New functions.
	(create_target): Clean the hosts string before quoting it.

2011-05-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (omp_xml_handle_end_element): In CLIENT_GET_ESCALATORS
	correct order of init_escalator_data_iterator args.  This was preventing
	the event data from being sent to clients.

2011-05-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): Add full count as text, to preserve
	compatibility with OMP 1.  Some of the report formats use this value.

	* src/schema_formats/XML/OMP.xml (report): Add result_count text.

	* doc/omp.rnc, doc/omp.html: Update from source.

2011-05-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_restore): Add owner clauses to name checks, as
	other users may have resources with the same name.

2011-05-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_lsc_credential): Remove stray punctuation.

2011-05-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_report, manage_send_report): Clear parent state
	in child.

2011-05-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (escalate_2): In ESCALATOR_METHOD_EMAIL if the
	escalator is missing a "notice_report_format" method data, then use TXT.
	This can happen for escalators that predate the notice_report_format.

2011-05-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (test_escalator): Correct attrib name.

	* doc/omp.rnc, doc/omp.html: Update from source.

2011-05-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_report): Revert single transaction, as this
	causes problems on Debian 5.

2011-05-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (task_upload_progress): Correct count format specifier.

2011-05-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (get_report_formats): Add SIGNATURE.

	* doc/omp.rnc, doc/omp.html: Update from source.

2011-05-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_report): Insert results within a single
	transaction.

2011-05-05  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number.

2011-05-05  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 3.0+beta1 release.

	* CMakeLists.txt: Updated version number.

	* CHANGES: Updated.

2011-05-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/escalator_methods/Sourcefire/escalate: Simplify the script call.

2011-05-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (send_to_sourcefire): Add .csv suffix to report.

	* src/escalator_methods/Sourcefire/escalate: Copy the connector script
	to the report directory, and call it there.  Remove the csvfile param.

2011-05-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (get_reports): Add escalator_id attrib.
	(create_lsc_credential): Add KEY.

	* doc/omp.rnc, doc/omp.html: Update from source.

2011-05-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (email): Put the To address in the sendmail command
	instead of the From address.

2011-05-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (send_to_sourcefire): Expect pkcs12 in base64.

2011-05-03  Matthew Mundell <matthew.mundell@greenbone.net>

	Add report upload progress to GET_TASKS.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 45.

	* src/manage_sql.c (create_tables): Add upload_result_count to tasks.
	(migrate_44_to_45): New function.
	(database_migrators): Add migrate_44_to_45.
	(task_upload_progress): New function.
	(create_report): Init task upload_result_count.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_TASKS set progress
	to upload progress if there's an upload happening.

	* doc/db_postgres.sql (tasks): Add upload_result_count.

	* doc/db.png: Update from SQL.

2011-05-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_send_report): Remove transaction from escalator
	case, as caller does transaction.
	(manage_restore): Correct escalator SQL, so that escalator data is
	restored too.

2011-05-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_REPORTS simplify
	the response in the escalator case.

2011-04-25  Matthew Mundell <matthew.mundell@greenbone.net>

	Add an escalation option to GET_REPORTS.

	* src/manage_sql.c (escalate_2): Add report param.  Update callers.
	(manage_send_report): Add escalator_id param.  If given escalate report
	instead of getting it.

	* src/manage.h: Update header accordingly.

	* src/omp.c (get_reports_data_t, get_reports_data_reset): Add
	escalator_id.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add
	escalator_id attribute to GET_REPORTS.

2011-04-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (escalate_2): New function.  Body from escalate_1, with
	report filtering args.
	(escalate_1): Call through to escalate_2.

2011-04-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_report): Fork a child to do the upload.

2011-04-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_report): Insert the start times before the
	results, so that the host list is present in GET_REPORTS with the
	results during the upload.

2011-04-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (send_to_sourcefire): Remove user change from script
	call, as script is managed by sysadmin for now.

2011-04-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_report, manage_send_report): Drop privileges
	directly instead of with su via the shell.

2011-04-22  Matthew Mundell <matthew.mundell@greenbone.net>

	Remove admission of the "Credentials" family, handling the communication
	with the Scanner about the credentials automatically according to the
	task's credentials.

	* src/manage.c (run_task): Enable auth plugins when credentials are
	present.

	* src/manage_sql.c (make_nvt_from_nvti): Skip NVTs in the "Credentials"
	family.

	* src/otp.c (parse_scanner_preference_value): Only add the preference when
	current_scanner_preference is set.
	(process_otp_scanner_input): In SCANNER_PREFERENCE_NAME prevent adding the
	preferences of the "Credentials" family NVTs.

2011-04-22  Stephan Kleine

	* CMakeLists.txt: Fix formatting.

2011-04-22  Stephan Kleine

	* CMakeLists.txt: Fix installation with DESTDIR.

2011-04-22  Matthew Mundell <matthew.mundell@greenbone.net>

	Extend CREATE_LSC_CREDENTIAL with a key pair option.

	* src/manage_sql.c (create_lsc_credential): Add key args.

	* src/manage.h: Update header accordingly.

	* src/omp.c (create_lsc_credential_data_t)
	(create_lsc_credential_data_reset, client_state_t): Add key elements.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add KEY to CREATE_LSC_CREDENTIAL.

2011-04-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/escalator_methods/Sourcefire/escalate: New file from last commit.

2011-04-21  Matthew Mundell <matthew.mundell@greenbone.net>

	Add a Sourcefire Connector escalator.

	* CMakeLists.txt: Install escalator script.

	* src/manage.c (escalator_method_name, escalator_method_from_name): Add
	Sourcefire method.

	* src/manage.h (escalator_method_t): Add Sourcefire method.

	* src/manage_sql.c (send_to_sourcefire): New function.
	(escalate_1): Add Sourcefire method.

	* src/escalator_methods/Sourcefire/,
	src/escalator_methods/Sourcefire/escalate: New dir and file.

	* INSTALL: Add escalator program to requirements.

2011-04-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (run_tasks): Send target hosts in "network_targets"
	preferences.

	* src/manage_sql.c (init_nvt_preference_iterator): Skip "network_targets".

2011-04-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage_process): Check stat return in permission
	check.

2011-04-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_REPORT_FORMATS
	use constant for PREDEFINED for trashcan formats.

2011-04-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_report_format): Free format_signature after
	last use.

2011-04-15  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/manage_sql.c (manage_report, manage_send_report, copy_config)
	(manage_set_config_nvts): Closed memleaks reported by cppcheck.

2011-04-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_report, manage_send_report): Allow predefined
	formats always.

	* src/omp.c (omp_xml_handle_start_element, omp_xml_handle_end_element)
	(client_state_t): Add PREDEFINED to REPORT_FORMAT in OMP
	GET_REPORT_FORMATS and CREATE_REPORT_FORMAT.  In OMP GET_REPORT_FORMATS
	allow predefined formats always.

	* src/schema_formats/XML/OMP.xml (get_report_formats): Add PREDEFINED.

	* doc/omp.rnc, doc/omp.html: Update from source.

2011-04-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_report_format): Fail if format is predefined.
	(report_format_predefined): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_REPORTS remove
	erroneous case and add predefined case.

2011-04-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_report, manage_send_report): Accept only
	trusted report formats.
	(report_format_trust): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_REPORTS check
	report format trust.

2011-04-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* CMakeLists.txt: Create the user report_formats directory, so that it's
	world readable, for nobody.  Make the predefined report formats world
	readable, for nobody.

	* src/manage_sql.c (manage_report, manage_send_report): Drop to nobody
	within the spawned command when running as root.  This prevents the report
	formats from having root access.
	(create_report_format): Ensure that nobody can access the installed report
	formats.

2011-04-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage_process): Reduce permissions if they are
	too loose.

2011-04-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage_process): Warn if permissions are loose.

2011-04-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Add database migrator from version 43 to new version 44, to ensure that
	the database file permissions are tight.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 44.

	* src/manage_sql.c (migrate_43_to_44): New function.
	(database_migrators): Add migrate_43_to_44.

	* doc/db.png: Update for version change.

2011-04-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (main): Set very restrictive umask.

2011-04-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otp.c (append_log_message): Detect special host details messages by
	port instead of description.

2011-04-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db_postgres.sql (report_formats): Revert the uuid UNIQUE constraint.
	The Manager refuses to create a report with a duplicate UUID.

	* doc/db.png: Update from SQL.

2011-04-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (config_writable): Check whether the count is zero.

2011-04-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (report): Add HOST.

	* doc/omp.rnc, doc/omp.html: Update from source.

2011-04-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (migrate_42_to_43): Ensure that targets_trash exists.

2011-04-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Add TARGET to TASK in element REPORT.
	Add PORT to SSH_LSC_CREDENTIAL in CREATE_TARGET and GET_TARGETS.

	* doc/omp.rnc, doc/omp.html: Update from source.

2011-04-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/CMakeLists.txt (omp.rnc, omp.html): Put the generate command
	directly in the shell command, because passing args to "." is a bashism.

	* src/schema_formats/XML/OMP.xml: Add GET_CONFIGS "export" attribute.

	* doc/omp.rnc, doc/omp.html: Update from source.

2011-04-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (report_type_iterator_name)
	(report_type_iterator_title): Doc return.

	* src/manage_sql.c: Add missing docs and return docs.

2011-04-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In the CLIENT_GET_TASKS brief
	case get the target hosts from the right place.

2011-04-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (trash_target_name): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In the CLIENT_GET_TASKS brief
	case get the name and UUID or the target from the trashcan when
	appropriate.

2011-04-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* ChangeLog: Clear tabs out of text.

2011-04-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): Add the target to the task, so that
	clients can see if the task is a container task.
	(trash_target_uuid): New function.

	* src/manage.h: Add header accordingly.

2011-04-07  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* doc/openvasmd.8.xml: Fixed typo.

	* doc/openvasmd.html, doc/openvasmd.8: Regenerated.

2011-04-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (migrate_42_to_43): Replace ref to missing define with
	fixed value.

2011-04-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db_postgres.sql (targets): Add ssh_port.
	(report_host_details): New table.

	* doc/db.png: Update from SQL.

2011-04-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (validate_port): Ensure port is within range.

2011-04-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_target, manage_restore): Add missing comma in
	SSH port SQL.

2011-04-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_target): Only set the SSH port when there is a
	credential.

2011-04-06  Matthew Mundell <matthew.mundell@greenbone.net>

	Add LSC SSH ports to targets, including sending the new auth_port_ssh
	Scanner preference.  Hence increase database version to 43.  Add database
	migration from version 42 to 43.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 43.

	* src/manage_sql.c (create_tables): Add ssh_port to target tables.
	(migrate_42_to_43): New function.
	(database_migrators): Add migrate_42_to_43.
	(validate_port): New function.
	(create_target): Add ssh_port arg.
	(delete_target): Add ssh_port field.
	(init_target_iterator): Add ssh_port.
	(target_iterator_ssh_port): New function.  Increment other accessors
	accordingly.
	(target_ssh_port): New function.

	* src/manage.c (run_task): Send SSH port to Scanner.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (create_target_data_t, create_target_data_reset)
	(client_state_t): Add SSH port.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add SSH_LSC_CREDENTIAL/PORT handling to
	CREATE_TARGET.  Add SSH port to target in GET_TARGETS.

2011-04-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (config_writable): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_CONFIGS add
	WRITABLE flag, like IN_USE but includes trashcan tasks.

	* src/schema_formats/XML/OMP.xml: Add WRITABLE in GET_CONFIGS response.

	* doc/omp.rnc, doc/omp.html: Update from source.

2011-04-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_start_element)
	(omp_xml_handle_end_element): Read over children of OVERRIDES and NOTES in
	RESULT during a CREATE_REPORT.

2011-03-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_report_host_detail): Correct name in doc.

2011-03-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db_postgres.sql (report_formats): Remove the uuid UNIQUE constraint
	because multiple users can upload the same report format.

	* doc/db.png: Update from SQL.

2011-03-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (report): New element.  From get_reports
	command.
	(create_report): New command.
	(get_reports): Use the new report element as a type.

	* doc/omp.rnc, doc/omp.html: Update from source.

2011-03-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (migrate_37_to_38): Use "mv" to do the move, because
	"rename" requires the dirs to be on the same file system.

2011-03-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_MODIFY_TASK restrict
	modification of container tasks, and init task for find_task.

2011-03-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_START_TASK if target
	is missing return an error, as this can happen for report container tasks.
	Swap comments at same time.

2011-03-29  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP command CREATE_REPORT.

	* src/manage_sql.c (create_current_report): New name for create_report.
	(create_report): New function.  Creates report from result list.

	* src/manage.h: Add header accordingly.
	(create_report_result_t): New type.

	* src/manage_sql.h: Update header accordingly.

	* src/manage.c (run_task): Rename create_report call.

	* src/omp.c (help_text): Add new command.
	(omp_parser_t): Add read_over flag.
	(omp_parser_new): Init read_over.
	(create_report_data_t): New type.
	(create_report_data_reset): New function.
	(command_data_t, client_state_t): Add new command elements.
	(create_report_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Read over element if parser flag set.  Add
	CREATE_REPORT handling.
	(buffer_results_xml): Only print notes and overrides if there's a task.

2011-03-28  Michael Wiegand <michael.wiegand@greenbone.net>

	* report_formats/sourcefire/create_report_import: Create a signature
	when creating report import.

2011-03-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (find_report_format): Add a user check to the
	constraint XML because multiple users can import the same report format.

2011-03-18  Matthew Mundell <matthew.mundell@greenbone.net>

	Add support for Scanner generated report host details.

	* src/otp.c (append_log_message): If the description starts with '<' then
	add the host detail in the description.

	* src/manage_sql.c (report_host_t): New type.
	(create_tables): Add table report_host_details.
	(init_host_iterator): Add ROWID.  Increment accessors accordingly.
	(host_iterator_report_host, init_report_host_details_iterator)
	(report_host_details_iterator_name, report_host_details_iterator_value)
	(report_host_details_iterator_source_type)
	(report_host_details_iterator_source_name)
	(report_host_details_iterator_source_desc): New functions.
	(delete_report, trim_report, trim_partial_report): Handle details too.
	(print_report_xml): Add HOST with details to REPORT.
	(manage_report_host_detail): New function.

	* src/manage.h: Add header accordingly.

2011-03-16  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/manage_sql.c (setup_full_config_prefs): Remove setting of the
	obsolete and unused legacy preferences "ping_hosts" and "language".

2011-03-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_TASKS account for
	trash tasks in counts.

2011-03-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (task_count): Exclude trashcan tasks.
	(trash_task_count): New function.

	* src/manage.h: Add header accordingly.

2011-03-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_task_iterator): Correct test in last commit for
	the all case.

2011-03-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_task_iterator): Include the hidden tasks as
	before to enable access to the example task.

2011-03-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Add new trashcan commands EMPTY_TRASHCAN
	and RESTORE.  Update DELETE and GET commands with trashcan flags.

	* doc/omp.rnc, doc/omp.html: Update from source.

2011-03-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_config, delete_schedule): Correct arg in doc.
	(delete_trash_tasks): Remove arg from doc.

2011-03-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db_postgres.sql (targets, targets_trash): Add port_range field that
	appeared in db version 36.

	* doc/db.png: Update from SQL.

2011-03-15  Matthew Mundell <matthew.mundell@greenbone.net>

	Update database diagram for trashcan.

	* doc/db_postgres.sql (agents_trash, escalator_condition_data_trash)
	(escalator_event_data_trash, escalator_method_data_trash)
	(escalators_trash, targets_trash, configs_trash, config_preferences_trash)
	(report_format_params_trash, report_format_param_options_trash)
	(report_formats_trash, lsc_credentials_trash, schedules_trash)
	(slaves_trash): New tables.
	(tasks, task_escalators): Add location fields.

	* doc/db.png: Update from SQL.

2011-03-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (trash_config_family_count, trash_config_nvt_count)
	(trash_slave_uuid, trash_slave_name): New functions.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_REPORT_FORMATS
	pass the trash flag to init_report_format_param_iterator instead of 0.  In
	CLIENT_GET_CONFIGS get the counts for the trash config if required, and
	refuse to serve the task list for the trashcan.  In CLIENT_GET_SLAVES
	correct an error message.  In CLIENT_GET_TARGETS refuse to serve trash
	with tasks.  In CLIENT_GET_TASKS refuse to serve trash and details, and
	get the slave info from trash if required.

2011-03-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_lsc_credential): Remove attempt at location
	check from "in use" test.  The credential of a target can only be in the
	trash when the target is in the trash.

2011-03-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_report_format): Put trash report formats in
	DATA dir instead of SYSCONF dir.
	(manage_restore): Restore report formats from DATA dir to DATA or STATE
	dir.

2011-03-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (task_in_trash): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (buffer_notes_xml, buffer_overrides_xml): Add TRASH flag to
	TASK.

2011-03-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Add a trashcan, including new OMP commands EMPTY_TRASHCAN and RESTORE.
	Hence increase database version to 42.  Add database migration from
	version 41 to 42.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 42.

	* src/manage_sql.c (resource_t): New type.
	(LOCATION_TABLE, LOCATION_TRASH): New defines.
	(user_owns_trash_uuid, find_trash): New functions.
	(create_tables): Add trash tables.  Add trash location columns to tables
	task_escalators and tasks.
	(migrate_41_to_42): New function.
	(database_migrators): Add migrate_41_to_42.
	(delete_escalator, delete_task, delete_target, delete_config)
	(delete_lsc_credential, delete_agent, delete_schedule)
	(delete_report_format, delete_slave): Add ultimate flag param.  Update callers.
	(init_escalator_iterator, init_escalator_data_iterator)
	(init_task_iterator, init_target_iterator, init_config_iterator)
	(init_lsc_credential_iterator, init_agent_iterator, init_schedule_iterator)
	(init_report_format_iterator, init_report_format_param_iterator)
	(init_slave_iterator): Add trash flag param.  Update callers.
	(init_manage, set_task_requested, delete_report): Add
	TASK_STATUS_DELETE_ULTIMATE_REQUESTED cases.
	(task_config_uuid, task_config_name): Add trash check.
	(task_config_in_trash, task_target_in_trash, task_slave_in_trash)
	(task_escalator_in_trash, task_schedule_in_trash): New functions.
	(add_task_escalator, set_task_escalator): Set location field.
	(request_delete_task): Call delete_task_lock instead of delete_task.
	(request_delete_task_uuid): New function.  Allows OMP DELETE_TASK to pass
	UUID.
	(delete_task_lock): New function.  Calls delete_task inside transaction.
	(delete_trash_tasks, find_trash_task): New functions.
	(find_task): Exclude trash tasks.
	(target_iterator_ssh_trash, target_iterator_smb_trash, trash_target_hosts)
	(trash_target_in_use, trash_config_in_use, trash_lsc_credential_uuid)
	(trash_lsc_credential_name, report_format_trash_global)
	(trash_slave_in_use): New functions.
	(target_in_use, init_schedule_task_iterator, slave_in_use): Take trash
	resources into account.
	(manage_restore, manage_empty_trashcan): New functions.  Trashcan
	specific.

	* src/manage.c: Update iterator calls.
	(run_status_name, run_slave_task, manage_check_current_task): Add
	TASK_STATUS_DELETE_ULTIMATE_REQUESTED case.

	* src/manage.h: Update headers accordingly.
	(task_status_t): Add TASK_STATUS_DELETE_ULTIMATE_REQUESTED.

	* src/omp.c (help_text): Add trashcan commands.
	(delete_agent_data_t, delete_escalator_data_t)
	(delete_lsc_credential_data_t, delete_report_format_data_t)
	(delete_schedule_data_t, delete_slave_data_t, delete_target_data_t)
	(delete_task_data_t): Add ultimate flag.
	(get_agents_data_t, get_configs_data_t, get_escalators_data_t)
	(get_lsc_credentials_data_t, get_report_formats_data_t)
	(get_schedules_data_t, get_targets_data_t, get_tasks_data_t): Add trash
	flag.
	(restore_data_t): New types.
	(restore_data_reset, restore_data_reset): New functions.
	(command_data_t): Add restore field.
	(restore_data): New variable.
	(client_state_t): Add states for trashcan commands.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add trashcan
	command handling.  Add ultimate handling to DELETE commands.  Add trash
	handling to GET commands.

	* src/otp.c (process_otp_scanner_input): In SCANNER_TIME_SCAN_END add
	STATUS_DELETE_ULTIMATE_REQUESTED case and call delete_task_lock instead
	of delete_task.

2011-03-09  Michael Wiegand <michael.wiegand@greenbone.net>

	Post branch version bump.

	* CMakeLists.txt: Updated version number.

2011-03-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_lsc_credential)
	(init_lsc_credential_iterator): Check both credentials in targets.

2011-03-02  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number.

2011-03-02  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 2.0.2 release.

	* CHANGES: Updated.

2011-02-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (migrate_21_to_22): Keep going if it's a predefined
	format and the old directory is missing.

2011-02-24  Matthew Mundell <matthew.mundell@greenbone.net>

	Close some leaks found by Felix Wolfsteller.

	* src/manage_sql.c (PRINT): Close stream.
	(print_report_xml): Note about leaks.
	(create_target, create_agent): Free quoted_name before returning on error.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_TASKS free
	first_report.

2011-02-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/lsc_user.c (create_nsis_script): Compare fopen return to NULL
	instead of an integer.  From Felix Wolfsteller.

2011-02-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Correct the host counting change from 2011-02-19, which overlooked many
	cases.  Add test manage_max_hosts_0 to test the basic cases.

	* src/manage_sql.c (manage_max_hosts): Replace the initial hostname check
	with similar checks on each host, done after the list is split into host.

	* src/tests/CMakeLists.txt: Add test manage_max_hosts_0.

	* src/tests/manage_max_hosts_0.c: New file.

2011-02-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.c, src/tests/common.h,
	src/tests/make_report_uuid_0.c: Correct include locations, so that more
	tests compile.

2011-02-21  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number.

2011-02-21  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 2.0.1 release.

	* CHANGES: Updated.

2011-02-21  Michael Wiegand <michael.wiegand@greenbone.net>

	* INSTALL: Add gnupg and wget as optional prerequisites. Add a note
	regarding the optional prerequisites to the main prerequisites
	section. Fix typos.

2011-02-21  Matthew Mundell <matthew.mundell@greenbone.net>

	Prefer the feed to the imported signature when verifying report
	formats.  Hence increase database version to 41.  Add database
	migration from version 40 to 41.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 41.

	* src/manage_sql.c (migrate_40_to_41): New function.
	(database_migrators): Add migrate_40_to_41.
	(verify_report_format): Check the feed signature if there is one,
	otherwise check the database signature if there is one.  Remove storage
	of signature in database from feed.

	* doc/db.png: Update for version change.

2011-02-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* report_formats/simple_topo_plot/create_report_import: In signature
	source file creation, remove empty param and order params as in the XML.

2011-02-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_max_hosts): Explicitly deal with hostnames
	first.

2011-02-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (get_report_format_files): Mandate the C locale.

	* src/report_formats/create_signatures: Correct LC_ALL export.  Spotted by
	Michael Wiegand.  List files with ls instead of glob.

2011-02-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/create_signatures: Mandate the locale.

2011-02-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/create_signatures: Setup fake PDF/latex.xsl.  Quote
	$name in if test.  Add more verbose output.  Include parameters in signed
	file.

2011-02-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (setup_full_config_prefs): Remove duplicates.

2011-02-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Set "unscanned_closed" to yes in the predefined configs.  Hence increase
	database version to 40.  Add database migration from version 39 to 40.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 40.

	* src/manage_sql.c (migrate_39_to_40_set_pref, migrate_39_to_40): New
	functions.
	(database_migrators): Add migrate_39_to_40.
	(setup_full_config_prefs): Set "unscanned_closed" to "yes".

	* doc/db.png: Update for version change.

2011-02-16  Michael Wiegand <michael.wiegand@greenbone.net>

	Fix the location where openvasmd looks for signatures.

	* CMakeLists.txt: Ensure OPENVAS_NVT_DIR is set.

	* src/CMakeLists.txt: Expose OPENVAS_NVT_DIR.

	* src/manage_sql.c (find_signature): Look for signatures in the
	subdirs of OPENVAS_NVT_DIR instead of
	OPENVAS_LIB_INSTALL_DIR/openvas/plugins.

2011-02-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Make the fallback system report case more like the others.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_SYSTEM_REPORTS let
	init_system_report_type_iterator and manage_system_report produce the
	fallback report.  Set the format to txt for the fallback report.  Return
	the entire fallback report always, even when brief is true.

	* src/manage.c (get_system_report_types, manage_system_report): Return the
	fallback report on openvasmr failure.
	(init_system_report_type_iterator): Include fallback return in check.
	(FALLBACK_SYSTEM_REPORT_HEADER): New define.

2011-02-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_SYSTEM_REPORTS
	add a simple fallback text report to the error response.

2011-02-09  Stephan Kleine

	* CMakeLists.txt: Fix out of surce builds.

2011-02-08  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number.

2011-02-08  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 2.0.0 release.

	* CMakeLists.txt: Updated version number.

2011-02-08  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* CHANGES: Updated for 2.0.0.

2011-02-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Add MAX_NVT_COUNT and KNOWN_NVT_COUNT
	to CONFIG in GET_CONFIGS response.

	* doc/omp.rnc, doc/omp.html: Update from source.

2011-02-08  Michael Wiegand <michael.wiegand@greenbone.net>

	Consolidation: Move most of configuration and installation handling to
	top level CMakeLists.txt.

	* CMakeLists.txt: Move sqlite3 and uuid detection to pkg-config. Set
	all _CFLAGS and _LDFLAGS properly. Add all defines to CMAKE_C_FLAGS.
	Handle installation of logging configuration, report formats and
	schema formats.

	* src/CMakeLists.txt: Remove most configuration and installation. Use
	the LINK_FLAGS and COMPILE_FLAGS reported by pkg-config instead of
	hard coding them.

2011-02-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (report_counts_id_filt): Doc all params.

	* doc/db.png: Update for version change.

2011-02-07  Michael Wiegand <michael.wiegand@greenbone.net>

	* README: Remove inaccurate and redundant information.

2011-02-07  Matthew Mundell <matthew.mundell@greenbone.net>

	Remove the slow w3af NVT from the predefined configs.  Hence increase
	database version to 39.  Add database migration from version 38 to 39.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 39.

	* src/manage_sql.c (migrate_38_to_39): New function.
	(database_migrators): Add migrate_38_to_39.
	(init_manage): Add w3af excluder to the "all" NVT selector.  Adjust
	predefined config comments to match.

2011-02-07  Michael Wiegand <michael.wiegand@greenbone.net>

	* doc/CMakeLists.txt: Enable man and man-html targets only if the
	required tools have been found. Enable install target always since we
	ship pregenerated files as well.

2011-02-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (migrate_37_to_38): Succeed even if one of the old
	directories is missing.

2011-02-07  Matthew Mundell <matthew.mundell@greenbone.net>

	Enable logging of key informational messages when --verbose is given.

	* src/openvasmd_log_conf.cmake_in: Change levels to show all levels below
	DEBUG.

	* src/tracef.h (infof): New macro.

	* src/openvasmd.c, src/ompd.c, src/omp.c, src/manage_sql.c: Change
	appropriate tracefs to infos.

2011-02-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_config_task_iterator): Select current user's
	tasks only.

2011-02-04  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number.

2011-02-04  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 2.0+rc4 crelease.

	* CHANGES: Updated.

2011-02-04  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* doc/db.png: Updated to DB rev 38.

2011-02-04  Matthew Mundell <matthew.mundell@greenbone.net>

	Place report formats in the directories required by the FHS.  Hence
	increase database version to 38.  Add database migration from version
	37 to 38.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 38.

	* src/manage_sql.c (migrate_37_to_38): New function.
	(database_migrators): Add migrate_37_to_38.
	(manage_report, manage_send_report, create_report_format)
	(delete_report_format): User data dir for global report formats, and state
	dir for user report formats.

	* src/manage.c (init_report_format_file_iterator): User data dir for
	global report formats, and state dir for user report formats.

	* src/CMakeLists.txt: Install global report formats to data dir.

2011-02-04  Michael Wiegand <michael.wiegand@greenbone.net>

	Place global schema formats into the correct directory to comply with
	the Filesystem Hierarchy Standard (FHS), version 2.3.

	* src/CMakeLists.txt: Install global schema formats to
	OPENVAS_DATA_DIR instead of OPENVAS_SYSCONF_DIR.

	* src/manage_sql.c (manage_schema): Read global schema formats from
	OPENVAS_DATA_DIR instead of OPENVAS_SYSCONF_DIR.

2011-02-04  Michael Wiegand <michael.wiegand@greenbone.net>

	* CMakeLists.txt: Remove obsolete comment.

2011-02-04  Michael Wiegand <michael.wiegand@greenbone.net>

	* doc/openvasmd.8.xml: Fix typos, add missing option.

	* doc/openvasmd.html, doc/openvasmd.8: Regenerated.

2011-02-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/HTML/HTML.xsl (report): Include host in port selection.

2011-02-03  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* CMakeLists.txt: Removed check for libopenvas_base as
	this is already tested via pkgconf.

2011-02-03  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* doc/openvasmd.8.xml: Updated.

	* doc/openvasmd.html, doc/openvasmd.8: Rebuild.

2011-02-01  Michael Wiegand <michael.wiegand@greenbone.net>

	Switch openvas-manager to pkg-config.

	* CMakeLists.txt: Move checks for openvas-libraries, glib and gnutls
	to pkg-config.

	* INSTALL: Update requirements and installation instructions.

	* src/CMakeLists.txt, src/tests/CMakeLists.txt: Replace calls to
	libopenvas-config with the appropriate pkg-config calls.

2011-01-29  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* INSTALL: Added sections on database initialization and
	migration.

2011-01-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_NOTE and
	CLIENT_CREATE_OVERRIDE only count the hosts when hosts where given.

2011-01-28  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* INSTALL: Added section on creating initial admin user.

2011-01-21  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number.

2011-01-21  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 2.0+rc3 crelease.

	* CHANGES: Updated.

	* INSTALL: Updated prerequisites.

2011-01-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd_log_conf.cmake_in: Add warning about passwords.

2011-01-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd_log_conf.cmake_in: Reduce max log level to warning in all
	groups, to prevent loggin of passwords in the standard install.

2011-01-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Cleanup an error in the 35 to 36 migrator, in a new migrator.  Increase
	database version to 37.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 37.

	* src/manage_sql.c (migrate_36_to_37): New function.
	(database_migrators): Add migrate_36_to_37.

2011-01-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (migrate_35_to_36): Set target and config from correct
	table.

2011-01-19  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/otp.c, src/omp.c: Fix include path for nvt_categories.h.

2011-01-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (run_slave_task): Add SMB credential arg.
	(run_task): Pass SMB credential to run_slave_task.
	(delete_slave_task): Remove SMB credential too.

2011-01-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (run_slave_task): Check if the target has a credential,
	before creating one.

2011-01-15  Matthew Mundell <matthew.mundell@greenbone.net>

	Validate CREATE_ESCALATOR addresses.

	* src/manage_sql.c (validate_email): New function.
	(create_escalator): Validate email method addresses.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_ESCALATOR
	add validation error.

2011-01-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (email): Pass user supplied data via files instead
	of directly in the command.

2011-01-11  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* packaging/debian/control, packaging/debian/compat,
	packaging/debian/openvas-manager.dirs, packaging/debian/changelog,
	packaging/debian/copyright, packaging/debian/openvas-manager.install,
	packaging/debian/rules, packaging/debian/, packaging/: Removed.
	These packaging files are hopeless out of date and better packages
	are available by third parties already.

2011-01-10  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number.

2011-01-10  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 2.0+rc2 crelease.

	* CHANGES: Updated.

2011-01-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/lsc_user.c (check_is_dir): Remove.
	(file_utils_rmdir_rf): Use libraries version of check_is_dir.

2011-01-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_schema): Correct comments.

2011-01-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/lsc_user.c (ssh_privkey_create, ssh_pubkey_create): Restore command
	logging, masking out passwords.

2011-01-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/lsc_user.c (ssh_privkey_create, ssh_pubkey_create): Remove command
	logging.

	* src/manage_sql.c (sql_quiet): New function.
	(create_lsc_credential): Use sql_quiet instead of sql, to prevent password
	logging.

2011-01-03  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/manage.c (send_user_rules): Extended todo comment about another
	location that deals with the rules file format.

2010-12-30  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/openvasmd.c (main): Added forgotten license note.

2010-12-30  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/openvasmd.c (main): Adapted --version output to
	comply with GNU Coding Standards
	(http://www.gnu.org/prep/standards/standards.html#g_t_002d_002dversion)

2010-12-29  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/openvasmd.c (main): Improved description text.

2010-12-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Update version to 2.0.

	* doc/omp.rnc, doc/omp.html: Update from source.

2010-12-21  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number.

2010-12-21  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 2.0+rc1 release.

	* CHANGES: Updated.

	* CMakeLists.txt: Updated version number.

2010-12-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/LaTeX/latex.xsl (results-overview)
	(results-overview-table-single-host-row): Add Log.

2010-12-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/omp.rnc, doc/omp.html: Update from source.

2010-12-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Remove GET_TASKS RESULT_COUNT.

2010-12-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Split CREATE_TARGETS and GET_TARGETS
	LSC credentials into SSH and SMB credentials.

2010-12-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Add port range to CREATE_TARGET and
	GET_TARGETS.

2010-12-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Neaten comment.

2010-12-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Adjust GET_REPORTS result counts for
	recent filtering additions.

2010-12-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Add trust time to GET_AGENTS.

2010-12-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Modify CREATE_TASK, GET_SYSTEM_REPORTS,
	GET_TASKS and MODIFY_TASK for OMP 2.0 master slave feature.

2010-12-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Add CVE and BID to RESULT/NVT in
	GET_RESULTS, GET_NOTES and GET_OVERRIDES.

2010-12-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Remove tabs.

2010-12-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Update GET_REPORTS for OMP 2.0.

2010-12-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Update help text in help example.

	* doc/omp.html: Update from source.

2010-12-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Add remaining commands new in OMP 2.

	* doc/omp.rnc, doc/omp.html: Update from source.

2010-12-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_TASKS set progress
	to 1 if 0 and 99 if 100, so it looks like something is going on when it
	is.

2010-12-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Note report filtering changes.

2010-12-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (validate_port_range): New function.
	(create_target): Validate port range.

	* src/omp.c (omp_xml_handle_start_element): Init port range in
	CREATE_TARGET PORT_RANGE, so that the port range is empty instead of NULL
	when the port range element is empty.
	(omp_xml_handle_end_element): In CLIENT_CREATE_TARGET handle port range
	error.

2010-12-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): Only send filtered results for
	requested threat levels.

2010-12-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (report_counts_match): Move up in file.
	(report_counts_filtered, report_counts_id_filt): Make constraints NULL if
	"".  Check constraints properly.

2010-12-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (report_count_filtered, report_counts_match): New
	functions.
	(report_counts_id_filt): New function.  Body from report_counts_id.  Add
	filtered result counting.
	(report_counts_id): Call through to report_counts_id_filt.
	(print_report_xml): Add filtered counts.

2010-12-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (migrate_35_to_36): Ensure example task references are
	IDs.  Set port range on any leftover targets to "default".

2010-12-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage_process): Correct error message.

2010-12-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Move port range from config into target.  Hence increase database version
	to 36.  Add database migration from version 35 to 36.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 36.

	* src/manage_sql.c (duplicate_target, sql_uniquify): New functions.
	(create_tables): Add port_range to table targets.
	(migrate_35_to_36): New function.
	(database_migrators): Add migrate_35_to_36.
	(init_manage_process): Create SQL function uniquify.
	(create_target): Add port_range arg.
	(init_target_iterator): Add port_range field.
	(target_iterator_port_range): New function.
	(manage_nvt_preference_add): Prevent addition of port range.

	* src/manage.c (send_config_preferences): Skip over port range, just in
	case.
	(run_task): Send port range from target.

	* src/manage.h, src/manage_sql.h: Update headers accordingly.

	* src/omp.c (create_target_data_t, create_target_data_reset)
	(client_state_t): Add CREATE_TARGET port range.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add PORT_RANGE to TARGET.  Send port range in
	GET_TARGETS.

2010-12-16  Michael Wiegand <michael.wiegand@greenbone.net>

	* CMakeLists.txt: Add a collection of code hardening flags to
	CMAKE_C_FLAGS, inspired by hardening-wrapper on Debian. Add -Werror to
	CMAKE_C_FLAGS to make all warnings fatal.

2010-12-16  Michael Wiegand <michael.wiegand@greenbone.net>

	* doc/CMakeLists.txt: Handle absence of doxygen more gracefully.

2010-12-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* README: Update gsa-desktop to GSD.

2010-12-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db_postgres.sql (targets): Add smb_lsc_credential.

	* doc/db.png: Update from SQL.

2010-12-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Split target credential into SSH credential and SMB credential.  Hence
	increase database version to 35.  Add database migration from version
	34 to 35.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 35.

	* src/manage_sql.c (create_tables): Add smb_lsc_credential to table
	targets.
	(migrate_34_to_35): New function.
	(database_migrators): Add migrate_34_to_35.
	(create_target): Convert single credential arg into two.
	(init_target_iterator): Add extra credential field.
	(target_iterator_lsc_credential, target_lsc_credential): Remove.  Replace
	with SSH versions.
	(target_iterator_smb_credential, target_iterator_ssh_credential)
	(target_ssh_lsc_credential, target_smb_lsc_credential): New functions.
	(init_lsc_credential_target_iterator): Select targets used by both
	credentials.

	* src/manage.c (run_task): Send SSH and SMB preferences separately.

	* src/manage.h, src/manage_sql.h: Update headers accordingly.

	* src/omp.c (create_target_data_t, create_target_data_reset)
	(client_state_t): Convert single credential field into two.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Convert
	CREATE_TARGET LSC_CREDENTIAL into SSH and SMB entities.  Same for TARGET
	in GET_TARGETS.

2010-12-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Add some of the commands new in OMP 2.

	* doc/omp.rnc, doc/omp.html: Update from source.

2010-12-10  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number.

2010-12-10  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 2.0+beta3 release.

	* CHANGES: Updated.

2010-12-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/CMakeLists.txt (C_FILES): Add lsc_user.c.

2010-12-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (lsc_credential_iterator_rpm)
	(lsc_credential_iterator_deb, lsc_credential_iterator_exe): Get
	login name from right column.

2010-12-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/LaTeX/latex.xsl
	(result-details-host-port-threat): Add threat to subsubsection
	name.

2010-12-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/LaTeX/latex.xsl (latex-subsection)
	(latex-subsubsection, latex-hyperref): Escape name.

2010-12-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/LaTeX/latex.xsl
	(single-host-overview-table-row): Add threat to hyperref target.
	(result-details-host-port-threat): Add threat to label.

2010-12-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_max_hosts): Limit range size in octet ranges
	to 256.

2010-12-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/HTML/HTML.xsl (command): Correct contents number.

	* doc/omp.html: Update from source.

2010-12-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/HTML/HTML.xsl (structure-line): Add C case.  In R
	case add _response suffix and shorten description.  Emit element suffix
	after "One of" in OR case.

	* doc/omp.html: Update from source.

2010-12-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Add commands to COMMANDS pattern.

	* doc/omp.rnc, doc/omp.html: Update from source.

2010-12-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/RNC/rnc.xsl,
	src/schema_formats/HTML/rnc.xsl (ele): Inline the body of the type
	element, otherwise the ele will have the same name as the type element.

	* doc/omp.rnc, doc/omp.html: Update from source.

2010-12-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (REPORT_NOTICE_FORMAT, escalate_1): Add note above
	report if report was truncated.

2010-12-03  Tim Brown <timb@openvas.org>

	* report_formats/IVIL/IVIL.xml, report_formats/IVIL/generate: New.
	Preliminary support for IVIL (http://ivil.sourceforge.net/).

2010-12-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (SIMPLE_NOTICE_FORMAT, escalate_1): Add generic event
	description to sentence about condition.

2010-12-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (REPORT_NOTICE_FORMAT, escalate_1): Add task name and
	event to first two sentences.

2010-12-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Increase database version to 33 to ensure change the "NTLMSSP" preference
	on the "Login Configurations" checkbox.  Add database migration from
	version 33 to 34.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 34.

	* src/manage_sql.c (migrate_33_to_34, migrate_33_to_34_set_pref): New
	functions.
	(database_migrators): Add migrate_33_to_34.
	(setup_full_config_prefs): Set NTLMSSP to yes.

2010-12-01  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number.

2010-11-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/HTML/HTML.xsl (structure-line): Remove type check
	from global element case, because the type is the global element type.

	* doc/omp.html: Update from source.

2010-11-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/HTML/HTML.xsl (structure-line): In the global element
	case link the tag text to the element details.

	* doc/omp.html: Update from source.

2010-11-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/HTML/HTML.xsl (structure-line): Handle the global
	element case separately, so that summaries show up.

	* doc/omp.html: Update from source.

2010-11-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Remove fullstops from summaries.

	* doc/omp.rnc, doc/omp.html: Update from source.

2010-11-30  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* CHANGES: Updated for upcoming 2.0 beta2.

2010-11-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* ChangeLog, TODO, src/lsc_user.c, src/lsc_user.h, src/manage_sql.h,
	src/schema_formats/HTML/rnc.xsl, src/schema_formats/RNC/rnc.xsl,
	src/tests/omp_authenticate_0.c, src/tests/omp_commands_0.c,
	src/tests/omp_create_config_0.c, src/tests/omp_create_config_1.c,
	src/tests/omp_create_lsc_credential_0.c,
	src/tests/omp_create_lsc_credential_1.c, src/tests/omp_create_target_0.c,
	src/tests/omp_create_target_1.c, src/tests/omp_create_task_2.c,
	src/tests/omp_create_task_3.c, src/tests/omp_create_task_4.c,
	src/tests/omp_delete_config_0.c, src/tests/omp_delete_config_1.c,
	src/tests/omp_delete_lsc_credential_0.c, src/tests/omp_delete_target_0.c,
	src/tests/omp_delete_target_1.c, src/tests/omp_get_configs_0.c,
	src/tests/omp_get_configs_1.c, src/tests/omp_get_configs_2.c,
	src/tests/omp_get_configs_3.c, src/tests/omp_get_lsc_credentials_0.c,
	src/tests/omp_get_lsc_credentials_1.c,
	src/tests/omp_get_lsc_credentials_2.c, src/tests/omp_get_report_8.c,
	src/tests/omp_get_targets_0.c, src/tests/omp_get_targets_1.c,
	src/tests/omp_start_task_3.c, src/tests/omp_start_task_5.c: Replace
	Intevation addresses with Greenbone ones.

2010-11-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* CMakeLists.txt, ChangeLog, doc/CMakeLists.txt, doc/openvasmd.8.xml,
	src/CMakeLists.txt, src/logf.h, src/manage.c, src/manage.h,
	src/manage_sql.c, src/omp.c, src/omp.h, src/ompd.c, src/ompd.h,
	src/openvasmd.c, src/otp.c, src/otp.h, src/otpd.c, src/otpd.h,
	src/ovas-mngr-comm.c, src/oxpd.c, src/oxpd.h, src/splint.h,
	src/tests/CMakeLists.txt, src/tests/common.c, src/tests/common.h,
	src/tests/make_report_uuid_0.c, src/tests/omp_abort_task_0.c,
	src/tests/omp_bogus_0.c, src/tests/omp_bogus_1.c,
	src/tests/omp_create_task_0.c, src/tests/omp_create_task_1.c,
	src/tests/omp_delete_report_0.c, src/tests/omp_delete_report_1.c,
	src/tests/omp_delete_task_0.c, src/tests/omp_delete_task_1.c,
	src/tests/omp_delete_task_2.c, src/tests/omp_get_certificates_0.c,
	src/tests/omp_get_certificates_1.c, src/tests/omp_get_dependencies_0.c,
	src/tests/omp_get_dependencies_1.c, src/tests/omp_get_nvt_all_0.c,
	src/tests/omp_get_nvt_all_1.c, src/tests/omp_get_nvt_details_0.c,
	src/tests/omp_get_nvt_details_1.c, src/tests/omp_get_nvt_details_2.c,
	src/tests/omp_get_nvt_details_3.c, src/tests/omp_get_nvt_details_4.c,
	src/tests/omp_get_nvt_feed_checksum_0.c,
	src/tests/omp_get_nvt_feed_checksum_1.c,
	src/tests/omp_get_nvt_feed_checksum_2.c,
	src/tests/omp_get_nvt_feed_checksum_3.c,
	src/tests/omp_get_nvt_feed_checksum_4.c,
	src/tests/omp_get_nvt_feed_checksum_5.c,
	src/tests/omp_get_preferences_0.c, src/tests/omp_get_preferences_1.c,
	src/tests/omp_get_preferences_2.c, src/tests/omp_get_report_0.c,
	src/tests/omp_get_report_1.c, src/tests/omp_get_report_2.c,
	src/tests/omp_get_report_3.c, src/tests/omp_get_report_4.c,
	src/tests/omp_get_report_5.c, src/tests/omp_get_report_6.c,
	src/tests/omp_get_report_7.c, src/tests/omp_get_rules_0.c,
	src/tests/omp_get_rules_1.c, src/tests/omp_get_status_0.c,
	src/tests/omp_get_status_1.c, src/tests/omp_get_status_2.c,
	src/tests/omp_get_status_3.c, src/tests/omp_get_status_4.c,
	src/tests/omp_get_status_5.c, src/tests/omp_get_version_0.c,
	src/tests/omp_help_0.c, src/tests/omp_help_1.c,
	src/tests/omp_modify_report_0.c, src/tests/omp_modify_task_0.c,
	src/tests/omp_modify_task_1.c, src/tests/omp_start_task_0.c,
	src/tests/omp_start_task_1.c, src/tests/omp_start_task_2.c,
	src/tests/omp_start_task_4.c, src/tests/read_protocol_0.c,
	src/tests/strip_space_0.c, src/tests/strip_space_1.c,
	src/tests/strip_space_2.c, src/tests/strip_space_3.c,
	src/tests/timeout_0.c, src/tracef.h, src/types.h: Use Greenbone address.

2010-11-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (set_nvts_md5sum): Doc arg.

	* src/manage.h (create_report_format_param_t): Doc fields.

2010-11-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/HTML/HTML.xsl (rnc-preamble): New template.
	(protocol): Add RNC preamble section.  Adjust index numbers accordingly.

	* src/schema_formats/HTML/rnc.xsl (preamble): New template.  From ../RNC/.

	* src/schema_formats/RNC/rnc.xsl (preamble): New template.  From RNC.xsl.

	* src/schema_formats/RNC/RNC.xsl (preamble): Remove.  To rnc.xsl.

	* doc/omp.html: Update from source.

2010-11-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Add COMMAND/EXAMPLE to the schema case
	of HELP.

	* doc/omp.rnc, doc/omp.html: Update from source.

2010-11-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Add COMMAND/RESPONSE to the schema case
	of HELP.

	* doc/omp.rnc, doc/omp.html: Update from source.

2010-11-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (http_get, manage_report, manage_send_report)
	(manage_schema): Make trace messages g_debug instead of g_message.
	(init_manage_process): Make failure messages g_warnings.

	* src/omp.c, src/openvasmd.c: Downgrade messages of possibly interesting
	events to level info.

2010-11-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Add the schema parts of the HELP command to the HELP response, including
	an example.  To make it easier to define the recursive parts of the HELP
	response syntax, add a new PROTOCOL element, ELEMENT, alongside TYPE and
	COMMAND.

	* src/schema_formats/XML/OMP.xml: Add schema parts of HELP.

	* src/schema_formats/HTML/rnc.xsl,
	src/schema_formats/RNC/rnc.xsl (e): Adjust for new top level ELEMENTs.
	Update callers accordingly.
	(ele): Adjust for new TYPE property, which allows ELEs to be defined
	by refering to ELEMENTs instead of including PATTERNs.

	* src/schema_formats/RNC/rnc.xsl (elements): New template.
	(protocol): Add elements section.

	* src/schema_formats/HTML/HTML.xsl (pretty): Special case p to preserve
	formatting.
	(type [details], type-details, command, command-summary)
	(command-details): Update section numbers.
	(element [index], element-summary, element): New templates.
	(protocol): Add element sections.

	* doc/omp.rnc, doc/omp.html: Update from source.

2010-11-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c, src/manage_sql.c: Include unistd.h, for when tracing is
	off.

2010-11-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/HTML/HTML.xsl (func:string-left-trim-nl)
	(func:string-right-trim-nl, func:string-trim-nl): New function.
	(pretty): Special case help_response to preserve formatting.

	* src/schema_formats/XML/OMP.xml: Add HELP example.

	* doc/omp.html: Update from source.

2010-11-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ompd.c (serve_omp): Make the second timeout check like the first.
	Make the second timeout trace message unique.

2010-11-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (sql_x): Remove warning for too few rows, as caller can
	legitimately provide SQL that will select too few rows, for example when
	checking for existence.
	(sql_int): Add row expectation to doc.
	(sql_string): Note NULL ambiguity in return doc.

2010-11-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (compare_message_types_desc)
	(compare_message_types_asc, compare_port_threat): Include host in
	comparison.
	(print_report_xml): Account for host when removing duplicates.

2010-11-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (compare_message_types_desc)
	(compare_message_types_asc): Include port in comparison.
	(compare_port_threat): New function.
	(print_report_xml): Also do the threat sorting when sort_field is NULL,
	because init_result_iterator will have sorted by threat.  Call
	compare_port_threat instead of alphasort so that the ports are sorted
	by port and threat.  Remove array index with g_array_remove_index so that
	order is preserved.

2010-11-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (report_counts_id): Count false positives too.
	(task_trend): Request false positive count, as report_counts_id is faster
	with this count.

2010-11-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/LaTeX/latex.xsl
	(latex-replace-backslash-dollar): Correct template name.

2010-11-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Speed up row wrapping in the LaTeX report XSLT.

	* src/report_formats/LaTeX/latex.xsl (wrap-row-indented): New template.
	The indented case of wrap-row.
	(wrap-row): Remove indented test, which is covered by wrap-row-indented.
	Inline latex-newline.
	(break-into-rows-indented): New template.  The indented case of
	break-into-rows.
	(break-into-rows): Remove indented and max params.  Call break-into-rows
	instead of recursing with these params.

2010-11-19  Michael Wiegand <michael.wiegand@greenbone.net>

	Increased required openvas-libraries version.

	* CMakeLists.txt: Updated LO_MAJOR_MIN_VER and LO_MINOR_MIN_VER.

	* INSTALL: Document required version.

2010-11-19  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number.

2010-11-19  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 2.0+beta1 release.

	* CHANGES: Fixed typos.

	* CMakeLists.txt: Updated version number. Changed
	CPACK_PACKAGE_VERSION for use with "+beta" versioning scheme.

2010-11-19  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* CHANGES: Improved.

2010-11-19  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* CHANGES: Updated.

2010-11-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/LaTeX/latex.xsl (wrap-row): Call escape_verb_env
	directly, instead of as the value of a variable, to increase speed.

2010-11-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (create_config_data_reset)
	(create_report_format_data_reset): Check item exists, in case array is
	NULL terminated.

	* ChangeLog: Restore overwritten entry.

2010-11-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (report_counts_id): Remove initialisation of debugs
	from "all" case.
	(task_trend): Pass logs to report_counts_id, as this is faster.

2010-11-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (report_counts_id): If all levels are required count
	them all in one go, using the three part select from report_count.

2010-11-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (report_count): Put the zero comparisons first in the
	overrides select.

2010-11-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (report_count): Convert the complex override select to
	multiple simpler selects, to increase speed.

2010-11-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (report_count): Only do the overrides case if the user
	has overrides.

2010-11-11  Raimund Renkert <raimund.renkert@greenbone.net>

	* report_formats/simple_map_plot/generate: Generate the symbol for
	non-georeferenced IPs using twopi.

	* report_formats/simple_map_plot/non-georeferenced.map: Render png symbol
	instead of a label on the map.

	* report_formats/simple_map_plot/create_report_import: Added new files.

	* report_formats/simple_map_plot/non-georeferenced.dot: New.

2010-11-10  Matthew Mundell <matthew.mundell@greenbone.net>

	Speed up GET_TASKS.

	* src/manage_sql.c (create_tables): Add more indexes.
	(report_count): Select ID fields as integers instead of strings.  Reorder
	the constraints in the standard case.
	(report_counts_id): Just set debugs and false_positives to 0, to save some
	time.
	(delete_agent): Select ID fields as integers instead of strings.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_TASKS remove the
	result counts over all scans for a task, use the report count for the
	first report for the last and second last reports if they are the same
	report and turn off the progress tracing.

2010-11-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_tables): Add a task index for table results.

2010-11-09  Matthew Mundell <matthew.mundell@greenbone.net>

	Create LSC credential packages on every GET_LSC_CREDENTIAL, instead of
	once in CREATE_LSC_CREDENTIAL.

	* src/lsc_user.c (lsc_user_keys_create, lsc_user_rpm_recreate)
	(lsc_user_deb_recreate, lsc_user_exe_recreate): New functions.
	(alien_found): Move up in file.

	* src/manage.h: Add headers accordingly.

	* src/manage_sql.c (create_lsc_credential): Just create the keys,
	instead of all packages.
	(lsc_credential_iterator_rpm, lsc_credential_iterator_deb)
	(lsc_credential_iterator_exe): Create packages instead of returning
	cached packages.

2010-11-09  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/ompd.c, src/otpd.c, src/lsc_user.h, src/manage.c,
	src/omp.c, src/openvasmd.c, src/manage.h: Adjusted include
	patch for header files of libopenvas_misc.

2010-11-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/HTML/HTML.xsl (type [details]): Add RNC heading.
	Print type RNC as a type instead of as an element.

	* src/schema_formats/HTML/rnc.xsl, src/schema_formats/RNC/rnc.xsl: Work
	around RNC restrictions on treating element text as data when element
	contains other elements.

	* src/schema_formats/XML/OMP.xml: Remove GET_TASKS elements left over from
	sample.

	* doc/omp.html, doc/omp.rnc: Update from source.

2010-11-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/HTML/HTML.xsl (type [details]): Add RNC heading.
	Print type RNC as a type instead of as an element.

	* src/schema_formats/HTML/rnc.xsl: Normalise space as in RNC version.
	Remove rare wrap to match RNC version.

	* src/schema_formats/RNC/rnc.xsl: Match to HTML version.

	* src/schema_formats/XML/OMP.xml: Correct typos and GET_REPORTS element
	name.

2010-11-09  Raimund Renkert <raimund.renkert@greenbone.net>

	* report_formats/simple_map_plot/generate: Render label for
	non-georeferenced IPs on the world map.

	* report_formats/simple_map_plot/world_map.map: Include Layer for
	non-georeferenced IPs.

	* report_formats/simple_map_plot/non-georeferenced.map: New.

2010-11-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Add remaining GET commands.

	* src/schema_formats/HTML/HTML.xsl (pretty): Remove extra select.
	(type [details], command): Make RNC blocks wider.

	* src/schema_formats/HTML/rnc.xsl (wrap): Only add the final newline
	when the text contains newlines.
	(wrap-line): Bring width down to 76.

	* src/schema_formats/RNC/RNC.xsl (types): Normalise space of pattern.

	* src/schema_formats/RNC/rnc.xsl (rnc-type, attrib, t, ele): Normalise
	space.

2010-11-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Add more GET commands.

	* src/schema_formats/HTML/HTML.xsl (print-attributes): Add level arg to
	print each attribute after first on a new line.  Update callers.

	* src/schema_formats/HTML/rnc.xsl (wrap, wrap-line): New templates.
	(pattern): Wrap text in patterns.

	* doc/omp.html, doc/omp.rnc: Update from source.

2010-11-04  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* report_formats/simple_map_plot/README.txt: Added note
	on required tools.

2010-11-04  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* report_formats/simple_map_plot/,
	report_formats/simple_map_plot/join.awk,
	report_formats/simple_map_plot/world_map.map,
	report_formats/simple_map_plot/FreeSans.ttf,
	report_formats/simple_map_plot/locations.csv,
	report_formats/simple_map_plot/fonts.txt,
	report_formats/simple_map_plot/create_report_import,
	report_formats/simple_map_plot/hosts.vrt,
	report_formats/simple_map_plot/report_to_csv_host.xsl,
	report_formats/simple_map_plot/generate,
	report_formats/simple_map_plot/README.txt,
	report_formats/simple_map_plot/world_map.tiff: New.
	Report Format plugin that rednders host scan results
	on a world map. Most work done by Raimund Renkert.

2010-11-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/LaTeX/latex.xsl, src/report_formats/HTML/HTML.xsl,
	src/report_formats/TXT/TXT.xsl: Describe which results are in the report,
	below the description of which filters are in effect.

2010-11-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Add GET_PREFERENCES.

	* doc/omp.html, doc/omp.rnc: Update from source.

2010-11-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/HTML/HTML.xsl (type): Skip link for type "text".

	* doc/omp.html: Update from source.

2010-11-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/HTML/HTML.xsl: Remove more bold.

2010-11-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/HTML/HTML.xsl: Rename command "breakdown" to
	"structure".

2010-11-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/HTML/HTML.xsl: Reduce the amount of bold, so that the
	headings stand out a bit better.

2010-11-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/HTML/HTML.xsl: Match contents items to real headings.
	Link command breakdown attribute types to type details.  Use @ instead of
	quotations to mark attribs in command breakdown.

	* doc/omp.html, doc/omp.rnc: Update from source.

2010-11-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Add missing type summaries.

2010-11-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/HTML/HTML.xsl: Add a small contents section.

2010-11-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/HTML/HTML.xsl: Add "Data Types".

2010-11-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/HTML/HTML.xsl, src/schema_formats/RNC/RNC.xsl: Add
	version.

2010-11-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_schema): Doc param.

2010-11-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Add more get commands.
	(create_escalator): Make data elements "any".
	(get_version): Add VERSION.

	* src/schema_formats/HTML/HTML.xsl: Normalize space for summary, in case
	the closing SUMMARY tag is on a new line.

	* doc/omp.html, doc/omp.rnc: Update from source.

2010-11-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/LaTeX/latex.xsl (longtable-continue-block): Rename
	Result Overview columns with threat names.

2010-11-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_host_iterator): Add const to arg.

	* src/manage.h: Update headers accordingly.

	* src/report_formats/PDF/generate: Use batch mode, so TeX does its best
	to produce the document, including dealing with missing Unicode chars
	or other binary in the doc.

2010-10-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/HTML/HTML.xsl (type): New template.
	(breakdown-line): Add alts, for types that are a simple choice of strings.
	Add g, to group elements in patterns.

	* src/schema_formats/HTML/rnc.xsl,
	src/schema_formats/RNC/rnc.xsl (rnc-type): New template.
	(attrib): Call type template instead of matching.
	(t): Add alts handling.
	(pattern-part): Add g handling.

	* doc/omp.html, doc/omp.rnc: Update from source.

	* src/schema_formats/XML/OMP.xml: Add more get commands.  Use alts
	instead of xsd:token string for file modify_task attach action.

2010-10-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (MANAGE_SEND_REPORT_CHUNK64_SIZE)
	(MANAGE_SEND_REPORT_CHUNK_SIZE): New defines.
	(manage_send_report, report_format_content_type)
	(report_format_extension): New functions.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_REPORTS call
	manage_send_report instead of using manage_report, so that big reports
	are sent in chunks.

2010-10-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Add create commmands.

	* src/schema_formats/HTML/HTML.xsl (description): Add lists.
	(pretty): Explicitly indent element text.
	(breakdown-line): Add r, to refer to command responses.

	* src/schema_formats/HTML/rnc.xsl, src/schema_formats/RNC/rnc.xsl: Add r
	to pattern, to refer to command responses.

	* doc/omp.html, doc/omp.rnc: Update from source.

2010-10-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/LaTeX/latex.xsl (header): Define another character
	that seems to be missing from Debian Lenny ucs LaTeX package.

2010-10-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/HTML/rnc.xsl, src/schema_formats/RNC/rnc.xsl: Always
	print the text content of an element.

	* doc/omp.html, doc/omp.rnc: Update from source.

2010-10-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Add modify commmands.

2010-10-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (strbchr, manage_max_hosts): New functions.  From
	omp.c.
	(create_target): Count hosts here, to ensure within limit in import case.

	* src/omp.c (strbchr, max_hosts, MAX_HOSTS): Remove.  To manage_sql.c and
	manage.h.  Update callers.
	(omp_xml_handle_end_element): In CREATE_TARGET move hosts error cases into
	create_target returns.

	* src/manage.h: Add header accordingly.
	(MANAGE_MAX_HOSTS): New define.

2010-10-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/CMakeLists.txt (doc, doc-full): Add OMP docs.
	(omp.rnc, omp.html): New targets.

	* doc/omp.html, doc/omp.rnc: New files.  Generated from XML source.

2010-10-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Add task control commmands.

2010-10-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/report-format-HOWTO: Note the extra report element.

	* report_formats/simple_pie_chart/create_report_import: Add param Height.

	* report_formats/simple_pie_chart/pieplot.xsl: Read height from new param.

	* report_formats/simple_topo_plot/create_report_import: Add params "Graph
	Type" and "Node Distance".

	* report_formats/simple_topo_plot/generate: Read plot tool from param.

	* report_formats/simple_topo_plot/hostvisdot-summary.xsl: Read nodesep
	from param.

2010-10-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Increase GET_VERSION version.

2010-10-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (check_host_netmasks): Remove.
	(MAX_HOSTS): New define.
	(omp_xml_handle_end_element): Limit number of hosts in CREATE_NOTE,
	CREATE_OVERRIDE and CREATE_TARGET to 4095.

2010-10-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Add AUTHENTICATE.

2010-10-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Add missing delete commands.

2010-10-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (create_config_data_reset)
	(create_report_format_data_reset): Iterate over array using length,
	instead of depending on terminator.

2010-10-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/TXT/TXT.xsl (override): Only include override when
	overrides are in effect, as in other reports.

2010-10-21  Matthew Mundell <matthew.mundell@greenbone.net>

	Ensure that the TXT report matches the GSA report in terms of note and
	override information.

	* src/report_formats/TXT/TXT.xsl (wrap-line): Bring max down to 80.
	(note, override): Replace HTML with text.
	(result [issue]): Add space after "Overriden from".  Remove arg.  Enable
	notes and overrides selections.
	(report): Add details of what the report includes.

2010-10-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (modify_override): Add "False Positive" to possible
	new_threat values.

2010-10-20  Matthew Mundell <matthew.mundell@greenbone.net>

	Ensure that the LaTeX and HTML reports match the GSA report in terms of
	note and override information.

	* src/report_formats/LaTeX/latex.xsl (wrap-row, break-into-rows)
	(text-to-escaped-row): Add colour param.
	(results-overview): Say whether notes are included.  Match filters by
	text so they show up.
	(single-host-overview-table-row): Match threat by text.
	(threat-to-color): Add False Positive.
	(notes): New template.
	(overrides): Add the original threat to the heading.  Use
	text-to-escaped-row for the text, in case there are newlines.
	(result-details-host-port-threat): Match threat by text.  Add original
	threat to heading.
	(result-details-host-port-threat): Include notes.
	(results-per-host-single-host-findings): Correct False Positive select.

	* src/report_formats/HTML/HTML.xsl (override): Only include when overrides
	are in effect.
	(report): Note what the report contains.

2010-10-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage): Set flags to enable report formats when
	creating them.

2010-10-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (max_hosts): Add counting for IPv6 addresses.

2010-10-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): Correct param doc.
	(manage_report): Correct error message.  Free params in same order.

2010-10-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (max_hosts): Ensure mask has dots in subnet mask case.

2010-10-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (check_host_netmasks): New function.  From GSA
	validate_hosts_parameter.
	(omp_xml_handle_end_element): Check host netmasks for CREATE_TARGET,
	CREATE_NOTE and CREATE_OVERRIDE.

2010-10-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_TARGET only
	allow creation if max_hosts succeeds on the hosts value.

2010-10-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (strbchr): New function.
	(max_hosts): Handle addresses with ranges.

2010-10-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/Doxyfile.in: Remove accidental junk from last commit.

2010-10-18  Matthew Mundell <matthew.mundell@greenbone.net>

	Extend OMP HELP to return a documented partial OMP schema in various
	formats.

	* src/omp (help_data_t): New type.
	(help_data_reset): New function.
	(command_data_t): Add help.
	(help_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add format
	attribute to OMP HELP.

	* src/manage_sql.c (manage_schema): New function.  Returns schema in
	given format.

	* src/manage.h: Add header accordingly.

	* src/CMakeLists.txt: Install schema formats.

	* src/schema_formats/, src/schema_formats/HTML/,
	src/schema_formats/HTML/HTML.xsl, src/schema_formats/HTML/generate,
	src/schema_formats/HTML/rnc.xsl, src/schema_formats/RNC/,
	src/schema_formats/RNC/RNC.xsl, src/schema_formats/RNC/generate,
	src/schema_formats/RNC/rnc.xsl, src/schema_formats/XML/,
	src/schema_formats/XML/OMP.xml, src/schema_formats/XML/generate: New dirs
	and files.  First schema formats.

2010-10-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp (omp_xml_handle_end_element): Terminate MODIFY_CONFIG arrays at
	the close of the associated element instead of before handling the
	request.  This ensures that the arrays are always terminated, even in the
	error response cases.

2010-10-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_lsc_credential): Correct comment on second
	last commit, which is actually moving the login check so that
	password-only credentials can have any login.

2010-10-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_param_option_iterator): Correct doc param name.

2010-10-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_lsc_credential): Move password check into
	package case, so that password-only credentials can have any password.

2010-10-07  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP command MODIFY_LSC_CREDENTIAL.

	* src/manage_sql.c (set_lsc_credential_name, set_lsc_credential_comment)
	(set_lsc_credential_login, set_lsc_credential_password)
	(lsc_credential_packaged): New functions.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (help_text): Add new command.
	(modify_lsc_credential_data_t): New type.
	(modify_lsc_credential_data_reset): New function.
	(command_data_t, client_state_t): Add new command elements.
	(modify_lsc_credential_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add MODIFY_LSC_CREDENTIAL handling.

2010-10-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_report_format): Remove stray variable.

2010-10-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_report_format): Check param type names.

	* src/omp.c (omp_xml_handle_end_element): In CREATE_REPORT_FORMAT add
	param type name error case.

2010-10-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_report_format): Check for duplicate param
	names.

	* src/omp.c (omp_xml_handle_end_element): In CREATE_REPORT_FORMAT add
	duplicate param case.

2010-10-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* report_formats/simple_bar_chart/create_report_import: Cleanup
	range end examples after second last commit.

2010-10-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_report_format): Always remove format dir on
	failure.  Always free dir.

2010-10-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* report_formats/simple_bar_chart/create_report_import: Remove + from
	example range end, to ensure verification succeeds.

2010-10-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* report_formats/simple_topo_plot/create_report_import: Remove extra FILE.

2010-10-06  Matthew Mundell <matthew.mundell@greenbone.net>

	Include params in report format verification.

	* src/manage_sql.c (create_report_format): Get param type and value the
	right way round for verification.  Add type min, type max and fallback to
	verification.  Require params to have a type.  Use range ends to indicate
	when type min and max were left out.  Require params to have a fallback.
	(verify_report_format): Add param type qualifiers.
	(init_report_format_param_iterator): Add type_regex.
	(report_format_param_iterator_type_regex)
	(report_format_param_iterator_fallback): New functions.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_start_element)
	(omp_xml_handle_end_element): In CREATE_REPORT_FORMAT PARAM require TYPE,
	require DEFAULT and use range ends to indicate when TYPE MIN and MAX are
	left out.

	* report_formats/simple_bar_chart/create_report_import,
	report_formats/simple_pie_chart/create_report_import: Add params to
	signature.

2010-10-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db_postgres.sql (report_format_params): Add type, type_min,
	type_max, type_regex and fallback.
	(report_format_param_options): New table.

	* doc/db.png: Update from SQL.

2010-10-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* report_formats/simple_bar_chart/create_report_import: Add example MINs,
	MAXes and DEFAULT.

	* report_formats/simple_bar_chart/plot-plt.xsl: Correct description.

2010-10-05  Matthew Mundell <matthew.mundell@greenbone.net>

	Add report format param defaults and validation.  Hence increase database
	version to 33.  Add database migration from version 32 to 33.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 33.

	* src/manage_sql.c (create_tables): Add type_min, type_max, type_regex
	and fallback columns to report_format_params table.
	(migrate_32_to_33): New function.
	(database_migrators): Add migrate_32_to_33.
	(create_report_format): Add min and max param type qualifiers, and param
	value validation according to type.
	(report_format_param_type, report_format_param_type_max)
	(report_format_param_type_max, validate_param_value): New functions.
	(set_report_format_param): Ensure that the param exists.  Validate value
	according to param type.
	(init_report_format_param_iterator): Add new columns.
	(report_format_param_iterator_type_min)
	(report_format_param_iterator_type_max)
	(report_format_param_iterator_fallback): New functions.

	* src/manage.h: Update headers accordingly.
	(create_report_format_param_t): New type.

	* src/omp.c (create_report_format_data_t)
	(create_report_format_data_reset, client_state_t): Add param entries.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add
	PARAM/DEFAULT, PARAM/TYPE/MIN and PARAM/TYPE/MAX handling to
	CREATE_REPORT_FORMAT/REPORT_FORMAT.  Add same to GET_REPORT_FORMATS
	response.  Expand the set_report_format_param check to include param
	validation.

	* src/CMakeLists.txt: Define feature macros for c99, for LLONG_MAX and
	LLONG_MIN.

2010-10-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_target): Add missing arg list in SQL.
	(delete_report_format): Remove param options too.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_TARGET make the
	assertions about the values instead of the addresses.

2010-10-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (migrate_31_to_32): Ensure table report_format_params
	exists.

2010-09-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (escalate_1): Cast format length specifier to int for
	64 bit.

2010-09-30  Matthew Mundell <matthew.mundell@greenbone.net>

	Add report format param types.  Hence increase database version to 32.
	Add database migration from version 31 to 32.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 32.

	* src/manage_sql.c (create_tables): Add report_format_param_options table.
	Add type column to report_format_params table.
	(migrate_31_to_32): New function.
	(database_migrators): Add migrate_31_to_32.
	(create_report_format): Add params_options arg.
	(set_report_format_param): Add value_64 NULL guard.
	(init_report_format_param_iterator): Add type.
	(report_format_param_iterator_param)
	(report_format_param_iterator_type_name)
	(report_format_param_iterator_type, init_param_option_iterator)
	(param_option_iterator_value): New function.

	* src/manage.c (report_format_param_type_name)
	(report_format_param_type_from_name): New functions.

	* src/manage.h: Update headers accordingly.
	(report_format_param_t, report_format_param_type_t): New types.

	* src/manage_sql.h (rowid_t): New type.

	* src/omp.c (create_report_format_data_t)
	(create_report_format_data_reset, client_state_t): Add param option
	entries.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add
	OPTIONS/OPTION handling to CREATE_REPORT_FORMAT/REPORT_FORMAT/PARAM.
	Add options to GET_REPORT_FORMATS response.

	* report_formats/simple_bar_chart/create_report_import: Neaten name.
	Switch to XSL plot file.  Add a report param of each types.

	* report_formats/simple_bar_chart/generate: Generate the plot file too,
	in order to access the report format params.

	* report_formats/simple_bar_chart/plot.plt: Remove.  Replaced with XSL.

	* report_formats/simple_bar_chart/plot-plt.xsl: New file.

2010-09-29  Matthew Mundell <matthew.mundell@greenbone.net>

	Add ACTIVE to OMP MODIFY_REPORT_FORMAT.

	* src/manage_sql.c (set_report_format_active): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (modify_report_format_data_t)
	(modify_report_format_data_reset, client_state_t): Add active name and
	value.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add MODIFY_REPORT_FORMAT ACTIVE handling.

2010-09-29  Matthew Mundell <matthew.mundell@greenbone.net>

	Add PARAM to OMP MODIFY_REPORT_FORMAT.

	* src/manage_sql.c (set_report_format_param): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (modify_report_format_data_t)
	(modify_report_format_data_reset, client_state_t): Add param name and
	value.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add MODIFY_REPORT_FORMAT PARAM handling.

2010-09-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_report_format): Remove params too.

2010-09-29  Matthew Mundell <matthew.mundell@greenbone.net>

	Add a param to the Pie chart, as an example.

	* report_formats/simple_pie_chart/create_report_import: Add "Width" param.

	* report_formats/simple_pie_chart/generate: Pipe error output to files.

	* report_formats/simple_pie_chart/pieplot.xsl: Respect "Width" param.

2010-09-29  Matthew Mundell <matthew.mundell@greenbone.net>

	Ensure GET_SYSTEM_REPORTS responds properly when the given type is
	missing.

	* src/manage.c (get_system_report_types): Return 1 on failure to find
	report.  Always init types args when getting all reports.
	(init_system_report_type_iterator): Add fail returns.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_SYSTEM_REPORTS
	correct error response variable and bring line width in range.

2010-09-28  Matthew Mundell <matthew.mundell@greenbone.net>

	Extend GET_SYSTEM_REPORTS for getting slave system reports.

	* src/manage.c (get_slave_system_report_types): New function.
	(get_system_report_types, init_system_report_type_iterator): Add slave
	arg.
	(slave_system_report): New function.
	(manage_system_report): Add slave arg.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (get_system_reports_data_t)
	(get_system_reports_data_reset): Add slave_id.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add slave_id
	attribute to GET_SYSTEM_REPORTS.

2010-09-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (set_report_scan_run_status): New function.

	* src/manage_sql.h: Add header accordingly.

	* src/manage.c (run_slave_task): Revert last change.
	(run_task): In the resume case, mark just the report as requested before
	forking, to match the normal behaviour.

2010-09-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (run_slave_task): Set task to requested after START_TASK.

2010-09-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (trim_report): New function.

	* src/manage_sql.h: Add header accordingly.

	* src/manage.c (run_slave_task): When resuming and the task UUID is
	missing or the resume fails in OMP, then start the task from the
	beginning.  This can happen if someone edits the slave of the task,
	or messes with the task on the slave.
	(run_task): Similarly, in the resume case, clear the slave record.

2010-09-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Note contention hole.

2010-09-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_TASKS free target
	UUID.

2010-09-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (run_slave_task): Create slave resources with comments.

2010-09-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (modify_task_data_t, modify_task_data_reset): Add slave_id.
	(client_state_t): Add slave entry.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add slave
	handling to MODIFY_TASK.

2010-09-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_TASKS add slave to
	response.

2010-09-24  Matthew Mundell <matthew.mundell@greenbone.net>

	Add slaves.  Use slaves instead of targets to represent slave managers.
	Hence increase database version to 31.  Add database migration from
	version 30 to 31.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 31.

	* src/manage_sql.c (create_tables): Add slaves table.
	(migrate_30_to_31): New function.
	(database_migrators): Add migrate_30_to_31.
	(task_slave, set_task_slave): Use slave_t for slave.
	(target_in_use): Remove slave constraint.
	(find_slave, create_slave, delete_slave, init_slave_iterator)
	(slave_iterator_slave, slave_iterator_uuid, slave_iterator_name)
	(slave_iterator_comment, slave_iterator_host, slave_iterator_port)
	(slave_iterator_login, slave_iterator_password, slave_uuid)
	(slave_name, slave_host, slave_login, slave_password, slave_port)
	(set_slave_host, slave_in_use, init_slave_task_iterator)
	(slave_task_iterator_name, slave_task_iterator_uuid): New functions.

	* src/manage.h: Add headers accordingly.
	(slave_t): New type.

	* src/manage.c (slave_authenticate): Replace credential param with slave.
	(run_slave_task, delete_slave_task): Use slave_t interface for slaves.

	* src/omp.c (help_text): Add slave commands.
	(create_slave_data_t, delete_slave_data_t, get_slaves_data_t): New slave
	types.
	(create_slave_data_reset, delete_slave_data_reset)
	(get_slaves_data_reset): New slave functions.
	(command_data_t): Add slave fields.
	(create_slave_data, delete_slave_data, get_slaves_data): New slave
	variables.
	(client_state_t): Add states for slave commands.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add slave command handling.  In CLIENT_CREATE_TASK
	use slave_t interface for slaves.

2010-09-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db.png: Update from SQL.

2010-09-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db_postgres.sql (agents): Add installer_trust_time.
	(tasks): Add slave.
	(reports): Add slave_progress and slave_task_uuid.
	(report_formats): Add trust_time and flags.
	(slaves): New table.

2010-09-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (run_task): Correct typo in comment.

2010-09-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (modify_report_data_t, modify_report_data_reset): Alphabetise.
	(omp_xml_handle_end_element): Correct command name in CLIENT_MODIFY_CONFIG
	response.  Init report in CLIENT_MODIFY_REPORT.

2010-09-22  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP command MODIFY_REPORT_FORMAT.

	* src/manage_sql.c (set_report_format_name)
	(set_report_format_summary): New functions.
	(init_report_format_iterator): Add installer and installer signature
	(report_format_iterator_installer): New functions.  Adjust other accessors
	accordingly.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (help_text): Add new command.
	(modify_report_format_data_t): New type.
	(modify_report_format_data_reset): New function.
	(command_data_t, client_state_t): Add new command elements.
	(modify_report_format_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add
	MODIFY_REPORT_FORMAT handling.

2010-09-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/LaTeX/latex.xsl (header): Define two Greek characters
	that seem to be missing from Debian Lenny ucs LaTeX package.

2010-09-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP command VERIFY_AGENT.

	* src/manage_sql.c (verify_agent): New function.
	(init_agent_iterator): Add installer and installer signature
	(agent_iterator_installer): New functions.  Adjust other accessors
	accordingly.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (help_text): Add new command.
	(verify_agent_data_t): New type.
	(verify_agent_data_reset): New function.
	(command_data_t, client_state_t): Add new command elements.
	(verify_agent_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add
	VERIFY_AGENT handling.

2010-09-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Add agent trust time.  Hence increase database version to 30.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 30.

	* src/manage_sql.c (create_tables): Add installer_trust_time to table
	agents.
	(migrate_29_to_30): New function.
	(database_migrators): Add migrate_29_to_30.
	(create_agent): Set installer_trust_time.
	(init_agent_iterator): Include installer_trust_time.
	(agent_iterator_trust_time): New function.  Adjust other accessors
	accordingly.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_AGENTS add trust
	time to standard response.

2010-09-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (MAX_CONTENT_LENGTH): Set to something sensible.

2010-09-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Include report in summary version of email escalator.

	* src/omp.c (buffer_results_xml): Export for manage_sql.c.
	(result_type_threat): Remove.
	(compare_message_types_desc, compare_message_types_asc)
	(array_add_new_string, PRINT, print_report_xml): Remove.  Moved to
	manage_sql.c.
	(omp_xml_handle_end_element): In CLIENT_GET_REPORTS replace report
	generation with call to manage_report.

	* src/manage.c (manage_result_type_threat): New function.  Body from
	result_type_threat from omp.c.  Update callers.

	* src/manage_sql.c (array_add_new_string, PRINT, print_report_xml): New
	functions.  From omp.c.
	(REPORT_NOTICE_FORMAT, MAX_CONTENT_LENGTH): New defines.
	(escalate_1): Include report in mail in place of summary message.
	(compare_message_types_desc, compare_message_types_asc)
	(print_report_xml): New functions.  From omp.c.
	(PRINT): New macro.  From omp.c.
	(manage_report): New function.  Body based on report generation code from
	omp.c.

	* src/manage.h: Add headers accordingly.

2010-09-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (run_task): Note how the targets are controlled when
	resuming a stopped task.

2010-09-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_report): Set the task to the status of the
	newest report, whatever the report status is.

2010-09-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (scanner): Init.

2010-09-15  Matthew Mundell <matthew.mundell@greenbone.net>

	Make tasks with slaves run on the slaves.

	* src/manage.c (update_slave_progress, update_from_slave)
	(slave_authenticate): New functions.  Support for run_slave_task and
	delete_slave_task.
	(buffer_config_preference_xml): New header.
	(run_slave_task): New function.
	(run_task): Use run_slave_task if the task has a slave.
	(delete_slave_task): New function.

	* src/manage_sql.c (delete_slave_task): New header.
	(delete_report): Remove slave task if the task has a slave.

2010-09-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_report): Before updating the report status
	check that there was actually a report.

2010-09-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (set_task_parameter): Pass config UUID instead of name
	to find_config.

2010-09-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_DEPENDENCIES
	pass data to g_hash_table_find for send_dependency.

2010-09-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/CMakeLists.txt: Turn off building of tests temporarily.

2010-09-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (delete_reports): Handle delete_report return.

2010-09-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_report): If the newest report is stopped after
	removing the report, then set the task to stopped.
	(manage_delete_report): Add return value to doc.

2010-09-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Make report deletion atomic.

	* src/manage_sql.c (delete_report): Add doc about transaction.
	(manage_delete_report): New function.
	(delete_task): Add transaction.

	* src/manage.h, src/manage_sql.h: Update headers accordingly.

	* src/manage.c (delete_reports): Remove transaction todo.  Add doc about
	safe context.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_DELETE_REPORT call
	manage_delete_report instead of delete_report.

2010-09-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_TASKS use the
	slave progress when the report is from a slave.

2010-09-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Store slave task UUID.  Hence increase database version to 29.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 29.

	* src/manage_sql.c (create_tables): Add slave_task_uuid to table reports.
	(migrate_28_to_29): New function.
	(database_migrators): Add migrate_28_to_29.
	(init_manage, make_report): Init slave_task_uuid.
	(report_slave_task_uuid, set_report_slave_task_uuid): New functions.

	* src/manage.h, src/manage_sql.h: Add headers accordingly.

2010-09-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (switch_representation): Free selector at end, because
	it's used in the body.

2010-09-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Add an active flag to the report formats.  Hence increase database
	version to 28.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 28.

	* src/manage_sql.c (create_tables): Add flags to table report_formats.
	(migrate_27_to_28): New function.
	(database_migrators): Add migrate_27_to_28.
	(report_format_flag_t): New type.
	(create_report_format): Init flags column.
	(report_format_active): New function.
	(init_report_format_iterator): Add flags.
	(report_format_iterator_active): New function.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_REPORTS require
	that the report format be active.  In CLIENT_GET_REPORT_FORMATS add the
	active flag to the response.

2010-09-10  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* report_formats/sourcefire/sourcefire.xsl: Make description
	a single line. Fix the parsing of port and protocol
	so that it works also for "general/tcp".

2010-09-09  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* report_formats/sourcefire/sourcefire.xsl: Create "AddHost"
	entries and avoid empt line with white spaces.

2010-09-09  Matthew Mundell <matthew.mundell@greenbone.net>

	Add HTTP GET escalator.

	* src/manage.c (escalator_method_t): Add ESCALATOR_METHOD_HTTP_GET.

	* src/manage.c (escalator_method_name, escalator_method_from_name): Add
	HTTP GET escalator.

	* src/manage_sql.c (http_get): New function.
	(escalate_1): Add ESCALATOR_METHOD_HTTP_GET case.

2010-09-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/HTML/HTML.xsl (wrap): Replace with line-tokenizing
	version which calls wrap-line.
	(wrap-line): New template.  Copy of old `wrap' template.
	(report): Select ports from port summary instead of from results.

	* src/report_formats/LaTeX/latex.xsl (text-to-escaped-row): Use
	str:tokenize to split string into lines.

	* src/report_formats/TXT/TXT.xsl (wrap): Replace with line-tokenizing
	version which calls wrap-line.
	(wrap-line): New template.  Copy of old `wrap' template from HTML format.
	(report): Select ports from port summary instead of from results.

2010-09-08  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* CMakeLists.txt: Added check for subversion directory if build type
	is not release to avoid an incomplete version number.

2010-09-07  Matthew Mundell <matthew.mundell@greenbone.net>

	Add SLAVE to OMP CREATE_TASK.

	* src/omp.c (create_task_data_t, create_task_data_reset)
	(client_state_t): Add slave elements.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add
	CREATE_TASK SLAVE handling.
	(buffer_overrides_xml): Export for upcoming slave running patch.

2010-09-07  Matthew Mundell <matthew.mundell@greenbone.net>

	Add database migration from version 26 to 27.

	* src/manage_sql.c (migrate_26_to_27): New function.
	(database_migrators): Add migrate_26_to_27.

2010-09-07  Matthew Mundell <matthew.mundell@greenbone.net>

	Add slave support to management interface.  Hence increase database
	version to 27.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 27.

	* src/manage_sql.c (create_tables): Add slave_progress to table reports.
	Add slave to table tasks.
	(init_manage): Init slave column in predefined task.
	(task_slave, set_task_slave, report_slave_progress)
	(set_report_slave_progress): New functions.
	(make_task): Init slave column.
	(target_in_use): Add slave check.

	* src/manage.h, src/manage_sql.h: Add headers accordingly.

2010-09-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_lsc_credential): Add semicolon to SQL for
	consistency.

2010-09-07  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* report_formats/simple_pie_chart/,
	report_formats/simple_pie_chart/pieplot.xsl,
	report_formats/simple_pie_chart/create_report_import,
	report_formats/simple_pie_chart/generate: New. A simple
	report format that produces a pie chart using pychart.

2010-09-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Format comments like rest of
	file.

2010-09-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (compare_ports_desc, compare_ports_asc): Remove.
	(compare_message_types_desc, compare_message_types_asc): New functions.
	Based on compare_ports_desc and compare_ports_asc.
	(print_report_xml): Get the results for the port summary sorted in the
	way the caller requested the main results.  This ensures that the correct
	results are considered if a subset of the results are requested using
	first_result or max_results.  As a result add duplicate removal to the
	threat and ROWID sorting case.

2010-09-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_result_iterator): Add sorting by ROWID.

2010-09-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Align closing brace properly.

2010-09-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (event_description): Add task name arg.  Update callers.

	* src/manage.h: Update headers accordingly.

	* src/manage_sql.c (SIMPLE_NOTICE_FORMAT): New define.
	(escalate_1): Flesh out the message body.

2010-09-02  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* report_formats/simple_topo_plot/hostvisdot-summary.xsl:
	Acticated Ports to be displayed, applied rounded boxes
	for scanned hosts and ports. Non-arrow between hosts and ports.
	Applied label everywhere even if identical with node name.

	* doc/report-format-HOWTO: Added "./" for easier c&p.

2010-09-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.h (set_task_target): Correct arg type.

2010-08-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* README: Note SIGHUP.

	* doc/openvasmd.8.xml: Add SIGNALS section.

	* doc/openvasmd.8, doc/openvasmd.html: Update from source.

2010-08-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/openvasmd.8.xml: Replace tabs with spaces.

2010-08-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (fork_update_nvt_cache): Call the rebuild version of
	update_or_rebuild_nvt_cache.

2010-08-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (update_or_rebuild_nvt_cache): Correct doc typo.

2010-08-31  Matthew Mundell <matthew.mundell@greenbone.net>

	Update the memory NVT cache on receiving SIGHUP.

	* src/manage_sql.c (update_nvt_cache, manage_update_nvti_cache): New
	functions.
	(init_manage): Setup nvti cache flag.  Move nvti cache update into
	update_nvt_cache and call update_nvt_cache.
	(set_nvts_md5sum): Queue nvti cache update.

	* src/manage_sql.h: Add header accordingly.

	* src/manage.c (manage_schedule): Update NVT cache if requested.

2010-08-31  Matthew Mundell <matthew.mundell@greenbone.net>

	Update the database NVT cache on receiving SIGHUP.

	* src/openvasmd.c (scanner_port, scanner_address_string): New variables.
	From main.
	(sighup_update_nvt_cache): New variable.
	(handle_sighup_update): New function.
	(update_or_rebuild_nvt_cache): Add flag for registering atexit handler.
	Update caller.
	(fork_update_nvt_cache): New function.
	(serve_and_schedule): Call fork_update_nvt_cache if flag set.
	(main): Use update version of SIGHUP handler.

2010-08-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (update_or_rebuild_nvt_cache): Indent comments properly.

2010-08-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (main_loop): Remove.
	(serve_and_schedule): New function.  Rename from main_loop for clarity.
	Make the @brief doc brief.  Move `if' comments about true case inside
	`if'.  Mark stranded location like others.
	(main): Space comment like others.  Mark stranded location like others.

2010-08-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/create_signatures: Only create a signature if the
	associated directory exists.

2010-08-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_report_format_iterator): Add trust_time.
	(report_format_iterator_trust_time): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_end_element): Add trust time to report format.
	Skip sending trust when exporting.

2010-08-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (sign, generate_report_format_signature): Remove.
	(init_manage): Verify the predefined report formats instead of signing
	them.

2010-08-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (find_signature): Clarify argument allocation.
	(create_report_format): Free format_signature.

2010-08-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP command VERIFY_REPORT_FORMAT.

	* src/manage_sql.c (verify_report_format): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (help_text): Add new command.
	(verify_report_format_data_t): New type.
	(verify_report_format_data_reset): New function.
	(command_data_t, client_state_t): Add new command elements.
	(verify_report_format_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add
	VERIFY_REPORT_FORMAT handling.

2010-08-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (backup_file_name): New function.
	(get_report_format_files): Leave out backup files.

2010-08-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/XML/generate: Flush trailing whitespace.

2010-08-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/report-format-HOWTO,
	report_formats/simple_bar_chart/create_report_import,
	report_formats/simple_topo_plot/create_report_import,
	report_formats/sourcefire/create_report_import: Note file ordering
	requirement.

	* src/manage.c (get_report_format_files): Order files alphabetically.

	* src/report_formats/create_signatures: Quote variable to preserve
	newlines.  Add trailing newline to content, as in Manager.

2010-08-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage): Add trust_time to SQL for last commit.

2010-08-25  Matthew Mundell <matthew.mundell@greenbone.net>

	Add report format signature verification timestamps.  Hence increase
	database version to 26.  Add database migration from version 25 to 26.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 26.

	* src/manage_sql.c (create_tables): Add signature verification time to
	table report_formats.
	(migrate_25_to_26): New function.
	(database_migrators): Add migrate_25_to_26.
	(init_manage): Init predefined format verification times.
	(create_report_format): Set verification time.

2010-08-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (run_task): Terminate array in fail case.

2010-08-24  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* report_formats/sourcefire/sourcefire.xsl
	(bid_recurse, bids): Removed work-around for parsing BID
	from description.
	(result): Direct use of new element "nvt/bid".

2010-08-24  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* report_formats/sourcefire/sourcefire.xsl
	(collapse_to_sourcefire_cve_id, cves): Removed
	work-around for parsing CVE from description.
	(result): Direct use of new element "nvt/cve".

2010-08-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage): Include CVE and BID in NVT cache.
	(result_iterator_nvt_cve, result_iterator_nvt_bid): New functions.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (buffer_results_xml): Add CVE and BID to RESULT.

2010-08-24  Michael Wiegand <michael.wiegand@greenbone.net>

	* report_formats/simple_topo_plot/hostvisdot-summary.xsl: Improved
	visualisation for routes without intermediate hosts.

2010-08-24  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* report_formats/sourcefire/,
	report_formats/sourcefire/create_report_import,
	report_formats/sourcefire/generate,
	report_formats/sourcefire/sourcefire.xsl: New.
	A report format that create Sourcefire Host Input.
	Most work done by Felix Wolfsteller.

2010-08-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_set_config_preference): Return 2 if value is
	empty with a radio and -1 if any radio option is empty.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_MODIFY_CONFIG add
	new manage_set_config_preference return case.

2010-08-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Add database migration from version 24 to 25, to rectify any
	radio NVT preference value errors caused by missing chunking
	handling in the GSA.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 25.

	* src/manage_sql.c (migrate_24_to_25): New function.
	(database_migrators): Add migrate_24_to_25.

2010-08-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/report-format-HOWTO: Improve steps slightly.

2010-08-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/create_signatures: New file.

2010-08-20  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_LSC_CREDENTIAL
	added more explanation to error text.

2010-08-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* report_formats/README: Reorder sections.  Rewrite the "Developing
	a new..." section in terms of the example report formats.

2010-08-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_lsc_credential): Limit name to alphanums.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_LSC_CREDENTIAL
	remove chars from error response.

2010-08-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (email): Pipe sendmail output to /dev/null instead of
	to temp file.

2010-08-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Add database migration from version 23 to 24, to convert task owner
	values to NULL as they may be 0 due to the 8 to 9 migrator.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 24.

	* src/manage_sql.c (migrate_23_to_24): New function.
	(database_migrators): Add migrate_23_to_24.

2010-08-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_REPORTS pipe
	generator error output to /dev/null instead of a temp file.

	* src/report_formats/PDF/generate: Pipe pdflatex output to /dev/null
	instead of temp file.

2010-08-19  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/tests/CMakeLists.txt: Removed a couple of to-be-obsolete tests,
	re-added report_format tests.

2010-08-19  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* README: Added description of other invocation of tests.

	* src/tests/CMakeLists.txt: Added new tests regarding lsc credentials
	installer packages.

	* src/tests/lsc_user_0.c: New, base for tests.

2010-08-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (migrate_1_to_2): Use generic iterator.
	(migrate_5_to_6): Define out update_all_config_caches call, as this now
	conflicts with the version 6 database.

2010-08-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (sign, find_signature): Doc missing args.

2010-08-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (migrate_21_to_22): Ensure that report_formats exists.

2010-08-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_lsc_credential): Allow - in login.

	* src/omp.c (omp_xml_handle_end_element): Add - to message in
	CLIENT_CREATE_LSC_CREDENTIAL.

2010-08-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db_postgres.sql (report_format_params, report_formats): New tables.

	* doc/db.png: Update from SQL.

2010-08-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/Doxyfile.in, doc/Doxyfile_full.in: Add doc to EXAMPLE_PATH, so that
	manual page is found.

2010-08-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/Doxyfile.in, doc/Doxyfile_full.in: Turn off "RECURSIVE", to stop the
	subdir README files from overriding the root README.

2010-08-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage): Ensure every part of the predefined
	NVT selector exists, instead of just checking if there is at least one
	part.

2010-08-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (sign): Return "" on error instead of -1.
	(init_manage): Set predefined report format trust to "unknown" instead of
	failing, on signature error.

2010-08-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (nvt_selector_remove): Add parens to SQL to get
	precedence right.

2010-08-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* ChangeLog: Add entry for last commit.

2010-08-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* report_formats/readme.txt: Remove.  Rename to README to match .. naming.

	* report_formats/README: New file.

2010-08-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* report_formats/readme.txt: Correct typos.  Fill paragraphs properly.

2010-08-12  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* report_formats/simple_topo_plot/create_report_import,
	report_formats/simple_bar_chart/create_report_import: remove temporary
	uuid file.

	* report_formats/readme.txt: New. Some words on how to create
	a import file.

2010-08-12  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/report_formats/TXT/TXT.xsl: In text report, list details for
	each issue.

	* src/tests/report_formats/expected_output/report_base.txt: Updated.

	* src/tests/report_formats/CMakeLists.txt,
	src/tests/report_formats/expected_output/report_base.html: Added
	simple test for html report format.

2010-08-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* report_formats/simple_topo_plot/create_report_import,
	report_formats/simple_bar_chart/create_report_import: Include signature.

2010-08-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Add report format signatures.  Hence increase database version to 23.
	Add database migration from version 22 to 23.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 23.

	* src/manage_sql.c (sign, generate_report_format_signature): New
	functions.
	(create_tables): Add signature and trust columns to table report_formats.
	(migrate_22_to_23): New function.
	(database_migrators): Add migrate_21_to_22.
	(init_manage): Init signature and trust of predefined formats.
	(find_signature): Add a location arg.  Update caller.
	(create_report_format): Add a signature arg.  Verify the signature or a
	signature in the feed.
	(init_report_format_iterator): Add signature and trust.
	(report_format_iterator_signature, report_format_iterator_trust): New
	functions.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (create_report_format_data_t): Add signature.
	(client_state_t): Add signature and trust.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add handling of CREATE_REPORT_FORMAT REPORT_FORMAT
	SIGNATURE and TRUST.  Add trust and signature to GET_REPORT_FORMATS
	response.

2010-08-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.h: Update header.  Missing part of 2010-08-10
	CREATE_REPORT_FORMAT commit.

2010-08-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_REPORT_FORMAT
	add missing word to error message.

2010-08-10  Matthew Mundell <matthew.mundell@greenbone.net>

	In CREATE_REPORT_FORMAT use the given UUID.

	* src/manage_sql.c (create_report_format): Require UUID as arg instead of
	generating it.

	* src/omp.c (is_uuid): New function.
	(create_report_format_data_t, create_report_format_data_reset): Add ID
	field.
	(omp_xml_handle_start_element): Parse CREATE_REPORT_FORMAT REPORT_FORMAT
	ID.
	(omp_xml_handle_end_element): In CLIENT_CREATE_REPORT_FORMAT pass ID to
	create_report_format.

2010-08-10  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* report_formats/simple_topo_plot/,
	report_formats/simple_topo_plot/hostvisdot-summary.xsl,
	report_formats/simple_topo_plot/create_report_import,
	report_formats/simple_topo_plot/generate: New.
	A report format demonstrating a simple network topology plot
	via dot. The report format was developed by
	Michael Wiegand.

2010-08-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_report_format): Remove premature free.

2010-08-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (where_levels): Remove trailing paren as false positive
	is now the final case.

2010-08-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (migrate_21_to_22): If the new dir already exists then
	simply remove the old dir.

2010-08-10  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/tests/report_formats/CMakeLists.txt: Donate unique name to test.

	* src/tests/report_formats/test_report_format: Do not use tee to keep
	meaningful exit code, cat instead. Admit bashism.

2010-08-09  Matthew Mundell <matthew.mundell@greenbone.net>

	Use the UUIDs of report formats for the names of the directories on
	disk.  Reference report formats in GET_REPORTS by UUID instead of name.
	Hence increase database version to 22.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 22.

	* src/CMakeLists.txt: Install report formats to UUID directories.

	* src/manage_sql.c (migrate_21_to_22): New function.
	(database_migrators): Add migrate_21_to_22.
	(init_manage): Use predefined UUIDs for the predefined report formats.
	(create_report_format, delete_report_format): Use UUID for report format
	dir instead of name.

	* src/manage.c (get_report_format_files): Add dir name to error message.
	(init_report_format_file_iterator): Use UUID for report format dir instead
	of name.

	* src/omp.c (get_reports_data_t, get_preferences_data_reset)
	(omp_xml_handle_start_element): Rename format to format_id.
	(omp_xml_handle_end_element): In CLIENT_GET_REPORTS expect report format
	as UUID instead of name, and respond with ID instead of name.

2010-08-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_task_iterator): Include example task when a task
	ID is given.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_REPORTS check
	chdir return to quiet compiler.

2010-08-09  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* report_formats/, report_formats/simple_bar_chart/,
	report_formats/simple_bar_chart/plot.xsl,
	report_formats/simple_bar_chart/plot.plt,
	report_formats/simple_bar_chart/generate,
	report_formats/simple_bar_chart/create_report_import: New.
	A report format demonstrating a simple plot
	with gnuplot. The report format was developed by
	Matthew Mundell.
	Running create_report_import will create a
	xml file that can be imported as report format.
	The creation process for this xml file is coarse
	and need a more generic approach.

2010-08-09  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* doc/openvasmd.8.xml: Fixed typo.

	* doc/openvasmd.html, doc/openvasmd.8: Updated.

2010-08-09  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* doc/openvasmd.html, doc/openvasmd.8: Updated.

2010-08-08  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* doc/openvasmd.8.xml: Fixed typo and improved general
	description.

2010-08-07  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/CMakeLists.txt: Install TXT report.

	* src/manage_sql.c (init_manage): Adding default meta data
	for "TXT" report format.

2010-08-07  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/report_formats/LaTeX/, src/report_formats/LaTeX/generate: New.

	* src/report_formats/LaTeX/latex.xsl: New. Moved from PDF directory.

	* src/report_formats/PDF/latex.xsl: Moved away to LaTeX directory.

	* src/CMakeLists.txt: Install LaTeX report. Adapt file for
	PDF installation.

	* src/manage_sql.c (init_manage): Adding default meta data
	for "LaTeX" report format.

2010-08-06  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/report_formats/TXT, src/report_formats/TXT/generate,
	src/report_formats/TXT/TXT.xsl: Added first part of text report
	generator.

2010-08-06  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/report_formats/NBE/NBE.xsl: Fixed to conform old nbe format.

2010-08-06  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/report_formats/HTML/generate, src/report_formats/CPE/generate,
	src/report_formats/NBE/generate, src/report_formats/PDF/generate:
	Remove trailing whitespace, fixed typo.

2010-08-06  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Added test for upcoming text report format.

	* src/tests/report_formats/CMakeLists.txt: Declare new test.

	* src/tests/report_formats/expected_output/report_base.txt: New file.

2010-08-06  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Add simple setup to check report format outputs against expected
	output. Added testing suite consisting of a single, simple test.

	* src/tests/CMakeLists.txt: Add report_formats testing subdirectory.

	* src/tests/report_formats, src/tests/report_formats/CMakeLists.txt,
	src/tests/report_formats/expected_output,
	src/tests/report_formats/generated_output,
	src/tests/report_formats/input, src/tests/report_formats/README,
	src/tests/report_formats/test_report_format: New, test infrastructure.

	* src/tests/report_formats/input/report_base.xml,
	src/tests/report_formats/expected_output/report_base.nbe: New, data for
	test.

2010-08-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/report-format-HOWTO: Convert tabs to spaces.

2010-08-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/report-format-HOWTO: New file.

2010-08-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (nvt_preference_iterator_config_value): Add ordering
	by type to SQL in case a broken GSA filled the database with server
	preferences with the NVT preference name.

2010-08-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (nvt_preference_iterator_config_value): Remove type
	constraint from SQL, as the preference may also be a server pref.  This
	reverts r8583.

2010-08-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Remove quotation marks from
	CLIENT_RESUME_OR_START_TASK error responses.

2010-08-05  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/CMakeLists.txt: Adding install targets for ITG.

	* src/manage_sql.c (init_manage): Adding default meta data
	for "ITG" report format.

	* src/report_formats/ITG/, src/report_formats/ITG/ITG.xsl,
	src/report_formats/ITG/generate: Report generator for
	ITG by Matthew Mundell.

2010-08-04  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/CMakeLists.txt: Adding install targets for CPE.

	* src/manage_sql.c (init_manage): Adding default meta data
	for "CPE" report format.

	* src/report_formats/CPE/, src/report_formats/CPE/generate,
	src/report_formats/CPE/CPE.xsl: Report generator for
	CPE by Matthew Mundell.

2010-08-04  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/CMakeLists.txt: Adding install targets for PDF.

	* src/manage_sql.c (init_manage): Adding default meta data
	for "PDF" report format.

	* src/report_formats/PDF/, src/report_formats/PDF/latex.xsl,
	src/report_formats/PDF/generate: Report generator for
	PDF by Felix Wolfsteller.

2010-08-04  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/CMakeLists.txt: Replace tabs by spaces and thus
	fix indenting.

2010-08-04  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/report_formats/HTML/HTML.xsl: Removed URLs into gsa
	service. These do not make sense for a report export.

2010-08-04  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/CMakeLists.txt: Adding install targets for HTML and NBE.

2010-08-04  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/manage_sql.c (init_manage): Adding default meta data for "HTML"
	report format.

	* src/report_formats/HTML/, src/report_formats/HTML/HTML.xsl,
	src/report_formats/HTML/generate: Report generator for
	HTML by Matthew Mundell.

2010-08-04  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/manage_sql.c (init_manage): Adding default meta data for "NBE"
	report format.

	* src/report_formats/NBE/,  src/report_formats/NBE/NBE.xsl,
	src/report_formats/NBE/generate: New. Report generator for
	NBE by Matthew Mundell.

2010-08-04  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/report_formats/XML/generate: Fixed/improved description
	and added Author section.

2010-07-29  Matthew Mundell <matthew.mundell@greenbone.net>

	Make the report framework use loadable report formats.

	Remove all previous report formats.  Add new predefined loadable report
	format XML.

	As a result add new OMP commands CREATE_REPORT_FORMAT,
	DELETE_REPORT_FORMAT and GET_REPORT_FORMATS.

	* src/CMakeLists.txt: Remove old report XSL installs.  Add XML report
	XSL install.

	* src/manage.c (get_report_format_files, init_report_format_file_iterator)
	(cleanup_file_iterator, next_file, file_iterator_name)
	(file_iterator_content_64): New functions.

	* src/manage_sql.c (user_owns): New function.
	(create_tables): Add tables report_formats and report_format_params.
	(init_manage): Ensure predefined report format XML exists.
	(find_report_format, lookup_report_format, create_report_format)
	(delete_report_format, report_format_uuid, report_format_name)
	(report_format_global)
	(init_report_format_iterator, report_format_iterator_report_format)
	(report_format_iterator_uuid, report_format_iterator_name)
	(report_format_iterator_extension, report_format_iterator_content_type)
	(report_format_iterator_summary)
	(report_format_iterator_description, report_format_iterator_global)
	(init_report_format_param_iterator, report_format_param_iterator_name)
	(report_format_param_iterator_value): New
	functions.  Interface to report formats.

	* src/manage.h: Add headers accordingly.
	(report_format_t, file_iterator_t): New types.

	* src/omp.c (file_utils_rmdir_rf): Export for manage_sql.c.
	(help_text): Add report format commands.
	(create_report_format_data_t, delete_report_format_data_t)
	(get_report_formats_data_t): New report format types.
	(create_report_format_data_reset, delete_report_format_data_reset)
	(get_report_formats_data_reset): New report format functions.
	(command_data_t): Add report format fields.
	(create_report_format_data, delete_report_format_data)
	(get_report_formats_data): New report format variables.
	(client_state_t): Add states for report format commands.
	(omp_xml_handle_start_element): Add report format commands handling.
	(PRINT): New macro.  Helper for print_report_xml.
	(print_report_xml): Switch to fuller XML format previously sent for "xml"
	format.
	(next_break, latex_print_verbatim_text, latex_escape_text)
	(latex_severity_heading, latex_severity_colour, latex_header)
	(latex_footer, print_report_notes_latex, print_report_overrides_latex)
	(print_report_latex): Remove.  Replaced by Felix's XSL.
	(omp_xml_handle_end_element): Add report format commands handling.  In
	particular in CLIENT_GET_REPORTS remove previous static report generation
	cases and add a single generic generator.
	(omp_xml_handle_text): Add report format commands handling.

	* src/ITG.xsl, src/CPE.xsl, src/openvasmd_report_html.xsl: Remove.

	* src/report_formats/, src/report_formats/XML/,
	src/report_formats/XML/generate: New dir and files.  Report generator for
	XML report format.

2010-07-29  Michael Wiegand <michael.wiegand@greenbone.net>

	Post branch version bump.

	* CMakeLists.txt: Updated version number.

2010-07-29  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number.

2010-07-29  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 1.0.0 release.

	* CHANGES: Updated.

	* CMakeLists.txt: Updated version number.

2010-07-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (nvt_preference_iterator_config_value): Add type
	constraint to SQL in case a broken GSA filled the database with server
	preferences with the NVT preference name.

2010-07-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* TODO: Remove entry about FIXes in code.

	* README: Neaten About section.  In particular, use either the module name
	like "openvas-cli" or the proper name "OpenVAS CLI", instead of mixing the
	two, like in "OpenVAS-CLI".

2010-07-24  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* README: Slightly extended general description of module.

2010-07-24  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* INSTALL: Fixed min. version of openvas-libraries.

2010-07-22  Michael Wiegand <michael.wiegand@greenbone.net>

	* CMakeLists.txt: Fixed openvas-libraries version detection.

2010-07-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (nvt_selector_plugin): Remove extra semicolon.

	* src/manage_sql.c (create_agent): Free installer and signature on error.

	* src/omp.c (print_report_latex): Note memory leak.

	* src/splint.h (uuid_error, uuid_create, uuid_export): Remove.  From
	previous UUID library.

2010-07-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (report_count, report_counts_id): Add host limiter arg.
	Update callers.

	* src/manage.h: Update header accordingly.

	* src/omp.c (print_report_latex, omp_xml_handle_end_element): Pass host to
	report_counts_id.

2010-07-21  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/manage_sql.h: Formatted using indent.

	* src/lsc_user.c (get_rpm_generator_path),
	src/omp.c (buffer_results_xml): Tiny improvements of doc.

	* src/tests/CMakeLists.txt: Lowercased commands.

2010-07-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c: Convert all FIX comments to @todo's.
	(stop_task, pause_task, resume_paused_task, resume_stopped_task)
	(manage_check_current_task): Remove FIXes about credential checks, because
	the argument is a task_t so the credentials will have been checked already.

	* src/omp.c: Convert all FIX comments to @todo's.
	(omp_xml_handle_start_element): Remove FIX about checking for a
	reauthentication, as this would just complicate things.

	* src/ompd.c: Convert all FIX comments to @todo's.
	(serve_omp): Remove FIX about time as argument is always NULL.

	* src/manage.h, src/manage_sql.c, src/omp.h, src/ompd.h, src/openvasmd.c,
	src/otp.c, src/otp.h, src/ovas-mngr-comm.c, src/oxpd.c, src/splint.h,
	src/tests/read_protocol_0.c, src/tests/timeout_0.c: Convert all FIX comments
	to @todo's.

2010-07-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/oxpd.c: Remove FIX about making offset variables pointers, as they
	are fully entrenched as integers now.

2010-07-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (OPENVASMD_VERSION, OPENVAS_OS_NAME): Set to -1.
	(serve_client, accept_and_maybe_fork, fork_connection_for_schedular)
	(main): Remove FIXes about getting the previous socket flags value, as
	the sockets are all used locally.

2010-07-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (restore_db): Remove.
	(manage_migrate): Remove outline for backing up database around migration,
	as the SQL transactions have the same effect.

2010-07-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage_process): Remove FIXes on aborts, as
	they're consistent with the rest of the function.

	* src/omp.c (send_nvt): Remove FIX about old spec.
	(print_report_latex): Correct ordering comment.

	* src/otp.c (parse_scanner_server, process_otp_scanner_input): Make
	abort legitimate behaviour for out of memory failures.

2010-07-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (make_task): Abort on memory failure.
	(append_to_task_comment, append_to_task_name)
	(add_task_description_line): Remove returns.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (omp_xml_handle_start_element): Remove old assertion.
	Remove return checks for make_task and add_task_description_line.

2010-07-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ompd.c: Format @todo like others.

2010-07-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c, src/ompd.c, src/openvasmd.c, src/ovas-mngr-comm.c: Convert
	"\todo"s to "@todo"s.  Remove \todo about performance.

2010-07-19  Michael Meyer <michael.meyer@greenbone.net>

	* src/tests/new_task_small_rc,
	src/tests/new_task_small__many_plugins_yes_rc,
	src/tests/new_task_medium_rc,
	src/tests/new_task_small__missing_targets_rc:
	Removed references to nonexistent OIDs. Changed OID 10180 to 100315.

2010-07-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* TODO: Update.

2010-07-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (make_task): Quote name and comment for SQL.  Add
	quotation marks around name in SQL.

2010-07-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/lsc_user.c, src/manage_sql.c, src/omp.c, src/otp.c, src/otpd.c,
	src/oxpd.c: Convert "TODO"s to "@todo"s.  Remove TODO about efficiency.

2010-07-16  Stephan Kleine

	* src/manage_sql.c (escalate_1): Fix some "format not a string
	literal and no format arguments" error.

2010-07-16  Michael Wiegand <michael.wiegand@greenbone.net>

	* CMakeLists.txt: Replace check for PREPARE_RELEASE with check for
	CMAKE_BUILD_TYPE == "Release".

2010-07-16  Michael Wiegand <michael.wiegand@greenbone.net>

	Post-release version bump.

	* CMakeLists.txt: Updated version number.

2010-07-16  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 1.0.0.rc1 release.

	* CHANGES: Updated.

	* CMakeLists.txt: Updated version number.

2010-07-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/openvasmd.8, doc/openvasmd.html: Update from source.

2010-07-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db_postgres.sql (agents, nvts): Add new columns.
	(escalators, targets, configs, lsc_credentials): Add UUID column.
	(overrides): New table.

	* doc/db.png: Update from SQL.

2010-07-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c, src/omp.c, src/ompd.c, src/openvasmd.c,
	src/otp.c: Bring static docs up to date.

2010-07-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/Doxyfile.in, doc/Doxyfile_full.in: Add expansion of DEF_ACCESS
	macro.  Replace tasks_sql.h with manage_sql.c.

	* src/manage_sql.c: Bring docs up to date.

2010-07-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (create_note_data_t, create_note_data_reset): Remove note_id.
	(create_override_data_t, create_override_data_reset): Remove override_id.
	(modify_note_data_t, modify_note_data_reset, modify_override_data_t)
	(modify_override_data_reset): Implement directly, instead of shadowing
	create counterparts.

2010-07-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.h, src/openvasmd.c, src/omp.c: Bring docs up to date.

	* src/manage_sql.c: Add @file doc.

2010-07-15  Matthew Mundell <matthew.mundell@greenbone.net>

	Try flush the to_client buffer when it fills up during OMP processing.

	* src/omp.c (omp_parser_t): New type.
	(omp_parser_new, omp_parser_free): New functions.
	(send_to_client): Add write_to_client callback and data args.  If the
	buffer is too full for the message, try write the buffer to the client.
	Update all callers.
	(send_element_error_to_client, send_find_error_to_client): Add passthrough
	args for send_to_client.  Update all callers.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Expect
	write_to_client callback and data arg in user_data arg via an omp_parser.
	(send_requirement, send_dependency): Expect write_to_client callback and
	data arg in data arg.  Update callers.
	(send_nvt, send_reports): Add write_to_client callback and data arg args.
	Update callers.
	(init_omp_process): Add write_to_client callback and data arg args.  Set
	omp_parser as callback user data.
	(process_omp_client_input): Add note about return.

	* src/omp.h: Update header accordingly.

	* src/ompd.c (init_ompd_process, serve_omp): Pass client writer and data
	to init_omp_process.  Extend complications comment.

2010-07-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Reduce GET_VERSION to single fixed version.  Enable GET_VERSION before
	authentication.

	* src/omp.c (client_state_t): Add CLIENT_GET_VERSION_AUTHENTIC.
	(omp_xml_handle_start_element): Add GET_VERSION check to CLIENT_TOP.
	Improve first command error message.  Close a single COMMANDS if in
	one or more COMMANDS when the first command error occurs.  Use new
	special state for GET_VERSION after authenticate.
	(omp_xml_handle_end_element): Reduce GET_VERSION response.  Check which
	state to use after GET_VERSION.

2010-07-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd_report_html.xsl (report): Leave sorting to Manager.

2010-07-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Make GET_SYSTEM_REPORTS more like other commands.

	* src/manage.c (get_system_report_types): Add required_type and start
	arguments, to limit to a single type.
	(init_system_report_type_iterator): Add type argument.

	* src/manage.h: Add header accordingly.

	* src/omp.c (get_system_report_data_t): Add brief.
	(omp_xml_handle_start_element): Parse GET_SYSTEM_REPORTS brief attrib.
	(omp_xml_handle_end_element): In CLIENT_GET_SYSTEM_REPORTS return all
	reports if name is NULL and skip the report images if brief is true.

2010-07-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_agent_iterator): Add installer_filename to
	columns.  Adjust accessors accordingly.
	(agent_iterator_installer_filename): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_AGENTS add
	FILENAME to PACKAGE for installer.

2010-07-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (find_signature): Change extension to "asc".

	* INSTALL: Correct xsltproc name.

2010-07-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/CMakeLists.txt: Add OPENVAS_LIB_INSTALL_DIR define to definitions.

	* src/manage_sql.c (find_signature): New function.
	(create_agent): Check feed signature if the given signature is empty.

2010-07-09  Matthew Mundell <matthew.mundell@greenbone.net>

	Move installer_filename addition from database version 20 to new version
	21.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 21.

	* src/manage_sql.c (migrate_19_to_20): Remove addition of
	installer_filename column.
	(migrate_20_to_21): New function.
	(database_migrators): Add migrate_20_to_21.

2010-07-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (task_threat_level, task_previous_threat_level): Take
	overrides into account, so that condition_met and hence escalation also
	do.

2010-07-07  Matthew Mundell <matthew.mundell@greenbone.net>

	Extend agents with installer filenames.  Bundle this change into the 19
	to 20 migrator.

	* src/manage_sql.c (create_tables): Add installer_filename to table agents.
	(migrate_19_to_20): Add installer_filename column.
	(create_agent): Add installer_filename arg.  Store filename in db.

	* src/manage.h: Update header accordingly.

	* src/omp.c (create_agent_data_t, create_agent_data_reset)
	(client_state_t): Add CREATE_AGENT INSTALLER/FILENAME element.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add CREATE_AGENT INSTALLER/FILENAME handling.

2010-07-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (main): Set GNUPGHOME.

2010-07-07  Michael Wiegand <michael.wiegand@greenbone.net>

	* CMakeLists.txt: Make cmake environment more flexible as discussed on
	openvas-devel: Set CMAKE_BUILD_TYPE only to "Debug" if it is not
	already set. Do not set CMAKE_VERBOSE_MAKEFILE, let it default to OFF.
	Remove redundant flags from CMAKE_C_FLAGS_DEBUG.

2010-07-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_agent): Init sizes.  Use known installer size.

2010-07-06  Matthew Mundell <matthew.mundell@greenbone.net>

	Add database migration from version 19 to 20.

	* src/manage_sql.c (migrate_19_to_20): New function.
	(database_migrators): Add migrate_19_to_20.

2010-07-06  Matthew Mundell <matthew.mundell@greenbone.net>

	Extend agents with signatures.  Hence increase database version to 20.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 20.

	* src/manage_sql.c (TRUST_ERROR, TRUST_YES, TRUST_NO, TRUST_UNKNOWN): New
	defines.
	(create_tables): Add installer_64, installer_signature_64 and
	installer_trust to table agents.
	(verify_signature): New function.
	(create_agent): Add installer_signature_64 arg.  Rename installer arg to
	installer_64.  Verify the signature if given.  Store the result of the
	verification and store the plain version of the installer alongside the
	base64 version.
	(init_agent_iterator): Use new base64 installer column, add installer
	trust column.  Adjust accessors accordingly.
	(agent_iterator_trust): New function.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (create_agent_data_t, create_agent_data_reset)
	(client_state_t): Add CREATE_AGENT INSTALLER/SIGNATURE element.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add
	CREATE_AGENT INSTALLER/SIGNATURE handling and add INSTALLER/TRUST to the
	GET_AGENTS brief response.

2010-07-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (buffer_overrides_xml): Add THREAT to terse case.

2010-07-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (backup_db): Make arg const.
	(manage_backup_db): Make arg const.  Add fallback database name.
	(manage_migrate): Temporarily turn off backup and restore.

	* src/manage.h: Update header accordingly.

2010-07-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (escalator_method_name, escalator_method_from_name): Add
	syslog method.

	* src/manage.h (escalator_method_t): Add syslog method.

	* src/manage_sql.c (escalate_1): Add syslog method case.

	* src/openvasmd_log_conf.cmake_in (event syslog, event snmp): New groups.

2010-07-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Add a --backup option.

	* src/manage_sql.c (backup_db): Add args and implementation.  Make static.
	(manage_backup_db): New function.
	(manage_migrate): Turn off backup temporarily.

	* src/manage.h: Add header accordingly.

	* src/openvasmd.c (main): Add --backup option with calls manage_backup_db.

2010-07-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd_report_html.xsl (report): Add False Positive column.

2010-07-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Add false positive "threat" for overrides.

	* src/manage.c (threat_message_type, message_type_threat): Add False
	Positive.

	* src/manage_sql.c (collate_threat, task_threat_level)
	(where_levels, task_previous_threat_level): Add False Positive.
	(init_result_iterator, report_counts, report_counts_id): Add false
	positive arg.  Update callers.
	(create_override): Check new_threat too.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (result_type_threat): Add False Positive.
	(send_reports, omp_xml_handle_end_element): Send FALSE_POSITIVE in
	REPORT/RESULT_COUNT.

2010-06-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_NVTS,
	CLIENT_GET_REPORTS and CLIENT_GET_TASKS cleanup iterator in fail cases.

2010-06-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (create_target_data_t, create_target_data_reset)
	(client_state_t): Rename target locator elements with target locator
	prefix.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Adjust handlers for renaming.  Change
	GET_TARGET_LOCATORS/TARGET_LOCATOR/@name to an entity.

2010-06-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (create_note_data_t, create_note_data_reset)
	(create_override_data_t, create_override_data_reset): Rename task to
	task_id.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Expect CREATE_NOTE, CREATE_OVERRIDE, MODIFY_NOTE,
	MODIFY_OVERRIDE TASK ID in attribute instead of text, to match other
	CREATE and MODIFY commands.

2010-06-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (create_note_data_t, create_note_data_reset)
	(create_override_data_t, create_override_data_reset): Rename nvt to
	nvt_oid, result to result_id.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Expect CREATE_NOTE, CREATE_OVERRIDE, MODIFY_NOTE,
	MODIFY_OVERRIDE NVT and RESULT ids in attribute instead of text, to match
	other CREATE and MODIFY commands.

2010-06-30  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Add event logging to
	protocol events.

2010-06-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c: Neaten internal doc slightly.

2010-06-29  Matthew Mundell <matthew.mundell@greenbone.net>

	Move NVT and TASK in GET_NOTES and GET_OVERRIDES to attributes nvt_oid
	and task_id, to match other GET commands.

	* src/omp.c (client_state_t): Remove NVT and TASK elements.
	(omp_xml_handle_start_element): Add nvt_oid and task_id parsing.  Remove
	NVT and TASK handling.
	(omp_xml_handle_end_element): Remove NVT and TASK handling.

2010-06-29  Matthew Mundell <matthew.mundell@greenbone.net>

	Rename "oid" attributes to "nvt_oid".

	* src/omp.c (get_dependencies_data_t, get_dependencies_data_reset)
	(get_nvts_data_t, get_nvts_data_reset, get_preferences_data_t)
	(get_preferences_data_reset): Rename oid to nvt_oid.  Update caller.
	(omp_xml_handle_start_element): Rename oid to nvt_oid in GET_DEPENDENCIES,
	GET_NVTS an GET_PREFERENCES.

2010-06-29  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/manage_sql.c (set_task_run_status): Add event logging to run
	status changes.

2010-06-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_DELETE_LSC_CREDENTIAL
	and CLIENT_DELETE_TARGET correct command name in structure and message.

2010-06-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (help_text, client_state_t, omp_xml_handle_start_element)
	(omp_xml_handle_end_element): Comment out GET_CERTIFICATES.

2010-06-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (get_targets_data_t): Add tasks.
	(client_state_t): Move TARGET_LOCATORS into order.
	(omp_xml_handle_start_element): Parse GET_TARGETS/@tasks.
	(omp_xml_handle_end_element): Make GET_TARGETS TASKS depend on "tasks"
	attrib, and only include the enclosing element if the attrib is present.

2010-06-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_system_report): Use 86400 if duration is NULL.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_SYSTEM_REPORTS
	add a name check and use 86400 if duration is missing.

2010-06-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_result_iterator): Add all results case.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_RESULTS remove the
	single result restriction.  In CLIENT_GET_LSC_CREDENTIALS add NULL checks
	to the format cases.

2010-06-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (send_reports): Leave TIMESTAMP alone.  It's the report
	creation time, whereas SCAN_START is the start time sent by the Scanner.

2010-06-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (client_state_t, omp_xml_handle_start_element)
	(omp_xml_handle_end_element): Rename CLIENT_VERSION to CLIENT_GET_VERSION.

2010-06-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (send_reports): Rename MESSAGES to RESULT_COUNT.
	(omp_xml_handle_end_element): In CLIENT_GET_REPORTS rename
	SCAN_RESULT_COUNT to RESULT_COUNT, move threat counts into that
	entity, and rename MESSAGES to RESULT_COUNT.

2010-06-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_TASKS correct
	TASK/CONFIG uuid and name, which were swapped.

2010-06-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_REPORTS always
	exit on internal error within the loop.

2010-06-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Remove GET_RULES.

	* src/omp.c (help_text, client_state_t): Remove GET_RULES element.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Remove
	GET_RULES handling.

2010-06-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_report_iterator): Add report arg.
	(report_iterator_uuid): New function.

	* src/manage.h: Update headers accordingly.

	* src/manage.c (delete_reports): Update init_report_iterator call.

	* src/omp.c (internal_error_send_to_client): New function.
	(send_reports): Update init_report_iterator call.
	(omp_xml_handle_end_element): In CLIENT_GET_REPORTS add the case that
	responds with all reports.

2010-06-25  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/manage_sql.c (escalate_1): Added event logging to escalator
	execution.

2010-06-24  Matthew Mundell <matthew.mundell@greenbone.net>

	Rename GET_REPORT to GET_REPORTS.

	* src/omp.c (help_text, client_state_t, command_data_t): Rename
	GET_REPORT element.
	(get_report_data_t, get_report_data_reset, get_report_data): Remove.
	(get_reports_data_t, get_reports_data_reset, get_reports_data): New.  Renamed
	from "get_report" counterparts.
	(omp_xml_handle_start_element, send_reports, print_report_xml)
	(print_report_latex, omp_xml_handle_end_element): Rename GET_REPORTS.

2010-06-24  Matthew Mundell <matthew.mundell@greenbone.net>

	Add oid attribute to GET_DEPENDENCIES.

	* src/omp.c (get_dependencies_data_t): New type.
	(get_dependencies_data_reset): New function.
	(command_data_t): Add get_dependencies.
	(get_dependencies_data): New variable.
	(omp_xml_handle_start_element): Parse GET_DEPENDENCIES oid attrib.
	(omp_xml_handle_end_element): In CLIENT_GET_DEPENDENCIES add single NVT
	case.

2010-06-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (send_requirement): Replace NEED with NVT.
	(send_dependency): Replace DEPENDENCY/NEEDER with NVT/REQUIRES and move
	the requirement into the REQUIRES.

2010-06-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (send_nvt): Leave closing tag to caller.
	(omp_xml_handle_end_element): In CLIENT_GET_NVTS send prefs inside NVT.

2010-06-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_nvt_iterator): Improve family arg doc.
	Add assertion.

	* src/omp.c (get_nvts_data_t): Add new flag attribs.
	(omp_xml_handle_start_element): Parse new flags attribs.
	(omp_xml_handle_end_element): In CLIENT_GET_NVTS integrate the single NVT
	case into the multiple NVTs case, using new details flags.

2010-06-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_NVTS integrate the
	brief case into the details case.

2010-06-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Rename GET_NVT_DETAILS to GET_NVTS.

	* src/omp.c (help_text, client_state_t, command_data_t): Rename
	GET_NVT_DETAILS element.
	(get_nvt_details_data_t, get_nvt_details_data_reset)
	(get_nvt_details_data): Remove.
	(get_nvts_data_t, get_nvts_data_reset, get_nvts_data): New.  Renamed from
	"nvt_details" counterparts.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Rename
	GET_NVT_DETAILS.

2010-06-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Merge GET_NVT_ALL into GET_NVT_DETAILS.

	* src/omp.c (help_text): Remove GET_NVT_ALL.  Improve GET_NVT_DETAILS.
	(get_nvt_details_data_t): Add details.
	(client_state_t): Remove GET_NVT_ALL state.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Move
	GET_NVT_ALL handling into GET_NVT_DETAILS.

2010-06-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_MODIFY_TASK improve
	FILE name error message.

2010-06-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Replace MODIFY_REPORT PARAMETER element with COMMENT, to better match
	other modifier commands.

	* src/omp.c (modify_task_data_t, modify_task_data_reset): Remove parameter_id
	and parameter_value.  Add comment.
	(client_state_t): Remove PARAMETER state.  Add COMMENT state.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Remove PARAMETER handling.  Add COMMENT handling.

	* src/manage_sql.c (set_report_parameter): Make value param const.

	* src/manage.h: Update header accordingly.

2010-06-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_task_update_file): Remove extra doc param.

2010-06-22  Matthew Mundell <matthew.mundell@greenbone.net>

	Remove redundant MODIFY_TASK PARAMETER element.

	* src/omp.c (modify_task_data_t, modify_task_data_reset): Remove parameter
	and value.
	(client_state_t): Remove PARAMETER state.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Remove PARAMETER handling.

2010-06-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (client_state_t, omp_xml_handle_start_element)
	(omp_xml_handle_end_element, omp_xml_handle_text): Include AUTHENTICATE
	in CREDENTIALS state name.

2010-06-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (help_text, command_data_t): Move STOP_TASK entry into
	alphabetical order.
	(stop_task_data_t, stop_task_data_reset, stop_task_data): Move into
	alphabetical order.
	(client_state_t): Move CLIENT_STOP_TASK into alphabetical order.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Move STOP_TASK
	cases into alphabetical order.

2010-06-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (manage_schedule): Call omp_stop_task instead of
	omp_abort_task.

2010-06-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (create_agent_data_reset): Correct name in doc.

2010-06-22  Matthew Mundell <matthew.mundell@greenbone.net>

	Rename OMP ABORT_TASK to STOP_TASK.

	* src/omp.c (help_text): Rename STOP_TASK.
	(abort_task_data_t, abort_task_data_reset, abort_task_data): Remove.
	(stop_task_data_t, stop_task_data_reset, stop_task_data): New.  Renamed
	with "stop" instead of "abort".
	(command_data_t): Replace abort_task with stop_task.
	(client_state_t): Replace CLIENT_ABORT_TASK with CLIENT_STOP_TASK.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Rename for
	STOP_TASK.

2010-06-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_lsc_credential): Add '_' to chars allowed in
	login name.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_LSC_CREDENTIAL
	correct login char error message.

2010-06-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (task_trend): Add override flag.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_TASKS pass
	apply_overrides to task_trend.

2010-06-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (report_scan_result_count): Add override flag.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_REPORT pass
	apply_override to report_scan_result_count.

2010-06-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_TASKS send
	APPLY_OVERRIDE alongside SORT in response.

2010-06-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Add an apply_override attribute to GET_TASKS.

	* src/omp.c (get_tasks_data_t): Add apply_overrides.
	(omp_xml_handle_start_element): Parse apply_overrides for GET_TASKS.
	(send_reports): Add apply_overrides arg.
	(omp_xml_handle_end_element): In CLIENT_GET_TASKS apply overrides
	according to apply_overrrides.

2010-06-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (get_report_data_t, get_results_data_t): Add apply_overrides.
	(omp_xml_handle_start_element): Parse apply_overrides for GET_REPORT and
	GET_RESULTS.
	(print_report_xml, print_report_latex, omp_xml_handle_end_element): Apply
	overrides according to "apply_overrides" instead of "overrides".

2010-06-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (help_text, get_tasks_data_t, get_tasks_data_reset)
	(get_tasks_data): Move into alphabetical order.
	(command_data_t): Move get_tasks into alphabetical order.
	(client_state_t): Move CLIENT_GET_TASKS into alphabetical order.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Move GET_TASKS
	cases into alphabetical order.

2010-06-18  Matthew Mundell <matthew.mundell@greenbone.net>

	Rename GET_STATUS to GET_TASKS.

	* src/omp.c (help_text): Rename GET_STATUS.
	(get_status_data_t, get_status_data_reset, get_status_data): Remove.
	(get_tasks_data_t, get_tasks_data_reset, get_tasks_data): New.  Renamed
	with "tasks" instead of "status".
	(command_data_t): Replace get_status with get_tasks.
	(client_state_t): Replace CLIENT_GET_STATUS with CLIENT_GET_TASKS.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Rename for
	GET_TASKS.

2010-06-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_task_iterator): Add UUID to SQL.
	(task_iterator_uuid): New function.  Adjust other accessors accordingly.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_STATUS add the
	single task case to the all tasks loop, allowing the all tasks case to
	respect the details attribute.

2010-06-17  Matthew Mundell <matthew.mundell@greenbone.net>

	Add a details attribute to GET_STATUS.

	* src/omp.c (get_status_data_t): Add details field.
	(omp_xml_handle_start_element): Parse details attribute for GET_STATUS.
	(omp_xml_handle_end_element): In CLIENT_GET_STATUS for the single task
	case, only send the detailed format if the details attrib was present,
	otherwise send the summary format as with the all tasks case.

2010-06-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_task_iterator): Add task arg.  Update caller.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_STATUS update
	init_task_iterator call.

2010-06-17  Matthew Mundell <matthew.mundell@greenbone.net>

	Replace task_iterator_t with the generic iterator_t.

	* src/manage_sql.c (migrate_8_to_9): Replace task iteration with single
	statement.
	(init_task_iterator): Expect an iterator_t.
	(cleanup_task_iterator, next_task): Remove.
	(task_iterator_task, task_iterator_run_status): New functions.
	(init_manage): Use new task iterator and accessors.

	* src/manage.h: Update headers accordingly.
	(task_iterator_t): Remove.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_STATUS use new
	task iterator.

2010-06-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (print_tasks): Remove.  Out of use.

2010-06-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_STATUS leave the
	empty string case for find_task to find, as in the other GET commands.

2010-06-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (CONFIG_UUID_FULL_AND_VERY_DEEP_ULTIMATE): Indent.

2010-06-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_TASK
	include ID in response as attribute instead of as entity.

2010-06-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_TARGET
	include ID in response.

2010-06-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_override): Add override return arg.
	(override_uuid): New function.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_OVERRIDE and
	CLIENT_CREATE_SCHEDULE include ID in response.

2010-06-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_note): Add note return arg.
	(note_uuid): New function.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_NOTE include
	ID in response.

2010-06-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (XML_OK_CREATED_ID): Drop create prefix.
	(omp_xml_handle_end_element): In CLIENT_CREATE_AGENT add create prefix.

2010-06-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_lsc_credential): Add credential return arg.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_LSC_CREDENTIAL
	include ID in response.

2010-06-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_escalator): Add escalator return param.
	(escalator_uuid): New function.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_ESCALATOR
	include ID in response.

2010-06-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_config): Create uuid param with config param.
	(config_uuid): New function.
	(create_config_rc): Rename uuid to selector_uuid.  Add UUID to INSERT.
	(copy_config): Add config return param.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_CONFIG include
	ID in response.

2010-06-17  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* doc/openvasmd.8.xml: Updated link.

2010-06-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_result_iterator, report_count): Sort override
	selection, giving the override constraints a precedence ordering.

2010-06-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_result_iterator, report_count): Also check task
	constraint when selecting override.

2010-06-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd_report_html.xsl (result [issue]): Skip CVSS if overridden.

2010-06-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (latex_severity_header): Drop prefix.  Add Log check.
	(print_report_latex): Add override to result heading.

2010-06-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd_report_html.xsl (override): New template.
	(result [issue]): Add override to result heading.  Add override boxes.

2010-06-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (print_report_latex): Note override state in report.

2010-06-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (latex_header): Add override colour.
	(print_report_overrides_latex): Add threat to override heading.

2010-06-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Add threat overrides.

	* src/manage_sql.c (create_tables): Add table overrides.
	(where_levels_type): New function.
	(init_result_iterator): Add override flag.
	(result_iterator_original_type): New function.  Adjust other accessors
	accordingly.
	(report_scan_result_count): Use where_levels_type.
	(REPORT_COUNT): Remove.  Replace with report_count.
	(report_count): New function.  Counts reports with override.
	(report_counts, report_counts_id): Add override flag.  Adjust callers.
	(find_override, create_override, delete_override, modify_override)
	(init_override_iterator, override_iterator_uuid, override_iterator_nvt_oid)
	(override_iterator_creation_time, override_iterator_modification_time)
	(override_iterator_text, override_iterator_hosts, override_iterator_port)
	(override_iterator_threat, override_iterator_new_threat)
	(override_iterator_task, override_iterator_result)
	(override_iterator_nvt_name): New functions.
	(OVERRIDE_COLUMNS): New define.

	* src/manage.h: Update headers accordingly.
	(override_t): New type.

	* src/omp.c (buffer_results_xml): Add override args.
	(help_text): Add overrides commands.
	(create_override_data_t, delete_override_data_t, get_overrides_data_t)
	(modify_override_data_t): New type.
	(create_override_data_reset, delete_override_data_reset)
	(get_overrides_data_reset, modify_override_data_reset): New functions.
	(get_report_data_t, get_results_data_t): Add overrides fields.
	(command_data_t): Add create_override, delete_override and get_overrides.
	(create_override_data, delete_override_data, get_overrides_data)
	(modify_override_data): New variable.
	(client_state_t): Add override command states.
	(omp_xml_handle_end_element, omp_xml_handle_start_element)
	(omp_xml_handle_text): Add override command handling.  Add override flags
	to GET_REPORT and GET_RESULTS.
	(buffer_overrides_xml): New function.
	(buffer_results_xml): Add overrides flags.

2010-06-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_agent): Add agent return.
	(agent_uuid): New function.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (XML_OK_CREATED_ID): New define.
	(omp_xml_handle_end_element): Add id attribute to CREATE_AGENT response.

2010-06-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (task_infos_size): Correct severity name in SQL.

2010-06-10  Matthew Mundell <matthew.mundell@greenbone.net>

	Add database migration from version 18 to 19.  This covers UUID
	modifications made since 2010-06-02.

	* src/manage_sql.c (migrate_18_to_19): New function.
	(database_migrators): Add migrate_18_to_19.

2010-06-10  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element) [CLIENT_START_TASK]: Improved
	response when attribute is missing.

2010-06-10  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/lsc_user.c: Lowercased todos.

	* src/manage_sql.c, src/omp.c: Improved documentation.

2010-06-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (CONFIG_UUID_FULL_AND_FAST)
	(CONFIG_UUID_FULL_AND_FAST_ULTIMATE, CONFIG_UUID_FULL_AND_VERY_DEEP)
	(CONFIG_UUID_FULL_AND_VERY_DEEP_ULTIMATE, CONFIG_UUID_EMPTY)
	(TARGET_UUID_LOCALHOST): New defines.
	(init_manage): Add UUIDs to predefined configs and target.

2010-06-10  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/CMakeLists.txt: Lowercased commands.

2010-06-10  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/manage_sql.c (sql_insert): Fixed after parameter renaming.

2010-06-10  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Updated documentation.

	* doc/Doxyfile.in: Updated file list.

	* src/manage.c (resume_paused_task, send_file, send_config_rules):
	Added missing parameter documentation.

	* src/manage_sql.c, src/ompd.c, src/openvasmd.c: Updated documentation.

2010-06-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_TASK free
	description if the initial check fails and cleanup properly in the
	escalator and schedule fail cases.

2010-06-10  Matthew Mundell <matthew.mundell@greenbone.net>

	Add config UUIDs.

	* src/manage_sql.c (user_owns): Remove.  Everything uses user_owns_uuid.
	(create_tables): Add column uuid to configs.
	(task_config_uuid): New function.
	(find_config): Convert name arg to UUID.
	(create_config): Add uuid return arg.  Init UUID column.
	(copy_config): Init UUID column.
	(CONFIG_ITERATOR_FIELDS): Add UUID.
	(config_iterator_uuid): New function.  Adjust other accessors accordingly.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (create_task_data_t, create_task_data_reset): Replace config
	with config_id.
	(delete_config_data_t, delete_config_data_reset)
	(get_configs_data_t, get_configs_data_reset)
	(modify_config_data_t, modify_config_data_reset): Replace name with
	config_id.
	(get_nvt_details_data_t, get_nvt_details_data_reset)
	(get_preferences_data_t, get_preferences_data_reset): Rename config to
	config_id.
	(client_state_t): Remove config name states.
	(omp_xml_handle_start_element): Replace config and name attributes with
	config_id for commands that take a config.  Remove CLIENT_DELETE_CONFIG
	and CLIENT_MODIFY_CONFIG NAME processing.
	(omp_xml_handle_end_element): In CLIENT_GET_PREFERENCES,
	CLIENT_GET_NVT_DETAILS, CLIENT_DELETE_CONFIG, CLIENT_MODIFY_CONFIG,
	CLIENT_CREATE_TASK and CLIENT_GET_CONFIGS expect UUID instead of name.  In
	CLIENT_CREATE_CONFIG, CLIENT_GET_STATUS and CLIENT_GET_CONFIGS add
	UUID attribute to CONFIG.  Remove CLIENT_MODIFY_CONFIG NAME processing.
	(omp_xml_handle_text): Remove config name and text processing.

2010-06-09  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/omp.c: Updated documentation.
	(omp_xml_handle_start_element): Fixed some alignment issues.

2010-06-09  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/omp.c (append_attribute): New function, extracted from
	omp_xml_handle_start_element.
	(omp_xml_handle_start_element): Call new function.

2010-06-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (client_state_t): Remove old name states.
	(omp_xml_handle_start_element): Remove old name element processing.

2010-06-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (create_task_data_t, create_task_data_reset): Replace schedule
	with schedule_id.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Get schedule ID from attribute instead of text, as
	in other elements.

2010-06-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_result_iterator): Collate hosts with collate_ip.

2010-06-09  Matthew Mundell <matthew.mundell@greenbone.net>

	Add target UUIDs.

	* src/manage_sql.c (create_tables): Add column uuid to targets.
	(find_target): Convert name arg to UUID.
	(create_target): Init UUID column.
	(init_target_iterator, init_lsc_credential_target_iterator): Add UUID.
	(target_iterator_uuid, lsc_credential_target_iterator_uuid): New function.
	Adjust other accessors accordingly.
	(target_uuid): New function.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (create_task_data_t, create_task_data_reset): Replace
	target with target_id.
	(delete_target_data_t, delete_target_data_reset)
	(get_targets_data_t, get_targets_data_reset): Replace name with target_id.
	(client_state_t): Remove CLIENT_DELETE_TARGET_NAME.
	(omp_xml_handle_start_element): Read target ID attributes for
	DELETE_TARGET, GET_TARGETS and CREATE_TASK/TARGET.  Remove
	CLIENT_DELETE_TARGET NAME processing.
	(omp_xml_handle_end_element): In CLIENT_DELETE_TARGET, CLIENT_CREATE_TASK
	and CLIENT_GET_TARGETS expect UUID instead of name.  In
	CLIENT_GET_TARGETS, CLIENT_GET_LSC_CREDENTIALS and CLIENT_GET_STATUS add
	UUID attribute to TARGET.
	(omp_xml_handle_text): Remove target name processing.

2010-06-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (send_config_preferences): Free uuid and value on fail.

2010-06-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (send_config_preferences): Send empty value if file pref
	is empty.

2010-06-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (collate_ip): Limit the last scanned number of each IP
	to the digits in the string, as there may be more digits directly after it
	in memory.

2010-06-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Neaten name of credentials in
	messages.

2010-06-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_TARGET add
	missing breaks.

2010-06-07  Matthew Mundell <matthew.mundell@greenbone.net>

	Add LSC credential UUIDs.

	* src/manage_sql.c (create_tables): Add column uuid to lsc_credentials.
	(find_lsc_credential): Convert name arg to UUID.
	(create_lsc_credential): Init UUID column.
	(init_lsc_credential_iterator): Add UUID.
	(lsc_credential_iterator_uuid): New function.  Adjust other accessors
	accordingly.
	(lsc_credential_uuid): New function.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (create_target_data_t, create_target_data_reset): Replace
	lsc_credential with lsc_credential_id.
	(delete_lsc_credential_data_t, delete_lsc_credential_data_reset)
	(get_lsc_credentials_data_t, get_lsc_credentials_data_reset): Replace name
	with lsc_credential_id.
	(omp_xml_handle_start_element): Read LSC credential ID attributes for
	DELETE_LSC_CREDENTIAL and GET_LSC_CREDENTIALS.
	(omp_xml_handle_end_element): In CLIENT_DELETE_LSC_CREDENTIAL,
	CLIENT_CREATE_TARGET and CLIENT_GET_LSC_CREDENTIALS expect UUID instead of
	name.  In CLIENT_GET_LSC_CREDENTIALS and CLIENT_GET_TARGETS add UUID to
	LSC_CREDENTIAL.
	(omp_xml_handle_text): Remove LSC credential name processing.

2010-06-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_text): Indent case labels properly.

2010-06-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_TARGET
	cleanup switch formatting.

2010-06-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_target): Correct spelling of "parameters".

	* src/omp.c: Space out all the reset functions in the same way.
	(omp_xml_handle_end_element): In CLIENT_GET_TARGET_LOCATORS bring line
	width within range.  In CLIENT_CREATE_TARGET remove extra parens.

2010-06-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (task_second_last_report): Get the second row of the
	query.
	(task_trend): Remove accessors for total message counts which were
	overwriting the report counts.
	(task_debugs_size, task_holes_size, task_infos_size, task_logs_size)
	(task_warnings_size): Correct doc.

2010-06-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (condition_met): In the THREAT_LEVEL_CHANGED case also
	return 1 if there is a threat level and the previous threat level in one.
	(task_threat_level, task_previous_threat_level): Add NULL checks.

2010-06-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_MODIFY_TASK accept "0"
	instead of "" to remove the escalator.

2010-06-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_MODIFY_TASK remove the
	`fail' declarations so that the existing variable is set.

2010-06-06  Matthew Mundell <matthew.mundell@greenbone.net>

	Add escalator UUIDs.

	* src/manage_sql.c (create_tables): Add column uuid to escalators.
	(find_escalator): Convert name arg to UUID.
	(create_escalator): Init UUID column.
	(init_escalator_iterator): Add UUID.
	(escalator_iterator_uuid): New function.  Adjust other accessors accordingly.
	(task_escalator_uuid): New function.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (create_task_data_t, create_task_data_reset): Replace
	escalator with escalator_id.
	(delete_escalator_data_t, delete_escalator_data_reset)
	(get_escalators_data_t, get_escalators_data_reset)
	(test_escalator_data_t, test_escalator_data_reset): Replace name
	with escalator_id.
	(omp_xml_handle_start_element): Read escalator ID attributes for
	DELETE_ESCALATOR, GET_ESCALATORS, TEST_ESCALATOR and CREATE_TASK.
	(omp_xml_handle_end_element): In CLIENT_DELETE_ESCALATOR,
	CLIENT_CREATE_TASK, CLIENT_TEST_ESCALATOR, CLIENT_GET_STATUS and
	CLIENT_GET_ESCALATORS expect UUID instead of name.  In
	CLIENT_GET_ESCALATORS add UUID to ESCALATOR.
	(omp_xml_handle_text): Remove escalator name processing.

2010-06-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (print_report_latex): Only print NVT name row if there is an
	NVT name.

2010-06-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (print_report_latex): Escape NVT name.

2010-06-04  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/manage.h (create_target): Removed names from arguments.

2010-06-04  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Renamed GET_SOURCE to GET_TARGET_LOCATORS.

	* src/manage_sql.c (create_target): Renamed source to target_locator.

	* src/omp.c (help_text, create_target_data_t)
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_end_element, omp_xml_handle_text): Renamed source to
	target_locator.

	* src/tests/omp_help_0.c: Adjusted to help text.

2010-06-04  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/manage_sql.c (create_target): When fetching targets from external
	source, separate them with a comma and a space, to easy breaking long
	string in display.

2010-06-04  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Mainly formatting changes, pointed out by Matthew Mundell.

	* src/omp.c (create_target_data_t): Remove newline, sort fields
	alphabetically.
	(omp_xml_handle_end_element): Corrected formatting according to style
	guide, improved wording. Collapsed else- switch code block.

	* src/manage_sql.c: Corrected wording in comments.

2010-06-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_AGENTS rename
	AGENT agent_id attrib to id, to match other resources.

2010-06-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (print_report_xml, omp_xml_handle_end_element): Print empty
	string instead of NULL, when report host end time is NULL.

2010-06-03  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/tests/omp_help_0.c (help_text): Adjusted to current help text.

2010-06-03  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/manage.c (slist_free): Added todo, as we have a duplicate in
	openvas-libraries.

	* src/omp.c (omp_xml_handle_end_element): Use utility function to free
	list of pointers.

2010-06-03  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Added optional SOURCE, PASSWORD and USERNAME elements to CREATE_TARGET
	command. This allows to fetch targets from an external source via the
	CREATE_TARGET command.

	* src/omp.c (client_state_t): Added new states.
	(create_target_data_t): Added new fields.
	(create_target_data_reset): Free new fields.
	(omp_xml_handle_start_element): Added state transitions.
	(omp_xml_handle_end_element): Added state transitions, check for
	malconditions in create_target command handling, updated calls to
	create_target.
	(omp_xml_handle_text): Fill new elements.

	* src/manage_sql.c (create_target): Added parameters needed to query
	external source to import targets from.

	* src/manage.h (create_target): Updated proto.

2010-06-03  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Added new GET_SOURCES command that returns a list of external sources
	from which targets can be imported, if any are configured.

	* src/omp.c: Include new resource_request module.
	(help_text): Added new command.
	(client_state_t): Added new state.
	(omp_xml_handle_start_element): Added state transition, handle
	contained elements as error.
	(omp_xml_handle_end_element): Respond with list of (target-) sources.

	* CMakeLists.txt: Increased minimum required openvas-libraries version.

2010-06-03  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/omp.c: Add documentation (modified copy of documentation in
	openvas-administrator/src/oap.c).

2010-06-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Add agent UUIDs.  Hence increase database version to 19.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 19.

	* src/manage_sql.c (create_tables): Add column uuid to agents.
	(find_agent): Convert name arg to UUID.
	(create_agent): Init UUID column.
	(init_agent_iterator): Add UUID.
	(agent_iterator_uuid): New function.  Adjust other accessors accordingly.

	* src/manage.h: Add header accordingly.

	* src/omp.c (delete_agent_data_t, delete_agent_data_reset)
	(get_agents_data_t, get_agents_data_reset): Rename name to agent_id.
	(client_state_t): Remove agent name state.
	(omp_xml_handle_start_element): Get agent ids from attrib for DELETE_AGENT
	and GET_AGENTS.  Remove DELETE_AGENT NAME element.
	(omp_xml_handle_end_element): In CLIENT_DELETE_AGENT and CLIENT_GET_AGENTS
	expect UUID instead of name.  In CLIENT_GET_AGENTS add UUID to AGENT.
	(omp_xml_handle_text): Remove agent name processing.

2010-06-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_AGENTS rename var.

2010-06-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (current_array_1, current_array_2, current_array_3)
	(current_int_1, current_int_2, current_int_3, current_int_4)
	(current_client_task): Remove.  Globals from old callback data mechanism.
	(omp_xml_handle_end_element): Remove assertion about current_client_task.
	(omp_xml_handle_text): Remove doc reference to current_client_task.

2010-06-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch GET_STATUS to the new callback data mechanism.

	* src/omp.c (get_status_data_t): New type.
	(get_status_data_reset): New function.
	(command_data_t): Add get_status.
	(get_status_data): New variable.
	(current_uuid, current_format): Remove.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Make
	GET_STATUS cases use command_data.

2010-06-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (current_name): Remove.  Out of use.
	(omp_xml_handle_start_element): In CLIENT_AUTHENTIC in the GET_REPORT
	case, expect the sort field in the command data instead of in
	current_name.

2010-06-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Remove TEST_ESCALATOR element NAME, which has been replaced by a
	"name" attribute.

	* src/omp.c (modify_task_name): Remove.  Out of use.
	(client_state_t): Remove name state.
	(omp_xml_handle_start_element): Remove name test.
	(omp_xml_handle_end_element, omp_xml_handle_text): Remove name cases.

2010-06-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Remove stray free from
	CLIENT_DELETE_SCHEDULE.

2010-06-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_TARGETS and
	CLIENT_GET_ESCALATORS pass the sort order from the data instead of
	current_int_2 to the task iterator.

2010-06-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch GET_TARGETS to the new callback data mechanism.

	* src/omp.c (get_targets_data_t): New type.
	(get_targets_data_reset): New function.
	(command_data_t): Add get_targets.
	(get_targets_data): New variable.
	(modify_task_value): Remove.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Make
	GET_TARGETS cases use command_data.

2010-06-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch GET_NVT_FAMILIES to the new callback data mechanism.

	* src/omp.c (get_nvt_families_data_t): New type.
	(get_nvt_families_data_reset): New function.
	(command_data_t): Add get_nvt_families.
	(get_nvt_families_data): New variable.
	(modify_task_value): Remove.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Make
	GET_NVT_FAMILIES cases use command_data.

2010-06-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch GET_NVT_DETAILS to the new callback data mechanism.

	* src/omp.c (get_nvt_details_data_t): New type.
	(get_nvt_details_data_reset): New function.
	(command_data_t): Add get_nvt_details.
	(get_nvt_details_data): New variable.
	(modify_task_value): Remove.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Make
	GET_NVT_DETAILS cases use command_data.

2010-06-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch GET_NVT_FEED_CHECKSUM to the new callback data mechanism.

	* src/omp.c (get_nvt_feed_checksum_data_t): New type.
	(get_nvt_feed_checksum_data_reset): New function.
	(command_data_t): Add get_nvt_feed_checksum.
	(get_nvt_feed_checksum_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Make
	GET_NVT_FEED_CHECKSUM cases use command_data.

2010-06-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch GET_LSC_CREDENTIALS to the new callback data mechanism.

	* src/omp.c (get_lsc_credentials_data_t): New type.
	(get_lsc_credentials_data_reset): New function.
	(command_data_t): Add get_lsc_credentials.
	(get_lsc_credentials_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Make
	GET_LSC_CREDENTIALS cases use command_data.

2010-06-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch GET_ESCALATORS to the new callback data mechanism.

	* src/omp.c (get_escalators_data_t): New type.
	(get_escalators_data_reset): New function.
	(command_data_t): Add get_escalators.
	(get_escalators_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Make
	GET_ESCALATORS cases use command_data.

2010-06-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch GET_CONFIGS to the new callback data mechanism.

	* src/omp.c (get_configs_data_t): New type.
	(get_configs_data_reset): New function.
	(command_data_t): Add get_configs.
	(get_configs_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Make
	GET_CONFIGS cases use command_data.

2010-06-01  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch GET_AGENTS to the new callback data mechanism.

	* src/omp.c (get_agents_data_t): New type.
	(get_agents_data_reset): New function.
	(command_data_t): Add get_agents.
	(get_agents_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Make
	GET_AGENTS cases use command_data.

2010-06-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (print_report_xml, omp_xml_handle_end_element): Initialize
	result_hosts always, to quiet a compiler warning.

2010-05-28  Michael Wiegand <michael.wiegand@greenbone.net>

	Post-release version bump.

	* CMakeLists.txt: Updated version number.

2010-05-28  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 1.0.0-beta7 release.

	* CHANGES: Updated.

2010-05-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch MODIFY_TASK to the new callback data mechanism.

	* src/omp.c (modify_task_data_t): Add fields for remaining values.
	(modify_task_data_reset): Free new fields.
	(modify_task_parameter, modify_task_comment, modify_task_file)
	(modify_task_rcfile): Remove.  Out of use global vars.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Make MODIFY_TASK cases use command_data for all
	data.

2010-05-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch MODIFY_CONFIG to the new callback data mechanism.

	* src/omp.c (modify_config_data_t): New type.
	(modify_config_data_reset): New function.
	(command_data_t): Add modify_config.
	(modify_config_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Make MODIFY_CONFIG cases use command_data.

2010-05-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch MODIFY_REPORT to the new callback data mechanism.

	* src/omp.c (modify_report_data_t): New type.
	(modify_report_data_reset): New function.
	(command_data_t): Add modify_report.
	(modify_report_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Make MODIFY_REPORT cases use command_data.

2010-05-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/CMakeLists.txt: Lowercase commands.

2010-05-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (fork_connection_for_schedular): Add certificates to
	openvas_server_new call.

	* src/ompd.c (CACERT, CLIENTCERT, CLIENTKEY): New defines.
	(recreate_session): Add certificates to openvas_server_new call.

2010-05-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c: Repair indentation put out in revision 7409.

2010-05-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (run_task): Only send the base64 part of the public key.

2010-05-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (run_task): If the credential has a public key, send the
	passphrase for the "SSH Authorization" NVT.  Also send public and private
	keys as attached files.

2010-05-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (migrate_17_to_18_set_pref): New function.
	(migrate_17_to_18): Ensure "Mark unrechable Hosts as dead" is set to "yes"
	for "Ping Host" NVT in predefined configs.

2010-05-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (setup_full_config_prefs): Set "Mark unrechable Hosts
	as dead" to "yes" for "Ping Host" NVT.

2010-05-24  Matthew Mundell <matthew.mundell@greenbone.net>

	Increase database version to 18 to ensure "Ping Host" is in the "All"
	NVT selector.  Add database migration from version 17 to 18.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 18.

	* src/manage_sql.c (migrate_17_to_18): New function.
	(database_migrators): Add migrate_17_to_18.

2010-05-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage): Add "Ping Host" portscanner to "All" NVT
	selector.

2010-05-21  Matthew Mundell <matthew.mundell@greenbone.net>

	Recover speed of report result iteration.

	* src/manage_sql.c (where_cvss_base): Get the cvss_base with an embedded
	SELECT.
	(init_result_iterator, report_scan_result_count): Remove "nvts" from the
	selected tables, as the WHERE clause now SELECTs on that table.

2010-05-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_complete_nvt_cache_update): Remove prefs from
	configs where the pref has vanished from the NVT.

2010-05-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Respect OMP GET_REPORT min_cvss_base for XML based and NBE formats.

	* src/omp.c (print_report_xml, print_report_latex): Add min_cvss_base
	arg.  Pass through to init_result_iterator.
	(omp_xml_handle_end_element): In CLIENT_GET_REPORT in the "nbe" and XML
	based cases, respect the min_cvss_base attribute.

2010-03-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd_report_html.xsl (issue): Add CVSS to header.

2010-05-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (print_report_latex): Add NVT name and CVSS to result headers.

2010-05-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (print_report_latex): Include result_hosts_only in details of
	report contents.

2010-05-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Add CVSS constraint to OMP GET_REPORTS.

	* src/omp.c (get_report_data_t): Add min_cvss_base.
	(get_report_data_reset): Free min_cvss_base.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add
	min_cvss_base handle to the XML format of GET_REPORTS.

	* src/manage_sql.c (where_cvss_base): New function.
	(init_result_iterator, report_scan_result_count): Add min_cvss_base arg.

	* src/manage.h: Update headers accordingly.

2010-05-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_REPORT in the "nbe"
	case, respect the OMP GET_REPORT result_hosts_only attribute.

2010-05-18  Matthew Mundell <matthew.mundell@greenbone.net>

	Respect the OMP GET_REPORT result_hosts_only attrib for XML based reports.

	* src/omp.c (array_add_new_string): Move up in file.
	(print_report_xml): Add result_hosts_only arg.
	(omp_xml_handle_end_element): In CLIENT_GET_REPORT pass result_hosts_only
	attrib to print_report_xml.

2010-05-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Repair more CLIENT_GET_REPORT
	formatting put out in revision 6521.

2010-05-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Repair CLIENT_GET_REPORT arg
	overhang formatting put out in revision 6521.

2010-05-18  Matthew Mundell <matthew.mundell@greenbone.net>

	Respect the OMP GET_REPORT result_hosts_only attrib for LaTeX reports.

	* src/omp.c (print_report_latex): Add result_hosts_only arg.
	(omp_xml_handle_end_element): In CLIENT_GET_REPORT pass result_hosts_only
	attrib to print_report_latex.

	* src/manage_sql.c (manage_report_host_has_results): New function.

	* src/manage.h: Add header accordingly.

2010-05-18  Matthew Mundell <matthew.mundell@greenbone.net>

	Add an attrib to OMP GET_REPORT to limit the host info to hosts that have
	results.

	* src/omp.c (get_report_data_t): Add result_hosts_only.
	(omp_xml_handle_start_element): Parse GET_REPORT result_hosts_only attrib.
	(array_add_new_string): New function.
	(omp_xml_handle_end_element): In CLIENT_GET_REPORT send host info
	according to result_hosts_only.

	* src/manage_sql.c (init_host_iterator): Add host constraint arg.  Update
	all callers.

	* src/manage.h: Update header accordingly.

	* src/manage.c: Update init_host_iterator callers.

2010-05-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_REPORT align
	SEND* args properly.

2010-05-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_TEST_ESCALATOR replace
	old current_uuid with command_data.

2010-05-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage): Add CVSS base and risk factor to nvti
	cache.
	(result_iterator_nvt_cvss_base, result_iterator_nvt_risk_factor): New
	functions.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (buffer_results_xml): Add CVSS_BASE and RISK_FACTOR to
	RESULT/NVT.

2010-05-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch CREATE_ESCALATOR to the new callback data mechanism.

	* src/omp.c (create_escalator_data_t): New type.
	(create_escalator_data_reset): New function.
	(command_data_t): Add create_escalator.
	(create_escalator_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Make CREATE_ESCALATOR cases use command_data.

2010-05-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch CREATE_TASK to the new callback data mechanism.

	* src/omp.c (create_task_data_t): New type.
	(create_task_data_reset): New function.
	(command_data_t): Add create_task.
	(create_task_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Make CREATE_TASK cases use command_data.

2010-05-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch CREATE_AGENT to the new callback data mechanism.

	* src/omp.c (create_agent_data_t): New type.
	(create_agent_data_reset): New function.
	(command_data_t): Add create_agent.
	(create_agent_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Make CREATE_AGENT cases use command_data.

2010-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch CREATE_CONFIG to the new callback data mechanism.

	* src/omp.c (create_config_data_t): Add remaining elements.
	(create_config_data_reset): Free new elements.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Make CREATE_CONFIG cases use command_data.

2010-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch CREATE_LSC_CREDENTIAL to the new callback data mechanism.

	* src/omp.c (create_lsc_credential_data_t): New type.
	(create_lsc_credential_data_reset): New function.
	(command_data_t): Add create_lsc_credential.
	(create_lsc_credential_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Make CREATE_LSC_CREDENTIAL cases use command_data.

2010-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch TEST_ESCALATOR to the new callback data mechanism.

	* src/omp.c (test_escalator_data_t): New type.
	(test_escalator_data_reset): New function.
	(command_data_t): Add test_escalator.
	(test_escalator_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Make
	TEST_ESCALATOR cases use command_data.

2010-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (help_text): Sort lines.
	(omp_xml_handle_start_element): Sort comparisons in CLIENT_AUTHENTIC.

2010-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch DELETE_REPORT and DELETE_TASK to the new callback data mechanism.

	* src/omp.c (delete_report_data_t, delete_task_data_t): New types.
	(delete_report_data_reset, delete_task_data_reset): New functions.
	(command_data_t): Add fields for delete commands.
	(delete_report_data, delete_task_data): New variables.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Make delete
	command cases use command_data.

2010-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch DELETE_AGENT, DELETE_CONFIG, DELETE_ESCALATOR,
	DELETE_LSC_CREDENTIAL and DELETE_TARGET to the new callback data
	mechanism.

	* src/omp.c (delete_agent_data_t, delete_config_data_t)
	(delete_escalator_data_t, delete_lsc_credential_data_t)
	(delete_target_t): New types.
	(delete_agent_data_reset, delete_config_data_reset)
	(delete_escalator_data_reset, delete_lsc_credential_data_reset)
	(delete_target_data_reset): New functions.
	(command_data_t): Add fields for delete commands.
	(delete_agent_data, delete_config_data, delete_escalator_data)
	(delete_lsc_credential_data, delete_target_data): New variables.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Make delete command cases use command_data.

2010-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch START_TASK to the new callback data mechanism.

	* src/omp.c (start_task_data_t): New type.
	(start_task_data_reset): New function.
	(command_data_t): Add start_task.
	(start_task_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Make
	START_TASK cases use command_data.

2010-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch RESUME_STOPPED_TASK to the new callback data mechanism.

	* src/omp.c (resume_stopped_task_data_t): New type.
	(resume_stopped_task_data_reset): New function.
	(command_data_t): Add resume_stopped_task.
	(resume_stopped_task_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Make
	RESUME_STOPPED_TASK cases use command_data.

2010-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch RESUME_PAUSED_TASK to the new callback data mechanism.

	* src/omp.c (resume_paused_task_data_t): New type.
	(resume_paused_task_data_reset): New function.
	(command_data_t): Add resume_paused_task.
	(resume_paused_task_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Make
	RESUME_PAUSED_TASK cases use command_data.

2010-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch RESUME_OR_START_TASK to the new callback data mechanism.

	* src/omp.c (resume_or_start_task_data_t): New type.
	(resume_or_start_task_data_reset): New function.
	(command_data_t): Add resume_or_start_task.
	(resume_or_start_task_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Make
	RESUME_OR_START_TASK cases use command_data.

2010-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch PAUSE_TASK to the new callback data mechanism.

	* src/omp.c (pause_task_data_t): New type.
	(pause_task_data_reset): New function.
	(command_data_t): Add pause_task.
	(pause_task_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Make
	PAUSE_TASK cases use command_data.

2010-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch ABORT_TASK to the new callback data mechanism.

	* src/omp.c (abort_task_data_t): New type.
	(abort_task_data_reset): New function.
	(command_data_t): Add abort_task.
	(abort_task_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Make
	ABORT_TASK cases use command_data.

2010-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (task_current_report): Include reports with end times,
	as the report gets an end time when the task is stopped.

2010-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Remove code for potential ABORT_TASK extension.

	* src/omp.c (client_state_t): Remove CLIENT_ABORT_TASK_CRITERION.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Remove
	ABORT_TASK CRITERION handling.

2010-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch CREATE_TARGET to the new callback data mechanism.

	* src/omp.c (create_target_data_t): New type.
	(create_target_data_reset): New function.
	(command_data_t): Add create_target.
	(create_target_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Switch CREATE_TARGET cases to use command_data.

2010-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c: Sort command data types and functions alphabetically.

2010-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Remove experimental command data type.

	* src/omp.c (name_command_data_t, name_command_data_reset): Remove.
	(command_data_t): Remove name_command.

2010-05-12  Matthew Mundell <matthew.mundell@greenbone.net>

	Add database migration from version 16 to 17.

	* src/manage_sql.c (migrate_16_to_17): New function.
	(database_migrators): Add migrate_16_to_17.

	* src/otp.c (parse_tags): Remove.  To manage.c.

	* src/manage.c (parse_tags): New function.  From otp.c.

	* src/manage.h: Add header accordingly.

2010-05-12  Matthew Mundell <matthew.mundell@greenbone.net>

	Add CVSS base and risk factor to NVTs.  Hence increase database
	version to 17.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 17.

	* src/manage_sql.c (create_tables): Add cvss_base and risk_factor to nvts.
	(make_nvt_from_nvti): Set CVSS base and risk factor.
	(init_nvt_iterator, select_config_nvts): Add CVSS base and risk factor to
	selection.
	(nvt_iterator_cvss_base, nvt_iterator_risk_factor): New functions.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (send_nvt): Add CVSS base and risk factor to detailed
	response.

	* src/otp.c (parse_tags): New function.
	(parse_scanner_plugin_list_tags): Separate out CVSS base and risk factor
	from other tags.

2010-05-12  Matthew Mundell <matthew.mundell@greenbone.net>

	Add open ports to report results.

	* src/manage_sql.c (append_task_open_port): Add host arg.  Take port as
	string.  Add port to results as log message.

	* src/manage.h: Update header accordingly.

	* src/otp.c (process_otp_scanner_input): Set current_host in
	SCANNER_PORT_HOST.  Adjust SCANNER_PORT_NUMBER to updated
	append_task_open_port, freeing current_host.

2010-05-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (buffer_config_preference_xml): Neaten formatting.  Free
	data.
	(omp_xml_handle_end_element): In CLIENT_GET_NVT_DETAILS and
	CLIENT_GET_CONFIGS, buffer preferences with buffer_config_preference_xml
	instead of doing the work directly.

2010-05-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Extend OMP GET_PREFERENCES for getting subsets of all preferences and
	for getting the values of preferences on a particular config.

	* src/manage_sql.c (manage_nvt_name): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (get_preferences_data_t): New type.
	(get_preferences_data_reset, buffer_config_preference_xml): New functions.
	(command_data_t): Add get_preferences.
	(get_preferences_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add "oid",
	"config" and "preference" attribs to GET_PREFERENCES.

2010-05-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (run_task): Correct var name in comment.

2010-05-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_nvt_preference_iterator): Remove stray semicolon
	from SQL.

2010-05-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.h: Neaten copyright date.
	(task_status_t): Improve doc.

	* src/openvasmd.c: Neaten copyright date.  Flush trailing whitespace.
	(fork_connection_for_schedular): Move arg to separate line for clarity.
	(update_or_rebuild_nvt_cache): Align two lines properly.

	* src/manage.c (send_user_rules): Remove resolved todo.  Reduce line
	length.  Remove trivial todo.

2010-05-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage): Skip task consistency checks when in
	cache update mode.

2010-05-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (task_current_report): Correct SQL.

2010-05-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (task_current_report): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_STATUS get the
	current report instead of the running report, so that the response
	includes progress info for stopped and paused tasks.

2010-05-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_lsc_credential): Bring line within 80 chars.

2010-05-07  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/manage_sql.c (create_lsc_credential): Allow "." and "@"
	characters in LSC credentials.

2010-05-06  Matthew Mundell <matthew.mundell@greenbone.net>

	Add "threat level changed" escalator condition.

	* src/manage.h (escalator_condition_t): Add THREAT_LEVEL_CHANGED entry.

	* src/manage.c (escalator_condition_name)
	(escalator_condition_description, escalator_condition_from_name): Add
	THREAT_LEVEL_CHANGED cases.

	* src/manage_sql.c (task_previous_threat_level): New function.
	(condition_met): Add THREAT_LEVEL_CHANGED check.

2010-05-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (send_config_preferences): Add task files arg.  Send the
	preference value instead of a UUID when there is a task file named by the
	preference value.
	(slist_free): New function.
	(run_task): Pass the task files to send_config_preferences.

2010-05-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (run_task): When sending preference files, if there's a
	task file with the same name as value of the preference file, then skip
	sending the preference value as a file.

2010-05-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (send_config_preferences): Add arg for collecting files
	to send to scanner.
	(send_file): New function.
	(run_task): Send files stored in config preferences to scanner.

2010-05-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c: Update free_array calls to array_free.

2010-05-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/CMakeLists.txt: Replace tasks_sql.h with manage_sql.c in tags files.

2010-05-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* INSTALL: Add spaces after full stops.

2010-05-04  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Moved shared code between openvas-administrator and openvas-manager
	into openvas-libraries.

	* src/manage.c (make_array, free_array): Moved to
	openvas-libraries/base/array module.

	* src/manage.h: Removed typedef and protos, include array module from
	openvas-libraries/base .

	* src/omp.c (array_add, array_terminate, array_reset): Moved to array
	module in openvas-libraries/base .

2010-04-27  Michael Wiegand <michael.wiegand@greenbone.net>

	* INSTALL: Updated instructions for certificate generation, added a
	few headings and moved paragraphs to improve readability.

2010-04-27  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Use new openvas-libraries/base/credentials module, removed duplicate
	code.

	* src/manage.h (task_status_t): Include new header, removed protos.

	* src/manage.c (free_credentials, append_to_credentials_username)
	(append_to_credentials_password): Moved to new module.

2010-04-27  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/manage.h (task_status_t): Document, fix numerical values.

2010-04-27  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Reviving formerly reverted changes (penultimate commit). The issue
	was solved elsewhere, two minor additional changes.

	* src/manage.h, src/manage.c, src/manage_sql.c, src/openvasmd.c:
	Reverted to penultimate commit.

	* src/manage.c (run_task): Added todo about possible code collapse.
	(manage_schedule): Fixed setting of owner_uuid (second in list).

2010-04-26  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Reverting last commit due to not yet identified bug that leads to
	crashes with most authentication attempts.

	* src/manage.h, src/manage.c, src/manage_sql.c, src/openvasmd.c:
	Reverted last commit.

2010-04-26  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Use openvas libraries to access the correct users rules, even if user
	is remotely authenticated.
	Therefore, store users uuid for scheduled tasks.

	* src/manage.h: Added 2010 to copyright statement.
	(get_scheduled_user_uuid, set_scheduled_user_uuid): Added protos.
	(manage_schedule): Adjusted proto.

	* src/manage.c (send_user_rules): Call openvas_auth_user_uuid_rules and
	pass current credentials uuid to access the correct rules for
	remotely authenticated users.
	(schedule_user_uuid): New variable that holds uuid of user in case of
	a scheduled task.
	(get_scheduled_user_uuid): New. Getter for schedule_user_uuid.
	(set_scheduled_user_uuid): New. Setter for schedule_user_uuid.
	(manage_schedule): Adjusted signature, get, set, use and free the
	uuid of a user that scheduled a task.

	* src/manage_sql.c (authenticate): In case of a scheduled task, set the
	previously stored uuid.

	* src/openvasmd.c: Added 2010 to copyright statement.
	(fork_connection_for_schedular): Added new parameter to signature,
	set users uuid for scheduled tasks.

2010-04-26  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/manage.c: Added 2010 to copyright statement.
	(free_credentials): Removed unneeded conditional, resolves part of
	todo.

2010-04-26  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/manage_sql.c: Added 2010 to copyright statement.
	(sql_x): Removed newline in log messages.

2010-04-26  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/manage_sql.c (sql_quote, sql_nquote): Added documentation.

2010-04-26  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* CMakeLists.txt: Lower-cased cmake commands as in CMakeLists.txt files
	of other modules.

2010-04-26  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Improve SQL statement to fetch the ROWID of an report in progress of
	a running task. This change can prevent issues that occurred when the
	database was left in an inconsistent state (e.g. due to
	"malformed disk image" issues).

	* src/manage_sql.c (task_running_report): Made the SQL
	statement to fetch the ROWID of the report in progress of a running
	task more robust. Ensure that the report is in "running" state.
	If multiple such reports should exist (should occur only if serious
	errors came up before), select the last one.

2010-04-26  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Ensure that after every fork the database is reopened in the child.
	This is required by sqlite3 in order to prevent race conditions that
	lead to "malformed disk image"s of the database.

	* src/manage_sql.c (task_db_name): New variable to hold the database
	file name.
	(reinit_manage_process): New function.
	(init_manage): Store the database name in new variable.

	* src/manage_sql.h: Added proto.

	* src/manage.c (run_task), src/openvasmd.c (accept_and_maybe_fork):
	Reinit manage process after fork.

2010-04-23  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/manage_sql.c (init_manage): Improved doc.
	(authenticate): Added todo wrt remotely authenticated users.

2010-04-23  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Extracted two functions from main to enhance readability.

	* src/openvasmd.c (update_or_rebuild_nvt_cache): New function
	containing the nvt cache update and rebuild code.
	(main_loop): New function containing the main loop code.
	(main): Extracted code, call respective new functions.

2010-04-23  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/openvasmd.c (cleanup): Made function static.
	(main): Use multiline comments as in the rest of the module, made
	comments full sentences.

2010-04-23  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/manage.c (send_user_rules): Added todo, as function has to be
	consolidated and moved into libraries to allow proper rules sending
	of remotely authenticated users.
	(manage_schedule): Added comments, renamed local uuid variables in
	task_uuid to make future addition of a user_uuid variable easier to
	comprehend.

2010-04-23  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/openvasmd.c: Added stub for documentation subsection about
	forking behaviour of openvasmd.
	(accept_and_maybe_fork): Made static.
	(main): Added comments, collapsed unconditioned statement.

2010-04-23  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/openvasmd.c: Removed setting of experimental FORK flag.
	(accept_and_maybe_fork): Removed pathes that were started to have a
	non-forking manager.

2010-04-22  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/openvasmd.c (main, cleanup): Moved call to
	openvas_auth_tear_down to cleanup function as suggested by Matthew
	Mundell.

2010-04-21  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* doc/Doxyfile.in, doc/Doxyfile_full.in: Added missing file to INPUT
	file list.

2010-04-16  Stephan Kleine

	* src/manage.h (cleanup_manage_process): Add gboolean parameter.

	* src/openvasmd.c (cleanup): Add TRUE to cleanup_manage_process call.

2010-04-16  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/manage.c (send_config_rules): Extracted code to
	openvas-libraries/openvas_auth module to allow easier future
	integration of remote authentication methods.
	(free_credentials): Added todo about possible memleak and improvability
	of readability.

2010-04-16  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/openvasmd.c (main): Initialize and tear down authentication
	system.

2010-04-15  Stephan Kleine

	* src/CMakeLists.txt, src/tests/CMakeLists.txt: Fix linking issues.

2010-04-15  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* CMakeLists.txt, INSTALL: Raised required version of openvas-libraries
	to 3.0.6 .

2010-04-15  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Moved code to openvas-libraries/misc/openvas_auth module.

	* src/manage_sql.c (openvas_user_uuid, openvas_authenticate_uuid):
	Moved to openvas-libraries/misc/openvas_auth module.
	(authenticate): Added comment.

2010-04-15  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Moved code to openvas-libraries/misc/openvas_uuid module.

	* src/manage.c (make_report_uuid): Removed.
	(make_task_uuid): Removed.

	* src/manage.h (make_report_uuid, make_task_uuid): Removed headers
	accordingly.

	* src/manage_sql.c (sql_make_uuid, openvas_user_uuid, migrate_9_to_10)
	(migrate_12_to_13, create_report, make_task, create_config)
	(create_config_rc, copy_config, create_note): Added include, reflect
	function name change.

	* src/tests/make_report_uuid_0.c (main): Added include.
	Reflect function name change in code.

2010-04-15  Michael Wiegand <michael.wiegand@greenbone.net>

	Post-release version bump.

	* CMakeLists.txt: Updated version number.

2010-04-15  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 1.0.0-beta6 release.

	* CHANGES: Updated.

	* CMakeLists.txt: Added autogenerated files to
	CPACK_SOURCE_IGNORE_FILES.

2010-04-14 Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Cosmetics.

	* src/otp.c (category_number): Doc string formatting.

	* src/omp.c (omp_xml_handle_end_element): Added comments.

2010-04-13 Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* INSTALL: Added some missing optional runtime dependencies, as
	suggested by "seph" on the openvas-devel mailinglist.

2010-04-10 Stephan Kleine

	* src/CMakeLists.txt: Fix build with as-needed

	* src/tests/CMakeLists.txt: Fix build with as-needed

2010-04-10 Stephan Kleine

	* CMakeLists.txt: Add support for out-of-source builds.

2010-04-10  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* INSTALL: Improved hint on prerequisites for credentials packages.

2010-03-31  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP commands PAUSE_TASK and RESUME_PAUSED_TASK.

	* src/omp.c (help_text): Add new commands.
	(client_state_t): Add new command states.
	(omp_xml_handle_end_element, omp_xml_handle_start_element): Add
	RESUME_OR_START_TASK handling.
	(process_omp_change): New function.

	* src/omp.h: Add header accordingly.

	* src/manage.c (run_status_name, stop_task): Add pause and resume states.
	(pause_task, resume_paused_task): New functions.
	(manage_check_current_task): Add pausing and resuming.

	* src/manage.h: Add headers accordingly.

	* src/ompd.c (serve_omp): Periodically call process_omp_change.

	* src/otp.c (process_otp_scanner_input): Add OTP pause and resume
	handling.

	* src/manage_sql.c (init_manage, set_task_requested, delete_report):
	Include pause and resume states.

2010-03-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (migrate_15_to_16): Also clear all task comments.

2010-03-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_start_element): In CLIENT_MODIFY_TASK
	initialise modify_task_comment in case the comment is empty.

2010-03-29  Matthew Mundell <matthew.mundell@greenbone.net>

	Add ESCALATOR to OMP command MODIFY_TASK.

	* src/omp.c (modify_task_data_t): Add escalator_id.
	(modify_task_data_reset): Free escalator_id.
	(client_state_t): Add CLIENT_MODIFY_TASK_ESCALATOR.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add ESCALATOR
	to MODIFY_TASK handling.

	* src/manage_sql.c (task_escalator, set_task_escalator): New functions.

	* src/manage.h: Add headers accordingly.

2010-03-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (task_escalator): Remove.  Renamed to
	task_escalator_name.
	(task_escalator_name): New function.  Was task_escalator.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_end_element): Rename task_escalator calls.

2010-03-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (make_task): Allow comment to be NULL.  Add SQL quotes
	for comment.  Init schedule_next_time.

2010-03-28  Matthew Mundell <matthew.mundell@greenbone.net>

	Add SCHEDULE to OMP command MODIFY_TASK.

	* src/omp.c (modify_task_data_t): New type.
	(modify_task_data_reset): New function.
	(command_data_t): Add modify_task.
	(modify_task_data): New variable.
	(client_state_t): Add CLIENT_MODIFY_TASK_SCHEDULE.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add SCHEDULE
	to MODIFY_TASK handling.  Add missing CLIENT_MODIFY_TASK_COMMENT end case.

2010-03-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_STATUS add COMMENT
	to TASK.

2010-03-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db_postgres.sql (schedules): Add column period_months.

	* doc/db.png: Update from SQL.

2010-03-28  Matthew Mundell <matthew.mundell@greenbone.net>

	Add database migration from version 15 to 16.

	* src/manage_sql.c (migrate_15_to_16): New function.
	(database_migrators): Add migrate_15_to_16.

2010-03-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Check period and duration last.
	Ensure that duration is less than period when period is given in months.

2010-03-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Add calendar month periods to scheduling.  Hence increase database
	version to 16.  Extend OMP SCHEDULE command so clients can specify
	duration and period in months or other calendar units.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 16.

	* src/manage_sql.c (create_tables): Add period_months to table schedules.
	(create_schedule): Add period_months arg.
	(MONTHS_WITHIN_YEAR): New macro.
	(months_between, add_months, schedule_iterator_period_months)
	(task_schedule_iterator_period_months): New functions.
	(init_schedule_iterator, init_task_schedule_iterator): Add period_months to
	columns.  Adjust iterator accessor columns accordingly.
	(task_schedule_iterator_stop_due): Add calendar month period handling.

	* src/manage_sql.h, src/manage.h: Update headers accordingly.

	* src/manage.c (manage_schedule): Remove next time assert from periodic
	case.  Add case for calendar month periods.

	* src/omp.c (interval_from_strings): New function.
	(create_schedule_data_t): Add period_unit and duration_unit.
	(create_schedule_data_reset): Free period_unit and duration_unit.
	(client_state_t): Add duration and period unit states.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add UNIT to PERIOD and DURATION in OMP SCHEDULE.
	(buffer_schedules_xml): Add PERIOD_MONTHS to SCHEDULE.

	* src/openvasmd.c (main): Set timezone to UTC.

2010-03-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_help_0.c (help_text): Bring in line with Manager.

2010-03-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/CMakeLists.txt: Replace tasks_sql.h with manage_sql.c.

	* doc/db_postgres.sql (tasks): Add columns schedule and
	schedule_next_time.
	(schedules): New table.

	* doc/db.png: Update from SQL.

2010-03-25  Matthew Mundell <matthew.mundell@greenbone.net>

	Add IN_USE to the details case of OMP GET_SCHEDULE.

	* src/manage_sql.c (init_schedule_iterator): Add field for "in use".
	(schedule_iterator_in_use): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (buffer_schedules_xml): Add IN_USE in details case.

2010-03-25  Matthew Mundell <matthew.mundell@greenbone.net>

	Add database migration from version 14 to 15.

	* src/manage_sql.c (migrate_14_to_15): New function.
	(database_migrators): Add migrate_14_to_15.

2010-03-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (manage_schedule): Call omp_resume_or_start_task instead
	of omp_start_task to start tasks.

2010-03-25  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP command RESUME_OR_START_TASK.

	* src/manage.c (run_task): Convert arg from_stopped to from, and add
	"resume or start" behaviour if from is 2.  Update callers.
	(resume_or_start_task): New function.  Wraps run_task.

	* src/manage.h: Add header accordingly.

	* src/omp.c (help_text): Add RESUME_OR_START_TASK.
	(omp_xml_handle_end_element, omp_xml_handle_start_element): Add
	RESUME_OR_START_TASK handling.

2010-03-25  Matthew Mundell <matthew.mundell@greenbone.net>

	In the schedular, stop tasks with durations at the end of their durations.

	* src/manage.c (manage_schedule): Ensure that start happens within the
	duration if the schedule has a duration.  Correct assert about next and
	first time in start of periodic task.  Collect and stop tasks due for
	stopping.

	* src/manage_sql.c (init_task_schedule_iterator): Add duration.  Adjust
	iterator accessor columns accordingly.
	(task_schedule_iterator_duration): New function.
	(task_schedule_iterator_stop_due): Implement.

	* src/manage_sql.h: Add header accordingly.

2010-03-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_SCHEDULE ensure
	that the period is at least as big as the duration.

2010-03-25  Matthew Mundell <matthew.mundell@greenbone.net>

	Init forked child in schedular callback with init_manage_process instead
	of with init_manage, otherwise it resets all the tasks.

	* src/ompd.c (init_ompd_process): New function.

	* src/ompd.h: Add header accordingly.

	* src/openvasmd.c (fork_connection_for_schedular): Init child with
	init_ompd_process.

2010-03-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (time_from_strings): Remove offsetting of day of month.

2010-03-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (time_from_strings): Turn month into offset for mktime.  Match
	daylight saving value of local time.

2010-03-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (schedule_iterator_next_time): Add calculation for
	periodic case.

	* src/omp.c (buffer_schedules_xml): Send schedule times as formatted strings.
	(omp_xml_handle_end_element): Ditto in CLIENT_GET_STATUS.

2010-03-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* ChangeLog: Resurrect overwritten entry.

2010-03-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (task_schedule_iterator_first_time): Make external.

	* src/manage_sql.h: Add header accordingly.

	* src/manage.c (manage_schedule): Ensure periodic task starts within a
	short interval at the beginning of the schedule period.

2010-03-24  Matthew Mundell <matthew.mundell@greenbone.net>

	Account for period in scheduling.

	* src/manage_sql.c (init_task_schedule_iterator): Add schedule period and
	first_time.  Adjust iterator accessor columns accordingly.
	(task_schedule_iterator_period, task_schedule_iterator_first_time): New
	function.

	* src/manage.c (manage_schedule): Account for period when setting next
	schedule time of task.

	* src/manage_sql.h: Add headers accordingly.

2010-03-24  Matthew Mundell <matthew.mundell@greenbone.net>

	Add SCHEDULE to OMP command CREATE_TASK.

	* src/manage_sql.c (set_task_schedule): New function.
	(make_task): Clear schedule.

	* src/manage.h: Add header accordingly.

	* src/omp.c (client_state_t): Add CLIENT_CREATE_TASK_SCHEDULE.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add SCHEDULE to CREATE_TASK.

2010-03-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP command CREATE_SCHEDULE.

	* src/manage_sql.c (create_schedule): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (time_from_strings): New function.
	(help_text): Add CREATE_SCHEDULE.
	(create_schedule_data_t): New type.
	(create_schedule_data_reset): New define.
	(command_data_t): Add create_schedule.
	(create_schedule_data): New variable.
	(client_state_t): Add CREATE_SCHEDULE states.
	(omp_xml_handle_end_element, omp_xml_handle_start_element)
	(omp_xml_handle_text): Add CREATE_SCHEDULE handling.

2010-03-22  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP command DELETE_SCHEDULE.

	* src/manage_sql.c (delete_schedule): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (help_text): Add DELETE_SCHEDULE.
	(delete_schedule_data_t): New type.
	(delete_schedule_data_reset): New define.
	(command_data_t): Add delete_schedule.
	(delete_schedule_data): New variable.
	(client_state_t): Add CLIENT_DELETE_SCHEDULE.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add
	DELETE_SCHEDULE handling.

2010-03-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (buffer_schedules_xml): Add tasks that use the schedular to
	response.

	* src/manage_sql.c (schedule_iterator_schedule)
	(init_schedule_task_iterator, schedule_task_iterator_uuid)
	(schedule_task_iterator_name): New functions.

	* src/manage.h: Add headers accordingly.

2010-03-21  Matthew Mundell <matthew.mundell@greenbone.net>

	Give the schedular a socket to a forked Manager, instead of having it
	connect to the main Manager process.

	* src/manage.c (authenticate_allow_all): New variable.
	(manage_auth_allow_all): New function.
	(manage_schedule): Take a callback instead of a host and port.  Call the
	callback to get a child that is already connected to the manager, and
	start the task from the child.

	* src/manage_sql.c (authenticate_allow_all): New header.
	(cleanup_manage_process): Only set the current task if doing all cleanups.
	(authenticate): Always auth with success if authenticate_allow_all is set.
	(init_task_schedule_iterator): Add columns for task owner info.
	(task_schedule_iterator_owner_uuid, task_schedule_iterator_owner_name):
	New functions.

	* src/manage_sql.h, src/manage.h: Add headers accordingly.

	* src/openvasmd.c (SCHEDULE_PERIOD): New define.
	(fork_connection_for_schedular): New function.
	(main): Make manage_schedule run only about every SCHEDULE_PERIOD, instead
	of letting in run after any interrupt.

	* src/omp.c (omp_xml_handle_start_element): In CLIENT_AUTHENTICATE
	initialise the password so that it can be empty.

2010-03-20  Stephan Kleine

	* src/CMakeLists.txt: Install openvasmd into ${SBINDIR} since it is a service.

2010-03-18  Matthew Mundell <matthew.mundell@greenbone.net>

	Move schedule "next time" from schedule to task.  Add the task "next time"
	to the GET_STATUS response.

	* src/manage_sql.c (create_tables): Remove column next_time from
	schedules.  Add column schedule_next_time to tasks.
	(task_schedule_next_time, set_task_schedule_next_time): New functions.
	(set_schedule_next_time): Remove.
	(init_schedule_iterator): Remove next_time from SELECT columns.
	(schedule_iterator_first_time, schedule_iterator_period)
	(schedule_iterator_duration): Change returns to time_t's.
	(schedule_iterator_next_time): Calculate the hypothetical next time.
	(init_task_schedule_iterator): Get next time from tasks instead of
	schedules.

	* src/manage_sql.h, src/manage.h: Update headers accordingly.

	* src/manage.c (manage_schedule): Set next time on task instead of
	schedule.

	* src/omp.c (buffer_schedules_xml): Adjust format to new schedule iterator
	time_t types.
	(omp_xml_handle_end_element): In CLIENT_GET_STATUS add task NEXT_TIME to
	SCHEDULE.

2010-03-18  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP command GET_SCHEDULES.

	* src/manage_sql.c (find_schedule, init_schedule_iterator)
	(schedule_iterator_uuid, schedule_iterator_name, schedule_iterator_name)
	(schedule_iterator_first_time, schedule_iterator_next_time)
	(schedule_iterator_period, schedule_iterator_duration): New functions.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (help_text): Add GET_SCHEDULES.
	(get_schedules_data_t): New type.
	(get_schedules_data_reset): New define.
	(command_data_t): Add get_schedules.
	(get_schedules_data): New variable.
	(client_state_t): Add CLIENT_GET_SCHEDULES.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add
	GET_SCHEDULES handling.
	(buffer_schedules_xml): New function.

2010-03-17  Matthew Mundell <matthew.mundell@greenbone.net>

	Add basis for task scheduling.  Hence increase database version to 15.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 15.

	* src/openvasmd.c (main): Add periodic manage_schedule call to the
	listen loop.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_STATUS add
	SCHEDULE to TASK.

	* src/manage.c (run_task): Only set report_id if an address.
	(manage_schedule): New function.  Forks processes to start scheduled
	tasks.

	* src/manage_sql.c (create_tables): Add table schedules.  Add field
	"schedule" to table tasks.
	(cleanup_manage_process): Add cleanup arg.  Just clear db handle if
	false, for forked processes.
	(task_schedule, schedule_uuid, schedule_name, set_schedule_next_time)
	(init_task_schedule_iterator, cleanup_task_schedule_iterator)
	(task_schedule_iterator_task, task_schedule_iterator_schedule)
	(task_schedule_iterator_next_time, task_schedule_iterator_start_due)
	(task_schedule_iterator_stop_due): New functions.
	(create_report): Allow report_id to be NULL.

	* src/manage.h: Add headers accordingly.
	(schedule_t): New type.

	* src/manage_sql.h: Add headers accordingly.

2010-03-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Correct command names in
	CLIENT_GET_TARGETS.  Closes #1329 (http://bugs.openvas.org/1329).

2010-03-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* README: Add testing heading and note about authenticating "om".
	Thanks to Hartmut Goebel for suggestion.  Also add a space and an
	apostrophe.

2010-03-12  Matthew Mundell <matthew.mundell@greenbone.net>

	Add resuming of stopped tasks, and hence new OMP command
	RESUME_STOPPED_TASK.

	* src/manage_sql.c (task_last_stopped_report, trim_partial_report): New
	functions.
	(set_task_end_time, set_scan_end_time): If time is NULL, NULL the field.

	* src/manage.c (send_user_rules): Add stopped_report arg.  If given ensure
	that already-completed hosts are denied.
	(run_task): New function.  Body from start_task.  If from_stopped arg is
	true, setup task report for resuming task, and pass report to
	send_user_rules.
	(start_task): Call through to run_task.
	(resume_stopped_task): New function.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (help_text): Add RESUME_STOPPED_TASK.
	(client_state_t): Add CLIENT_RESUME_STOPPED_TASK.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add RESUME_STOPPED_TASK handling.

2010-03-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* CMakeLists.txt: Indent certificate values like others.

2010-03-11  Michael Wiegand <michael.wiegand@greenbone.net>

	Switched to certificate based authentication.

	* src/openvasmd.c (serve_client, main): Pass our client
	certificate to openvas_server_new when establishing a
	connection. Add fallback defines for CLIENTCERT and CLIENTKEY if
	the are not defined externally.

	* CMakeLists.txt: Set OPENVAS_CLIENT_CERTIFICATE and
	OPENVAS_CLIENT_KEY to the expected certificate and key
	locations.

	* src/CMakeLists.txt: Set defines for certificate and key.

	* src/ompd.c (write_to_scanner): Set the password to a dummy
	value to stay OTP compatible and explain the reason in a
	comment.

	* INSTALL: Document setup for certificate based authentication.

	* README: Updated.

2010-03-04  Matthew Mundell <matthew.mundell@greenbone.net>

	Add task trends.

	* src/manage_sql.c (task_last_report, task_second_last_report)
	(task_trend): New functions.
	(REPORT_COUNT): Only set the variable if an address is given.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_STATUS send TREND
	in TASK.

2010-03-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_set_config_families): When updating the cache
	when the entire family is selected, increment the family count if the
	family is being newly selected instead of if the family was already
	selected.

2010-03-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (select_config_nvts): Remove table qualifier from
	sort field, now that fallback has such.

2010-03-04  Michael Wiegand <michael.wiegand@greenbone.net>

	Post-release version bump.

	* CMakeLists.txt: Updated version number.

2010-03-04  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 1.0.0-beta5 release.

	* CHANGES: Updated.

2010-03-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_REPORT pipe
	xsltproc output instead of using -o, so that the file is still created
	when the transformation result is empty.

2010-03-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (select_config_nvts, init_note_iterator): Ensure
	fallback sort fields include table when selecting in multiple tables.

2010-03-04  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/CPE.xsl: New file.

	* src/CMakeLists.txt: Install CPE.xsl.

2010-03-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd_report_html.xsl: Add copyright header.

2010-03-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage): Improve test for example task.  Insert
	config and target of example task as IDs instead of names.

2010-03-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ITG.xsl: New file.

	* src/CMakeLists.txt: Install ITG.xsl.

2010-03-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_REPORT try create
	the report from a configured stylesheet if all the other format cases
	fail to match the format.

2010-03-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* README: Update usage.

	* src/openvasmd.c (otp): New variable.
	(serve_client): Only serve OTP if OTP is enabled.
	(main): Add --otp.

2010-03-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd_report_html.xsl (wrap): Select substring correctly after
	wrap.

2010-02-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (sql, sql_x, sql_int, sql_string, sql_int64): Make
	static.

	* src/manage_sql.h (sql): Remove.

2010-02-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (set_task_requested): New function.

	* src/manage_sql.h: Add header accordingly.

	* src/manage.c (start_task): Use set_task_requested.

2010-02-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_nvt_iterator, select_config_nvts): If sort_field
	is NULL use name instead of ROWID, because name is selected.

2010-02-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.h: Use work email address.

2010-02-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Make manage library work now that the SQL portion is a real C file.

	* src/manage_sql.h: New file.

	* src/manage.c: Include manage_sql.h instead of tasks_sql.h.
	(inc_task_report_count, dec_task_report_count, print_tasks): Remove.  Old
	headers.
	(escalator_data): Move to manage_sql.h.
	(threat_message_type, message_type_threat, delete_reports): Make external
	so manage_sql.c can use them.

	* src/manage_sql.c: Add includes.
	(threat_message_type, message_type_threat, delete_reports): New
	declarations.  For private functions defined in manage.c.
	(init_otp_pref_iterator, otp_pref_iterator_name, otp_pref_iterator_value)
	(escalator_data, create_report, task_file_iterator_name)
	(target_lsc_credential): Make external so manage.c can use them.

	* TODO: Remove entry about file system backend.

2010-02-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/CMakeLists.txt: Link manage_sql to manage.

2010-02-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h: Rename to src/manage_sql.c.

	* src/manage_sql.c: New file.  Was src/tasks_sql.h.

2010-02-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/CMakeLists.txt: Remove TASKS_SQL directive.

2010-02-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.h, src/manage.c: Remove file system based task alternatives.

2010-02-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/CMakeLists.txt: Set -lsqlite3 on openvasmd directly.

2010-02-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (select_config_nvts): Add missing "ORDER BY"s.

2010-02-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (buffer_notes_xml): Add ORPHAN entity to indicate if note's
	task has been removed.

2010-02-25  Matthew Mundell <matthew.mundell@greenbone.net>

	Add a result attribute to OMP GET_NOTES.

	* src/omp.c (get_notes_data_t): Add result.
	(omp_xml_handle_start_element): Parse result attribute.
	(buffer_notes_xml): Add include_result arg.  Update caller.
	(omp_xml_handle_end_element): Pass result attribute to buffer_notes_xml.

2010-02-25  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP MODIFY_NOTE.

	* src/tasks_sql.h (modify_note): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (help_text): Add MODIFY_NOTE.
	(create_note_data_t): Add note_id.
	(create_note_data_reset): Free note_id.
	(modify_note_data_t): New type.
	(modify_note_data_reset): New define.
	(modify_note_data): New variable.
	(client_state_t): Add MODIFY_NOTE states.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add MODIFY_NOTE handling.
	(print_report_notes_latex, buffer_results_xml): Sort notes by creation
	time.

2010-02-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (print_report_latex): Correct typo in abstract.

2010-02-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Improve the HTML report.

	* src/openvasmd_report_html.xsl (scan_start, scan_end, note): Switch from
	tables to divs.  Add GSA-like style.
	(result) [list] [table]: Remove.
	(result) [issue]: Switch to divs.  Add GSA-like style.
	(report): Make summary like LaTeX report.  Improve layout a bit.  Use new
	issue names (High, Medium...).  Add more headings.  Ensure that each port
	is listed only once in the port summary.
	(/): Wrap everything in a styled table in a styled div.  Add end message.

2010-02-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_REPORT add a "dvi"
	format with the "pdf" case.

2010-02-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Get notes into the LaTeX report.

	* src/omp.c (latex_print_verbatim_text): Add row_colour arg.  Update
	callers.
	(latex_header): Define colour openvas_user_note.
	(print_report_notes_latex): New function.
	(print_report_latex): Add task arg.  Update callers.  Print notes.
	(omp_xml_handle_end_element): In CLIENT_GET_REPORT in the "pdf" case, get
	the task for print_report_latex.

2010-02-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd_report_html.xsl: Convert tabs to spaces.

2010-02-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Get notes into the HTML report.

	* src/omp.c (print_report_xml): Add task arg.  Call buffer_results_xml to
	get results to print.
	(omp_xml_handle_end_element): In CLIENT_GET_REPORT in the "html" and
	"html-pdf" cases pass task to print_report_xml and output the "html"
	xsl tranform errors to a file.

	* src/openvasmd_report_html.xsl (wrap, note): New templates.
	(result) [issue]: Output notes.

2010-02-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_note_iterator): Remove table specifier from sort
	columns.

2010-02-18  Matthew Mundell <matthew.mundell@greenbone.net>

	Add TASK to OMP GET_NOTES.

	* src/omp.c (get_notes_data_t): Add task_id.
	(get_notes_data_reset): Free task_id.
	(client_state_t): Add CLIENT_GET_NOTES_TASK.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add NVT to
	GET_NOTES.

	* src/tasks_sql.h (NOTE_COLUMNS): New define.
	(init_note_iterator): If result is 0 and task is above 0, then select
	all notes on the task, otherwise select all notes on the result as before.

2010-02-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* ChangeLog: Restore overwritten entry.

2010-02-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db_postgres.sql (notes): Link to result instead of report.

	* doc/db.png: New file.

2010-02-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (message_type_threat): New function.

	* src/tasks_sql.h (note_iterator_threat): Convert message type to threat.

2010-02-17  Matthew Mundell <matthew.mundell@greenbone.net>

	Add a details flag to OMP GET_NOTES.

	* src/omp.c (get_results_data_t): Add details.
	(omp_xml_handle_start_element): Init GET_NOTES details flag.
	(buffer_notes_xml): New function.  Body from buffer_results_xml.
	(buffer_results_xml): Call buffer_notes_xml.
	(omp_xml_handle_end_element): In CLIENT_GET_NOTES call buffer_notes_xml
	to create body of response.

2010-02-17  Matthew Mundell <matthew.mundell@greenbone.net>

	Add NVT to OMP GET_NOTES.

	* src/tasks_sql.h (init_note_iterator): Add nvt arg.

	* src/manage.h: Update header accordingly.

	* src/omp.c: Update init_note_iterator callers.
	(get_notes_data_t): Add nvt_oid.
	(get_notes_data_reset): Free nvt_oid.
	(client_state_t): Add CLIENT_GET_NOTES_NVT.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add NVT to
	GET_NOTES.

2010-02-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_NOTES also send
	the note text.

2010-02-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_REPORT in the XML
	case include notes in filter details.

2010-02-17  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP GET_RESULTS.

	* src/tasks_sql.h (init_result_iterator): Add result arg.

	* src/manage.h: Update header accordingly.

	* src/omp.c: Add result arg to init_result_iterator calls.
	(help_text): Add GET_RESULTS.
	(get_results_data_t): New type.
	(get_results_data_reset): New function.
	(command_data_t): Add get_results.
	(get_results_data): New variable.
	(client_state_t): Add CLIENT_GET_RESULTS.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add
	GET_RESULTS handling.

2010-02-17  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): When creating a task, break
	if malcondition was found. Free modify_task_name in success condition.

2010-02-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (insert_nvt_selectors): Set family when inserting family
	selector.

2010-02-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Implement more note constraints.  Create results with UUIDs.

	* src/tasks_sql.h (sql_hosts_contains): New function.
	(init_manage_process): Add SQL function hosts_contains.
	(init_manage): Give predefined result a UUID.
	(make_result): Initialise result UUID.
	(create_note): Translate the threat to a message type before inserting.
	(init_note_iterator): Add task param.  Limit iteration according to hosts,
	port, threat and task.

	* src/manage.h: Update header accordingly.

	* src/manage.c (threat_message_type): New function.

	* src/omp.c (buffer_results_xml): Get notes flags from params.  Add task
	param and pass to init_note_iterator.  Update caller.
	(omp_xml_handle_end_element): In CLIENT_GET_NOTES pass task to
	init_note_iterator.

2010-02-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_NOTE correct
	message typo.

2010-02-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (buffer_xml_append_printf, buffer_results_xml): New functions.
	(omp_xml_handle_end_element): In CLIENT_GET_REPORT in the XML case, output
	the results entity with buffer_results_xml.

2010-02-15  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* INSTALL: List doc-full as possible make target.

2010-02-15  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* INSTALL: Sorted library dependencies alphabetically, added glib,
	raised required openvas-libraries version.

2010-02-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (print_report_xml): Add id to RESULT.
	(omp_xml_handle_end_element): In CLIENT_GET_REPORT in the XML case, add
	id to RESULT.

2010-02-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ovas-mngr-comm.c (sendn_to_server): Use %zu for size_t's.

2010-02-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_note_iterator): Ensure the note applies to the NVT
	of the result.
	(note_iterator_creation_time, note_iterator_modification_time): Switch
	return to int.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (ctime_strip_newline): New function.
	(omp_xml_handle_end_element): In CLIENT_GET_REPORT send formatted dates
	instead of integers.

2010-02-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_note_iterator): Include notes applied to all
	results when the request is for a single result.

2010-02-12  Matthew Mundell <matthew.mundell@greenbone.net>

	Add a "notes_details" attribute to GET_REPORTS.

	* src/tasks_sql.h (result_uuid, note_iterator_creation_time)
	(note_iterator_modification_time, note_iterator_text, note_iterator_hosts)
	(note_iterator_port, note_iterator_threat, note_iterator_task)
	(note_iterator_result): New functions.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (get_report_data_t): Add notes_details flag.
	(omp_xml_handle_start_element): Parse GET_REPORT notes_details flag.
	(omp_xml_handle_end_element): In CLIENT_GET_REPORT in the XML case send
	all notes info if the notes_details flag is set.

2010-02-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Add a "notes" attribute to GET_REPORTS.

	* src/tasks_sql.h (init_result_iterator): Add ROWID.
	(result_iterator_result): New function.
	(result_iterator_subnet, result_iterator_host)
	(result_iterator_port, result_iterator_nvt_oid)
	(result_iterator_type, result_iterator_descr): Increment positions.
	(init_note_iterator): Add result arg.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (get_report_data_t): Add notes flag.
	(omp_xml_handle_start_element): Parse GET_REPORT notes flag.
	(omp_xml_handle_end_element): In CLIENT_GET_REPORT in the XML case send
	the notes if the notes flag is set.

2010-02-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (create_tables): Rename report to result in table notes.
	(create_note, init_note_iterator): Use "result" instead of "report" for
	result column.

2010-02-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (user_owns_result): In SQL specify table for UUID
	and correct table name.

2010-02-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_NOTE pass
	&result to find_result instead of passing &task.

2010-02-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (find_note): Remove redundant owner constraint.

2010-02-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP GET_NOTES.

	* src/tasks_sql.h (init_note_iterator, note_iterator_uuid)
	(note_iterator_nvt_oid, note_iterator_nvt_name): New functions.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (help_text): Add GET_NOTES.
	(get_notes_data_t): New type.
	(get_notes_data_reset): New function.
	(command_data_t): Add get_notes.
	(get_notes_data): New variable.
	(client_state_t): Add CLIENT_GET_NOTES.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add
	GET_NOTES handling.

2010-02-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (main): Include --rebuild in error message.

2010-02-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP DELETE_NOTE.

	* src/tasks_sql.h (find_note, delete_note): New functions.

	* src/manage.h: Add headers accordingly.
	(note_t): New type.

	* src/omp.c (help_text): Add DELETE_NOTE.
	(delete_note_data_t): New type.
	(delete_note_data_reset): New function.
	(command_data_t): Add delete_note.
	(delete_note_data): New variable.
	(client_state_t): Add CLIENT_DELETE_NOTE.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add
	DELETE_NOTE handling.

	* src/tests/omp_help_0.c (help_text): Add DELETE_NOTE.

2010-02-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP CREATE_NOTE.

	* src/tasks_sql.h (user_owns_result, find_result, create_note): New
	functions.
	(create_tables): Add notes table.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (help_text): Add CREATE_NOTE.
	(create_note_data_t): New type.
	(create_note_data_reset): New function.
	(command_data_t): Add create_note.
	(create_note_data): New variable.
	(client_state_t): Add CREATE_NOTE states.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add CREATE_NOTE handling.

	* doc/db_postgres.sql (notes): New table.
	(results): Add uuid.

	* src/tests/omp_help_0.c (help_text): Add CREATE_NOTE.

2010-02-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* README: Correct typo and grammar.

2010-02-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Add result UUIDs.  Hence increase database version to 14.  Add
	database migration from 13 to 14.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 14.

	* src/tasks_sql.h (sql_make_uuid, migrate_13_to_14): New functions.
	(create_tables): Add UUID column to results.
	(database_migrators): Add migrate_13_to_14.
	(init_manage_process): Setup SQL function make_uuid.

2010-02-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (print_report_latex): Note in the abstract if the task was
	still running.  Check host end time before printing it.

2010-02-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (find_target, find_lsc_credential, find_agent): Quote
	name.
	(find_config): Free quoted_name on error too.

2010-02-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (find_config): Look for the config owned by the current
	user.
	(create_config, create_config_rc, copy_config): Limit the "already exists"
	check to the config owned by the current user.
	(delete_config): Remove config by ROWID instead of by name.

2010-02-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (find_escalator): Look for the escalator owned by the
	current user.
	(create_escalator): Limit the "already exists" check to the escalator
	owned by the current user.

2010-02-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (add_task_escalator): Take escalator_t instead of name.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_TASK pass
	escalator_t instead of name to add_task_escalator.

2010-02-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (find_lsc_credential): Look for the LSC credential owned
	by the current user.
	(create_lsc_credential): Limit the "already exists" check to the LSC
	credentials owned by the current user.

2010-02-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (user_owns, user_owns_uuid, find_target)
	(create_target): Terminate SQL statements.
	(find_agent): Look for the agent owned by the current user.
	(create_agent): Limit the "already exists" check to the agents owned by
	the current user.

2010-02-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/lsc_user.c (file_utils_copy_file): Remove G_GSIZE_MODIFIER from
	format string.  Thanks to Stephan Kleine.

2010-02-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 13.  (Missing
	file from commit yesterday).

2010-02-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (find_target): Look for the target owned by the current
	user.
	(create_target): Limit the "already exists" check to the targets owned by
	the current user.

2010-02-09  Matthew Mundell <matthew.mundell@greenbone.net>

	Use UUIDs for NVT selector names instead of using the name of the
	associated config.  Hence increase database version to 13.  Add
	database migration from 12 to 13.  Preparation for enabling users
	to name their configs with names used by other users.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 13.

	* src/tasks_sql.h (MANAGE_NVT_SELECTOR_UUID_ALL): New define.
	(insert_rc_into_config): Add NVT selector arg.  Update callers.
	(migrate_12_to_13): New function.
	(database_migrators): Add migrate_12_to_13.
	(init_manage): Use UUID for predefined "All" NVT selector.
	(create_config, create_config_rc, copy_config): Set NVT selector name to
	generated UUID.
	(clude): Rename arg config_name to nvt_selector.
	(delete_config): Get NVT selector name from right column.
	(init_nvt_selector_iterator): Remove completed todo.

2010-02-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ovas-mngr-comm.c (sendn_to_server, write_string_to_server)
	(write_to_server_buffer): Cast string format precision modifier to int.
	Thanks to Stephan Kleine.

2010-02-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.h (manage_complete_nvt_cache_update): Add missing arg.
	Thanks to Stephan Kleine.

2010-02-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Ensure all parameter lists
	that are on the line following the function name are indented with a
	single character.

2010-02-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otp.c (blank_control_chars): New function.
	(process_otp_scanner_input): Blank control chars in iso_field before
	converting to UTF-8.

2010-02-08  Michael Wiegand <michael.wiegand@greenbone.net>

	Post-release version bump.

	* CMakeLists.txt: Updated version number.

2010-02-08  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 1.0.0-beta4 release.

	* CHANGES: Updated.

2010-02-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* TODO: Flush tabs from within entries.

	* doc/openvasmd.8, doc/openvasmd.html: Sync with generated version.

2010-02-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (restore_db): Add missing argument.  Thanks to
	Stephan Kleine for reporting.

2010-02-05  Matthew Mundell <matthew.mundell@greenbone.net>

	Thanks to Stephan Kleine for reporting these.

	* src/omp.c (send_to_client, send_certificate): Use %zu for size_t.

	* src/oxpd.c (read_protocol): Cast precision arg to int.

	* src/lsc_user.c (file_utils_copy_file): Use the right format specifiers.

	* src/tasks_sql.h (escalate_1): Return -1 if to_address is NULL.

2010-02-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (latex_escape_text): New function.
	(print_report_latex): Put close paren on line with code.  Pass port in
	summary table column and subsubsection through latex_escape_text.

2010-02-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (create_target): Take lsc_credential_t instead of name.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_TARGET
	pass lsc_credential_t instead of credential name to create_target.

2010-02-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (manage_set_config_nvts): Init new_nvt_count.

	* src/ompd.c (serve_omp): Ensure client_input_stalled in always
	initialised.

2010-02-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_escalator_task_iterator): Take escalator_t instead
	of name.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_ESCALATORS
	pass escalator_t instead of escalator name to init_escalator_task_iterator.

2010-02-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_escalator_iterator): Take escalator_t instead of
	name.  Update caller.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_ESCALATORS
	pass escalator_t instead of escalator name to init_escalator_iterator.

2010-02-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (find_escalator): Move to top of page like on other
	pages.
	(delete_escalator): Take escalator_t instead of name.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_DELETE_ESCALATOR
	pass escalator_t instead of escalator name to delete_escalator.

2010-02-05  Michael Wiegand <michael.wiegand@greenbone.net>

	Post-release version bump.

	* CMakeLists.txt: Updated version number.

2010-02-05  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 1.0.0-beta3 release.

	* CHANGES: Updated.

2010-02-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (config_insert_preferences): Init quoted_nvt_name from
	NVT name instead of preference name.

2010-02-04  Matthew Mundell <matthew.mundell@greenbone.net>

	Remove UNIQUE constraint from name of user resource tables.  Hence
	increase database version to 12.  Add database migration from 11 to 12.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 12.

	* src/tasks_sql.h (create_tables): Remove UNIQUE from name column of
	tables agents, configs and escalators.
	(migrate_11_to_12): New function.
	(database_migrators): Add migrate_11_to_12.

	* doc/db_postgres.sql (agents, escalators, targets, configs)
	(lsc_credentials): Remove UNIQUE from name.

2010-02-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_agent_iterator): Take config_t instead of name.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_AGENTS pass
	agent_t to init_agent_iterator instead of passing name.

2010-02-04  Matthew Mundell <matthew.mundell@greenbone.net>

	Reference targets and configs by ID in the tasks table, instead of by
	name.  Hence increase database version to 11.  Add database migration
	from 10 to 11.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 11.

	* src/tasks_sql.h (create_tables): Make config and target in table tasks
	INTEGERs.
	(migrate_10_to_11): New function.
	(database_migrators): Add migrate_10_to_11.
	(task_config, task_config_name, delete_config, config_in_use)
	(manage_set_config_preference, manage_set_config_preference)
	(manage_set_config_nvts, init_config_task_iterator): Treat task config
	reference as integer.
	(set_task_config): Change config from name to integer.
	(task_target, delete_target, target_in_use)
	(init_target_task_iterator): Treat task target reference as integer.
	(set_task_target): Change target from name to integer.
	(append_to_task_config, append_to_task_target): Remove.
	(create_target): Return created target via arg.
	(create_config_rc): Return created config via arg.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_CONFIG and
	CLIENT_CREATE_TARGET add dummy return args to create_target and
	create_config_rc calls.  In CLIENT_CREATE_TASK set the task config and
	target from the given names.
	(omp_xml_handle_text): In CLIENT_CREATE_TASK_CONFIG and
	CLIENT_CREATE_TASK_TARGET append to global instead of appending into
	task.

2010-02-04  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/task_sql.h (openvas_user_uuid, authenticate): Minor doc.
	(openvas_authenticate_uuid): Added comments.

2010-02-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (latex_header): Switch encoding to UTF-8.

2010-02-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (insert_nvt_selectors): Move to NVT selectors page.
	(find_config): Move to top of page like on other pages.
	(insert_rc_into_config): Doc config_name param.

2010-02-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (config_id_nvt_selector): Remove.  Rename
	config_nvt_selector.  Update callers.
	(config_nvt_selector): New function.  Was config_id_nvt_selector.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_TASK update
	config_id_nvt_selector call name.

2010-02-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (copy_config): Take config_t instead of name.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_CONFIG
	pass config_t instead of config name to copy_config.

2010-02-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (start_task): Get the config directly, instead of via the
	config name.

2010-02-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_otp_pref_iterator): Take config_t instead of
	name.

	* src/manage.c (send_config_preferences): Take config_t instead of
	name.  Pass config_t to init_otp_pref_iterator.
	(start_task): Pass config_t to send_config_preferences.

2010-02-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_config_pref_iterator)
	(config_pref_iterator_name, config_pref_iterator_value): Remove,
	superceded by newer iterators.

	* src/manage.h: Remove headers accordingly.

2010-02-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_preference_iterator): Take config_t instead of
	name.
	(make_task_rcfile): Pass config_t to init_preference_iterator.

2010-02-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (delete_config): Take config_t instead of name.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_DELETE_CONFIG
	pass config_t instead of config name to delete_config.

2010-02-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_DELETE_TARGET
	remove auth case from delete_target return check.

2010-02-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (set_target_hosts, target_hosts)
	(target_lsc_credential, set_target_hosts): Take target_t instead of name.
	(task_target): Return target_t instead of name.
	(make_task_rcfile): Work with target_t instead of name.
	(target_name): New function.

	* src/manage.h: Update headers accordingly.

	* src/manage.c (start_task): Work with target_t instead of name.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_TASK and
	CLIENT_GET_STATUS work with target_t instead of target name.

2010-02-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (serve_omp): Convert scanner input to UTF-8 before
	logging.

	* src/otp.c (process_otp_scanner_input): Turn off tracing of ISO input.

2010-02-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_target_iterator): Add ROWID.
	(target_iterator_target): New function.
	(target_iterator_name, target_iterator_hosts, target_iterator_comment)
	(target_iterator_lsc_credential): Shift column positions.
	(target_in_use): Take target_t instead of name.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_TARGETS pass a
	target_t to target_in_use instead of passing a name.

2010-02-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_target_task_iterator): Take target_t instead of
	name.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_TARGETS pass a
	target_t to init_target_task_iterator instead of passing a name.

2010-02-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_target_iterator): Take target_t instead of name.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_TARGETS pass a
	target_t to init_target_iterator instead of passing a name.

2010-02-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (find_target): New function.
	(delete_target): Take target_t instead of name.

	* src/manage.h: Update headers accordingly.
	(target_t): New type.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_DELETE_TARGET pass
	target_t to delete_target instead of passing a name.

2010-02-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_lsc_credential_iterator): Add ROWID.
	(lsc_credential_iterator_lsc_credential): New function.
	(lsc_credential_iterator_name, lsc_credential_iterator_login)
	(lsc_credential_iterator_password, lsc_credential_iterator_public_key)
	(lsc_credential_iterator_private_key, lsc_credential_iterator_rpm)
	(lsc_credential_iterator_deb, lsc_credential_iterator_exe)
	(lsc_credential_iterator_comment, lsc_credential_iterator_in_use): Adjust
	column position.
	(init_lsc_credential_target_iterator): Take lsc_credential_t instead of
	name.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_LSC_CREDENTIALS
	Pass lsc_credential_t to init_lsc_credential_target_iterator instead of
	passing name.

2010-02-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (target_lsc_credential_name): Remove.
	(target_lsc_credential): New function.
	(init_lsc_credential_iterator): Take lsc_credential_t instead of
	credential name.

	* src/manage.h: Update header accordingly.

	* src/manage.c (start_task): Pass lsc_credential_t to
	init_lsc_credential_iterator instead of name.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_LSC_CREDENTIALS
	pass lsc_credential_t to init_lsc_credential_iterator instead of name.

2010-02-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_manage): Put fullstop on empty config description.

2010-02-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (migrate_9_to_10): Correct comment typo.
	(config_in_use): Also check for empty config.

2010-02-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (manage_set_config_nvts): Update family count when
	updating cached config info.

2010-02-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (handle_sigabrt): Check if already in handler.

	* src/tasks_sql.h (manage_set_config_nvts)
	(manage_set_config_families): Free selector after last use.

	* src/tracef.h (tracef) [TRACE]: Remove UTF-8 conversion.

2010-01-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/CMakeLists.txt: Make warnings errors.

2010-01-28  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* doc/openvasmd.8.xml: Added some of the new commands.

2010-01-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_start_element): In
	CLIENT_CREATE_LSC_CREDENTIAL init modify_task_parameter in the
	password case, to indicate that the element has been received.

2010-01-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (find_lsc_credential): New function.
	(delete_lsc_credential): Switch name arg to a lsc_credential_t.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_DELETE_LSC_CREDENTIAL
	pass lsc_credential_t to delete_lsc_credential instead of name.

2010-01-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_manage): Include only the Nmap scanner from
	"Port scanners" in the "All" NVT selector.

2010-01-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (print_report_latex): Spread headings out like rest of file.
	Bring line lengths under 80.

2010-01-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (CONFIG_ITERATOR_FIELDS): New define.
	(init_config_iterator, update_all_config_caches): Use
	CONFIG_ITERATOR_FIELDS for SELECT fields, so that both functions
	always use the same fields.
	(family_count): Always count, otherwise the initial value sticks during
	an update.

2010-01-26  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Post-release version bump.

	* CMakeLists.txt: Updated version number.

2010-01-26  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Preparing the openvas-manager 1.0.0-beta2 release.

	* CMakeLists.txt: Updated version number.

	* CHANGES: Updated.

2010-01-26  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/ovas-mngr-comm.h (make_session, end_session): Removed prototypes
	(there is no implementation).

2010-01-26  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/omp.c (latex_header): Define "inactive" (gray) color.
	(print_report_latex): Print placeholder text about filters, if some
	shown results are filtered, added respective TODO.

2010-01-26  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): "Early break" if requested
	report uuid is NULL.

2010-01-26  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/tasks_sql.h (migrate_9_to_10): Create a "dummy" uuid in memory
	for users that do not have one on disk (e.g. because they were
	deleted).

2010-01-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (agent_t): Remove.  Move to manage.h.
	(find_agent): New function.
	(delete_agent): Take an agent instead of agent name.

	* src/manage.h: Update headers accordingly.
	(agent_t): New type.  From tasks_sql.h.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_DELETE_AGENT find
	agent and pass agent_t to delete_agent.

2010-01-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (migrate_8_to_9): Ensure that tables added since version
	8 exist.

2010-01-25  Matthew Mundell <matthew.mundell@greenbone.net>

	Add user UUIDs.  Hence increase database version to 10.  Add database
	migration from 9 to 10.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 10.

	* src/manage.h (credentials_t): Add uuid.

	* src/tasks_sql.h (task_owner_uuid, openvas_user_uuid)
	(openvas_authenticate_uuid, migrate_9_to_10): New functions.
	(user_owns, user_owns_uuid, create_escalator, init_escalator_iterator)
	(init_escalator_task_iterator, init_task_iterator, task_count)
	(make_report, make_task, create_target, init_target_iterator)
	(init_target_task_iterator, create_config, create_config_rc)
	(copy_config, init_config_iterator, create_lsc_credential)
	(init_lsc_credential_iterator, create_agent, init_agent_iterator): Get
	the user ROWID by UUID instead of by name.
	(create_tables): Add "uuid" to users.  Drop UNIQUE from users "name".
	(database_migrators): Add migrate_9_to_10.
	(init_manage): Init current_credentials uuid.  Set UUIDs instead of
	names around calls to task functions.
	(authenticate): Ensure a user with the UUID of the authenticated user
	exists in the database.
	(request_delete_task, delete_task): Check for credential UUID instead of
	name.

	* doc/db_postgres.sql (users): Add uuid, remove unique from name.

2010-01-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* README: Capitalise names.

2010-01-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otpd.c (serve_otp): Filter logging of input that may contain
	passwords.

2010-01-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ompd.c (serve_omp): Filter logging of input that may contain
	passwords.

	* src/oxpd.c (read_protocol): Filter logging of input that may contain
	passwords.

2010-01-25  Matthew Mundell <matthew.mundell@greenbone.net>

	Add rest of NSIS package generation.

	* src/lsc_user.c (ssh_privkey_create, ssh_pubkey_create): Free astdout
	and astderr.
	(lsc_user_rpm_create): Init and free standard_out and standard_err.
	Neaten messages.
	(execute_alien): Print command output on error. Neaten message.
	(create_nsis_script, execute_makensis, lsc_user_exe_create): New
	functions.
	(lsc_user_all_create): Enable and complete NSIS generation.

2010-01-25  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* README: Added note from INSTALL about special "om" user.

2010-01-22  Matthew Mundell <matthew.mundell@greenbone.net>

	Clean up the database better on exits from signals.

	* src/omp.c (cleanup_manage_process): Set any running task to stopped,
	whatever its state is.
	(manage_cleanup_process_error): New function.

	* src/manage.h: Add header accordingly.

	* src/openvasmd.c (handle_sigabrt, handle_sigsegv): New functions.
	(handle_sigterm, handle_sighup, handle_sigint): Call
	cleanup_manage_process before exit.
	(main): Register SIGABRT and SIGSEGV handlers.

2010-01-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (send_reports): Wrap the reports in a REPORTS.

2010-01-22  Matthew Mundell <matthew.mundell@greenbone.net>

	When starting a task send the rules from the user's OpenVAS auth
	directory, instead of from preferences.

	* CMakeLists.txt: Setup OPENVAS_USERS_DIR.

	* src/CMakeLists.txt: Pass OPENVAS_USERS_DIR to compiler.

	* src/manage.c (send_config_rules): Define out.
	(send_user_rules): New function.
	(start_task): Send rules with send_user_rules.

2010-01-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* README: Add --rebuild example.  Note when to update cache.

2010-01-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* INSTALL: Update UUID library.

2010-01-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (create_lsc_credential): Allow \ in login name.  Move
	name quotation to follow login name check.

2010-01-18  Matthew Mundell <matthew.mundell@greenbone.net>

	Hack ISO-8859-1 to UTF-8 conversion on OTP input.  Covers most cases.

	* src/otp.c (process_otp_scanner_input): In the <|> loop convert field
	to UTF-8 before processing.  As a consequence jump instead of returning
	to ease freeing the converted string, and use "match" instead of "field"
	to read past the end of the field.

	* src/omp.c (send_to_client, send_certificate, DEF, send_nvt): Remove
	previous UTF-8 hacks.

	* src/manage.c: Add query about sending ISO-8859-1 to server.

2010-01-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_manage): Setup dummy user around find_task.

2010-01-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (config_nvt_selector): Make static.
	(task_config): New function.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_TASK use
	config_id_nvt_selector instead of config_nvt_selector.

2010-01-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (update_config_caches, init_config_iterator): Change
	config type to config_t.  Update callers.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_CONFIGS if the
	request includes a config then find config and pass the config_t to
	init_config_iterator instead of the config name.

2010-01-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h: (CONFIG_ID_FULL_AND_FAST)
	(CONFIG_ID_FULL_AND_FAST_ULTIMATE, CONFIG_ID_FULL_AND_VERY_DEEP)
	(CONFIG_ID_FULL_AND_VERY_DEEP_ULTIMATE): New defines.
	(init_manage): Use defines for config IDs.
	(config_in_use, init_config_task_iterator, init_nvt_selector_iterator)
	(config_family_count, config_nvt_count): Change config arg from name to
	config_t.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_CONFIGS within
	the config iteration pass config_t to config functions instead of the
	config name.

2010-01-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_config_iterator): Add ROWID to selection.  Adjust
	column numbers in callers.
	(config_iterator_config): New function.
	(nvt_preference_iterator_config_value): Change config parameter to a
	config_t.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_NVT_DETAILS
	pass config_t to nvt_preference_iterator_config_value.

2010-01-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_manage): Init current user around
	set_task_run_status, so event check will work.
	(task_owner_name): New function.

	* src/manage.h: Update header accordingly.

2010-01-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (config_nvt_timeout): Change config from name to
	config_t.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_NVT_DETAILS
	find config if given, and pass config_t to config_nvt_timeout.

2010-01-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db_postgres.sql (agents, escalators, targets, configs, reports)
	(lsc_credentials): Add owner field.
	(tasks): Move owner up in definition.

2010-01-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Add ownership of targets, configs, lsc_credentials, escalators, reports
	and agents.  Hence increase database version to 9.  Add database
	migration from 8 to 9.  Check ownership before performing any OMP
	command that accesses or modifies these resources.  Limit resource
	listing operations to the resources owned by the current user.  Allow
	any user to access the predefined resources as well as any resources
	defined prior to migration to version 9.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 9.

	* src/tasks_sql.h: Improve doc on writing a migrator.
	(create_tables): Add owner column to targets, configs, lsc_credentials,
	escalators, reports and agents.  Make owner in tasks an integer, and move
	it forward in the definition.
	(config_t): Remove.  Move to manage.h.
	(find_config): Move declaration to manage.h.  Change task_t param to
	config_t.  Quote name.
	(update_config_caches): Add arg to declaration.
	(update_all_config_caches, user_owns, user_owns_uuid)
	(update_config_cache): New static functions.
	(set_target_hosts): Make static in declaration.
	(next): Correct param description in doc.
	(migrate_5_to_6, manage_complete_nvt_cache_update): Use the "all users"
	config cacher, update_all_config_caches.
	(migrate_8_to_9, config_id_nvt_selector): New functions.
	(database_migrators): Add migrate_8_to_9.
	(create_escalator, make_report, create_target, create_config)
	(create_config_rc, copy_config, create_lsc_credential, create_agent): Set
	owner.
	(delete_escalator, find_escalator, find_task, find_report, delete_target)
	(target_hosts, target_lsc_credential_name, config_nvt_timeout)
	(delete_config, config_nvt_selector, delete_lsc_credential)
	(delete_agent): Check ownership.
	(init_escalator_iterator, init_escalator_task_iterator)
	(init_task_iterator, task_count, init_target_iterator)
	(init_target_task_iterator, init_config_iterator)
	(init_lsc_credential_iterator, init_agent_iterator): Restrict to resources
	owned by current user.
	(inc_task_int, dec_task_int): Remove.
	(append_to_task_string): Make static.
	(init_manage): Init owner columns in predefined resources.  Improve
	find_task call for example task.
	(task_config): Remove.  Rename to task_config.  Update callers.
	(init_report_iterator): Remove alternate behaviour for NULL task.
	(init_result_iterator, init_host_iterator): Remove alternate behaviour for
	NULL report.
	(make_task): Match the users SQL to other such statements.
	(manage_set_config_preference, init_nvt_iterator, config_nvts_growing)
	(config_families_growing, manage_set_config_families): Change the config
	parameter from the config name to a config_t.  Update callers.
	(manage_set_config_nvts, switch_representation)
	(select_config_nvts): Change the config parameter from the config name to
	a config_t.  Use the selector name to refer to the selector instead of the
	config name; both strings should be the same anyway.  Update callers.
	(update_config_caches): Call update_config_cache.
	(nvt_preference_iterator_config_value): Add doc.

	* src/manage.c (nvt_selector_plugins): Change the config parameter from
	the config name to a config_t.  This is required because init_nvt_iterator
	now takes a config_t.
	(start_task): Pass config_t to nvt_selector_plugins.
	(COMMAND): Add doc.

	* src/manage.h: Update headers accordingly.
	(config_t): New type.  Moved from tasks_sql.h.

	* src/omp.c (STATUS_ERROR_ACCESS, STATUS_ERROR_ACCESS_TEXT)
	(STATUS_ERROR_BUSY, STATUS_ERROR_BUSY_TEXT): New defines.  The BUSY ones
	are just to match the Administrator.
	(command_data_init, command_data, create_config_data, get_report_data)
	(get_system_reports_data, import_config_data): Add docs.
	(XML_ERROR_ACCESS): New macro.
	(omp_xml_handle_end_element): In CLIENT_GET_NVT_DETAILS and
	CLIENT_MODIFY_CONFIG find the named config first, so that the permission
	checks are performed.  In CLIENT_DELETE_AGENT, CLIENT_DELETE_CONFIG,
	CLIENT_DELETE_ESCALATOR, CLIENT_DELETE_LSC_CREDENTIAL and
	CLIENT_DELETE_TARGET handle new permission returns.

2010-01-15  Matthew Mundell <matthew.mundell@greenbone.net>

	Prevent deleting of active reports.

	* src/tasks_sql.h (delete_report): Just return 2 if report is active.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_DELETE_REPORT handle
	delete_report active report return.

2010-01-12  Michael Wiegand <michael.wiegand@greenbone.net>

	Post-release version bump.

	* CMakeLists.txt: Updated version number.

2010-01-12  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 1.0.0-beta1 release.

	* CMakeLists.txt: Updated version number.

	* CHANGES: Updated.

2010-01-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Add a search_phrase attribute to OMP GET_REPORT and switch GET_REPORT to
	the new callback data mechanism.

	* src/tasks_sql.h (where_levels): Make static.  Add NULL check.
	(where_search_phrase): New function.
	(init_result_iterator, report_scan_result_count): Add param search_phrase.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (create_config_data_reset, get_system_reports_data_reset)
	(command_data_init): Make static.
	(name_command_data_reset): Define out for now.
	(get_report_data_t): New type.
	(get_report_data_reset): New function.
	(get_report_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(print_report_latex, print_report_xml): Switch GET_REPORT to pass data
	between callbacks via get_report_data.  Add GET_REPORT attribute
	"search_phrase".

2010-01-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_otp_pref_iterator): Correct string in assertion.

2010-01-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_manage): Add NVT names to cache.
	(result_iterator_nvt): Remove, rename with _oid.
	(result_iterator_nvt_oid, result_iterator_nvt_name): New functions.

	* src/manage.h: Update headers accordingly.

	* src/omp.c: Update result_iterator_nvt callers.
	(print_report_xml): Add name to NVT element.
	(omp_xml_handle_end_element): In CLIENT_GET_REPORT XML report, add name
	to NVT element.

2010-01-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Send all preferences when starting a task, even those which have the
	same value on the server, to match the client behaviour.

	* src/tasks_sql.h (init_otp_pref_iterator, otp_pref_iterator_name)
	(otp_pref_iterator_value): New functions.

	* src/manage.c (send_config_preferences): Iterate with otp_pref_iterator
	functions.

2010-01-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (manage_system_report): If the graph is empty, try get
	the "blank" graph.

	* INSTALL: Add note about openvasmr blank type.

	* README: Add space.

2010-01-07  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP command GET_SYSTEM_REPORTS.

	* src/manage.c (make_array, free_array): New functions.  From omp.c.
	(get_system_report_types, init_system_report_type_iterator)
	(cleanup_report_type_iterator, next_report_type)
	(report_type_iterator_name, report_type_iterator_title)
	(manage_system_report): New functions.

	* src/manage.h: Add headers accordingly.
	(report_type_iterator_t): New type.

	* src/omp.c (make_array, free_array): Remove.  Move to manage.c.
	(help_text): Add GET_SYSTEM_REPORTS.
	(name_command_data_t, get_system_report_data_t): New types.
	(name_command_data_reset, get_system_report_data_reset): New functions.
	(command_data_t): Add get_system_report and name_command.
	(get_system_reports_data): New variable.
	(client_state_t): Add CLIENT_GET_SYSTEM_REPORTS.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add
	GET_SYSTEM_REPORTS handling.  In CLIENT_GET_TARGETS free current_name.

	* INSTALL: Add run time requirements.

	* src/tests/omp_help_0.c (help_text): Add GET_SYSTEM_REPORTS.

2010-01-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (insert_nvt_selectors): Set the family column when
	inserting the NVTs.  Improve checking of types of given selectors.

2010-01-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (create_config): Add name return arg.  Find a unique
	name if a config with the same name exists already.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): Include config name in
	CREATE_CONFIG import response.

2010-01-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* README: Note OPENVAS_TEST_HOST and OPENVAS_TEST_PORT.

2010-01-06  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* CMakeLists.txt: Added clumsy for check for libopenvas version from
	gsad.

2010-01-05  Matthew Mundell <matthew.mundell@greenbone.net>

	Convert the GET_CONFIGS "nvt_selector" attribute to an "export"
	attribute.  Add importing of entire configs to CREATE_CONFIG.
	Use a cleaner style of passing data between the parser callbacks for
	the import implementation, as a start towards using a cleaner data
	passing mechanism throughout.

	* src/tasks_sql.h (insert_nvt_selectors, config_insert_preferences)
	(create_config_rc): New functions.
	(create_config): Move body to create_config_rc.  Reimplement to expect
	full config.
	(update_config_caches): Add config arg.  Update caller.

	* src/manage.h: Adjust headers accordingly.
	(array_t, preference_t, nvt_selector_t): New types.

	* src/omp.c (array_add): Convert string arg type to gpointer.
	(free_array): Add NULL check.
	(array_reset, preference_new, nvt_selector_new)
	(create_config_data_reset, command_data_init): New functions.
	(import_config_data_t, create_config_data_t, command_data_t): New type.
	(command_data, create_config_data, import_config_data): New variables.
	(client_state_t): Add GET_CONFIGS import states.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Convert
	GET_CONFIGS "nvt_selectors" to "export", which responds with data suitable
	for import.  Add CREATE_CONFIG import handling.
	(omp_xml_handle_text): Add CREATE_CONFIG import handling.
	(init_omp): Initialise command_data.

2010-01-05  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/omp.c (print_report_latex): Fixed size issues in service/port per
	host overview table by shortening text that is displayed when page
	breaks within the table occur.

2010-01-04  Matthew Mundell <matthew.mundell@greenbone.net>

	Add an option to OMP command GET_CONFIGS for getting the NVT selectors of
	the configs.

	* src/tasks_sql.h (NVT_SELECTOR_TYPE_ALL, NVT_SELECTOR_TYPE_FAMILY)
	(NVT_SELECTOR_TYPE_NVT, NVT_SELECTOR_TYPE_ANY): Move to tasks_sql.h.
	(init_nvt_selector_iterator): Export.  Add config argument.
	(nvt_selector_iterator_include, nvt_selector_iterator_nvt)
	(nvt_selector_iterator_name): Export.
	(nvt_selector_iterator_type): New function.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (current_int_4): New variable.
	(omp_xml_handle_start_element): Store GET_CONFIGS nvt_selectors attribute.
	(omp_xml_handle_end_element): In CLIENT_GET_CONFIGS respond with NVT
	selectors according to nvt_selectors attribute.

2010-01-04  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	In PDF report, enabled page-breaks in service/port per host overview
	table. Initial commit, size issues still exists (e.g. table header
	bigger than table).

	* src/omp.c (print_report_latex): Use longtable environment instead of
	tabularx environment when printing the service per host overview
	table.

2010-01-04  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	In PDF report, enabled page-breaks in result overview table.

	* src/omp.c (print_report_latex): Use longtable environment instead of
	tabularx environment when printing the result overview table.

2010-01-04  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Fixed bug that could result in endless loops in pdf report generation.

	* src/omp.c (next_break): Corrected position of remembered last space
	character in input string.
	(latex_print_verbatim_text): Removed ampersand condition, as we are in
	verbatim environment.
	(print_report_latex): Removed done todo, minor style edit.

2009-12-31  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP command TEST_ESCALATOR.

	* src/manage.h (escalate): New header.
	(MANAGE_EXAMPLE_TASK_UUID): New definition.

	* src/tasks_sql.h (escalator_condition, escalator_method, escalate): New
	functions.
	(email): Add from_address arg.  Rename address to to_address.
	(escalate_1): New function, renamed from escalate.  Pass from address from
	method data to email.
	(event): Call escalate_1 instead of escalate.
	(init_manage): Use MANAGE_EXAMPLE_TASK_UUID to create example task.

	* src/omp.c (help_text): Add TEST_ESCALATOR.
	(client_state_t): Add TEST_ESCALATOR states.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Handle TEST_ESCALATOR.

	* src/tests/omp_help_0.c (help_text): Add TEST_ESCALATOR.

2009-12-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h: Replace SQL END with ROLLBACK.

2009-12-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_help_0.c (help_text): Match to current value.

	* src/tests/omp_get_configs_0.c, src/tests/omp_get_configs_1.c,
	src/tests/omp_get_configs_3.c, src/tests/omp_get_configs_2.c: Clear
	expected NVT growing state for "Full and fast".

	* src/tests/omp_get_status_5.c: Add config, escalator and target
	entities to expected response.

	* src/tests/omp_create_lsc_credential_1.c,
	src/tests/omp_delete_lsc_credential_0.c,
	src/tests/omp_create_lsc_credential_0.c,
	src/tests/omp_get_lsc_credentials_0.c: Add LOGIN to CREATE_LSC_CREDENTIAL.

	* src/tests/omp_start_task_4.c: Swap success and failure.

	* src/tests/omp_get_lsc_credentials_1.c,
	src/tests/omp_get_lsc_credentials_2.c: New files.

	* src/tests/CMakeLists.txt: Add omp_get_lsc_credentials_1 and
	omp_get_lsc_credentials_2.

2009-12-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (where_levels): Neaten doc formatting.

	* src/ompd.c (serve_omp): Just read and log a character on select
	exception, instead of failing.  Recalculate nfds after recreating
	the scanner session.

	* src/omp.c (omp_xml_handle_end_element): Correct entity name in error
	message.  In the task start mechanism prevent the child from forking
	instead of the parent.
	(process_omp_client_input): Flag start_task children specially.

	* src/manage.c (start_task): Clear current report in the child on failure
	and in the parent always.

2009-12-30  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Applied patch from Vladimir Nadvornik to build static libraries only,
	as shared libs are neither installed nor used.

	* src/CMakeLists.txt: Declared libraries as static.

2009-12-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_escalator_task_iterator)
	(init_target_task_iterator, init_config_task_iterator): Leave out hidden
	tasks.
	(init_manage): Use %u to insert task status.  Correct example task config.
	Init status of example report.

2009-12-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (make_report): Add status arg.  Use as initial status
	of report.
	(create_report): Add status arg.  Pass to make_report.

	* src/manage.c (start_task): Create report with requested status, as the
	fork additions have moved the report task association to the end of the
	function.

2009-12-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_escalator_iterator): Add name arg.  Update caller.
	(init_escalator_task_iterator, escalator_task_iterator_name)
	(escalator_task_iterator_uuid): New functions.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (omp_xml_handle_start_element): Get name attrib for
	GET_ESCALATORS.
	(omp_xml_handle_end_element): In CLIENT_GET_ESCALATORS return task list
	if name attribute is present.

2009-12-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (manage_set_config_preference)
	(manage_set_config_nvts, manage_set_config_families): Return 1 if the
	config is in use.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_MODIFY_CONFIG respond
	with error if config is in use.

2009-12-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ovas-mngr-comm.c (sendn_to_server, write_string_to_server)
	(write_to_server_buffer): Add actual data to tracing.

2009-12-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (lsc_credential_iterator_in_use): Correct column.
	(init_lsc_credential_target_iterator)
	(lsc_credential_target_iterator_name): New functions.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): Rename variable targets to
	credentials.  Send targets using the credential with each credential in
	list version.

2009-12-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (collate_ip_compare, collate_ip): New functions.
	(init_manage_process): Add SQL collation function collate_ip.
	(init_host_iterator): Order by hosts with IP collation.

2009-12-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (collate_threat): New function.
	(condition_met): Call collate_threat to compare threats.

2009-12-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_target_iterator): Add name arg.
	(init_target_task_iterator, target_task_iterator_name)
	(target_task_iterator_uuid): New functions.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (omp_xml_handle_start_element): Get name attrib for
	GET_TARGETS.
	(omp_xml_handle_end_element): In CLIENT_GET_TARGETS return task list
	if name attribute present.

2009-12-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): New variable.

	* doc/CMakeLists.txt: Add database version to db PNG and HTML.

	* src/CMakeLists.txt: Pass OPENVASMD_DATABASE_VERSION to compiler.

	* src/tasks_sql.h: Replace DATABASE_VERSION with
	OPENVASMD_DATABASE_VERSION.

2009-12-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db_postgres.sql (nvt_selectors): Add id field.
	(targets): Add id field.
	(tasks): Describe description.  Refer to config and target by id.

2009-12-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db_postgres.sql (agents, escalator_condition_data)
	(escalator_event_data, escalator_method_data, escalators)
	(task_files, task_escalators, nvt_preferences): New tables.
	(meta): Add field id.  Add type to name.
	(nvt_selectors): Add field family.
	(targets): Add fields comment and lsc_credential.
	(config): Add comment and cache fields.
	(tasks): Add fields hidden, description, run_status, start_time, end_time,
	Move field comment up.
	(reports): Add fields hidden and scan_run_status.
	(report_hosts): Add fields attack_state, current_port and max_port.
	(lsc_credentials): Add fields login, password, public_key and private_key.
	Rename dog to exe.

2009-12-25  Matthew Mundell <matthew.mundell@greenbone.net>

	Add new condition "Threat level at least".

	* src/manage.c (escalator_data): Declare.
	(escalator_condition_name, escalator_condition_from_name): Add new
	condition.
	(escalator_condition_description): New function.

	* src/manage.h (escalator_condition_t): Add new condition.
	(escalator_condition_description): New header.

	* src/tasks_sql.h (escalate): Use condition description instead of name
	in email body.
	(condition_met): Add escalator arg.  Add check for new condition.  Update
	caller.
	(task_last_report_id, task_second_last_report_id): Correct doc.
	(task_threat_level): New function.

2009-12-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (email): Add simple implementation.
	(escalate): Add newline to body.

2009-12-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (event_description): New function.

	* src/manage.h: Add header.

	* src/tasks_sql.h (escalate): Flesh out email.

2009-12-24  Matthew Mundell <matthew.mundell@greenbone.net>

	Add escalator support, including OMP commands CREATE_ESCALATOR,
	DELETE_ESCALATOR and GET_ESCALATORS, and CREATE_TASK element ESCALATOR.

	* src/manage.c (escalator_condition_name, event_name)
	(escalator_method_name, escalator_condition_from_name, event_from_name)
	(escalator_method_from_name): New function.

	* src/tasks_sql.h (create_tables): Add tables escalator_condition_data,
	escalator_event_data, escalator_method_data, escalators and
	task_escalators.
	(create_escalator, delete_escalator, find_escalator)
	(init_escalator_iterator, escalator_iterator_escalator)
	(escalator_iterator_name, escalator_iterator_comment)
	(escalator_iterator_event, escalator_iterator_condition)
	(escalator_iterator_method, escalator_iterator_in_use)
	(init_escalator_data_iterator, escalator_data_iterator_name)
	(escalator_data_iterator_data, escalator_data, email, escalate)
	(event_applies, condition_met, event): New functions.
	(set_task_run_status, task_escalator, add_task_escalator): Add event.
	(delete_task): Delete escalator.

	* src/manage.h: Add headers accordingly.
	(escalator_t, event_t, escalator_method_t, escalator_condition_t): New
	types.

	* src/omp.c (help_text): Add escalator commands.
	(client_state_t): Add escalator states.
	(omp_xml_handle_start_element, omp_xml_handle_start_element)
	(omp_xml_handle_text): Handle new commands for escalators.

2009-12-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (create_tables): Sort better.

2009-12-24  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch the global OMP array variables to GPtrArrays.

	* src/tasks_sql.h (member): Switch array to GPtrArray.
	(manage_set_config_nvts): Switch selected_nvts to GPtrArray.
	(manage_set_config_families): Switch families args to GPtrArray.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (make_array, array_add, array_terminate): New functions.
	(free_array): Switch arg to GPtrArray.
	(current_array_1, current_array_2, current_array_3): Switch type to
	GPtrArray.
	(omp_xml_handle_start_element): Create arrays with make_array.
	(omp_xml_handle_end_element): Terminate arrays before use.  Free
	arrays with free_array.  Append to arrays with array_add.

2009-12-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (help_text): Sort.  Correct article.

	* src/tasks_sql.h (set_task_run_status): Neaten doc.

	* src/manage.h [!TASKS_SQL] (lsc_credential_t): New type.

2009-12-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_help_0.c (help_text): Add agent commands.

2009-12-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/openvasmd.html, doc/openvasmd.8: New files.

	* doc/CMakeLists.txt: Remove groff comments.  Prevent "clean" from
	removing extra documentation.
	(man, man-html): New targets.

2009-12-21  Michael Wiegand <michael.wiegand@greenbone.net>

	Post-release version bump.

	* CMakeLists.txt: Updated version number.

2009-12-21  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 0.9.8 release.

	* CHANGES: Updated.

2009-12-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_AGENT require
	an installer.

2009-12-21  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* CMakeLists.txt: Don't ignore necessary files when creating the source
	tarball.

2009-12-17  Matthew Mundell <matthew.mundell@greenbone.net>

	Complete support for creating agent with associated files.

	* src/tasks_sql.h (create_agent): Add installer and howto args.  Expect
	the installer and howtos to be base64 encoded already.
	(init_agent_iterator): Remove comma from SQL.

	* src/manage.h: Update header.

	* src/omp.c (omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add installer and howto entities to CREATE_AGENT.

2009-12-18  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Add agent support.

	* src/tasks_sql.h (agent_t): New type.
	(create_tables): Added "agents" table.
	(create_agent, delete_agent, init_agent_iterator, agent_iterator_name)
	(agent_iterator_comment, agent_iterator_installer)
	(agent_iterator_howto_install, agent_iterator_howto_use, agent_name): New
	functions.

	* src/manage.h: Added protos accordingly.

	* src/omp.c (help_text, client_state_t): Extended with agent
	commands/states.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Added handling for agent commands.

2009-12-18  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Changed installation destination for openvasmd_report_html.xsl as
	proposed by Stephan Kleine.

	* src/CMakeLists.txt: Install openvasmd_report_html.xsl to datadir
	instead of sysconfdir.

	* src/omp.c (omp_xml_handle_end_element): Adjusted to changed location
	of openvasmd_report_html.xsl

2009-12-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_config_task_iterator, config_task_iterator_name)
	(config_task_iterator_uuid): New functions.

	* src/manage.h: Add headers.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_STATUS send
	config and target with task.  In CLIENT_GET_CONFIGS send list of tasks
	that use the config.

2009-12-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_STATUS send sort
	information back with task list.

2009-12-17  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Revived VERSION file, as its present in other modules, too.

	* VERSION.in: Template for the VERSION file.

	* CMakeLists.txt: Do not add the template files to package, configure
	the VERSION file.

2009-12-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otp.c (process_otp_scanner_input): In SCANNER_SERVER correct
	scanner state for "DEBUG".

2009-12-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Add message counts to GET_REPORT XML response.

	* src/tasks_sql.h (REPORT_COUNT): Take report arg instead of using
	report UUID variable.
	(report_counts_id): New function.
	(report_counts): Call through to report_counts_id.

	* src/manage.h: Add header.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_REPORT add message
	counts to XML format response.

2009-12-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Add filtered count to OMP GET_REPORT XML report.

	* src/tasks_sql.h (where_levels): New function.
	(init_result_iterator): Move levels WHERE calc to where_levels.
	(report_scan_result_count): Add a levels arg.

	* src/manage.h: Update header.

	* src/omp.c (omp_xml_handle_end_element): In the XML case of
	CLIENT_GET_REPORT add a filtered count to SCAN_RESULT_COUNT.

2009-12-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Add database migration from version 7 to 8.

	* src/tasks_sql.h (migrate_7_to_8): New function.
	(database_migrators): Add migrate_7_to_8.

2009-12-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Separate credential name and login name for LSC credentials.

	* src/tasks_sql.h (DATABASE_VERSION): Increase to 8, for changes to table
	lsc_credentials.
	(create_tables): Add login column to lsc_credentials.
	(create_lsc_credential): Add login param.
	(init_lsc_credential_iterator): Include login.
	(lsc_credential_iterator_login): New function.  Adjust positions of other
	accessors accordingly.

	* src/manage.h: Add headers.

	* src/manage.c (start_task): Send login to scanner instead of name.

	* src/omp.c (client_state_t): Add CLIENT_CREATE_LSC_CREDENTIAL_LOGIN.
	(omp_xml_handle_start_element, omp_xml_handle_start_element)
	(omp_xml_handle_text): Add login to LSC credential handling.

2009-12-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* CMakeLists.txt: Add fullstop to Description.

2009-12-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_NVT_DETAILS all
	case cleanup iterator afterwards.

2009-12-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h: Put nvt_selectors before nvts when joining these tables
	in SQL, as suggested by Michael Wiegand.
	(create_tables): Add indexes on nvt_selectors and nvts.  ANALYZE after
	creating table.

2009-12-15  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Made the openvasmd and doxygen- generated documentation aware of the
	svn revision in the same way as the package does already.
	That means, in analogy to the source_package target, only if configured
	with -DPREPARE_RELEASE=1 no revision number will occur in the version
	string.
	Note that this works at configure time, thus you have to execute
	`cmake [OPTIONS] .` to update revision/version numbers in the
	documentation and as answer to `openvasmd --version`.

	* VERSION: Removed, mechanism replaced by cmake-based one.

	* CMakeLists.txt: Do not read in content of VERSION, use
	CPACK_PACKAGE_VERSION instead. Configure the two Doxyfiles.
	Added TODO about missing checks (pkg-config, sqlite3).

	* doc/Doxyfile, doc/Doxyfile_full: Removed. Are generated in configure
	step.

	* doc/Doxyfile.in, doc/Doxyfile_full.in: New. Used to generate
	doc/Doxyfile and doc/Doxyfile_full during configure step with
	automatically updated project version number.

2009-12-01  Michael Wiegand <michael.wiegand@greenbone.net>

	Post-release version bump.

	* VERSION: Set to 0.9.8.SVN.

	* CMakeLists.txt: CPACK_PACKAGE_VERSION_PATCH updated.

	* doc/Doxyfile, doc/Doxyfile_full: Updated PROJECT_NUMBER.

2009-12-01  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 0.9.7 release.

	* VERSION: Set to 0.9.7.

	* doc/Doxyfile, doc/Doxyfile_full: Updated PROJECT_NUMBER.

	* CHANGES: Updated.

2009-12-07  Tim Brown <timb@openvas.org>

	* src/omp.c: Fixed up some free()s.

2009-12-02  Michael Wiegand <michael.wiegand@greenbone.net>

	Fixed a bug which caused NVT selections in non-growing families to be
	wrongly calculated.

	* src/tasks_sql.h (manage_set_config_nvts): Defer determining the old
	NVT count until we know whether the family is growing or not, hand the
	correct growing flag to nvt_selector_nvt_count ().

2009-12-01  Michael Wiegand <michael.wiegand@greenbone.net>

	Post-release version bump.

	* VERSION: Set to 0.9.7.SVN.

	* CMakeLists.txt: CPACK_PACKAGE_VERSION_PATCH updated.

	* doc/Doxyfile, doc/Doxyfile_full: Updated PROJECT_NUMBER.

2009-12-01  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 0.9.6 release.

	* VERSION: Set to 0.9.6.

	* doc/Doxyfile, doc/Doxyfile_full: Updated PROJECT_NUMBER.

	* CHANGES: Updated.

2009-12-01  Michael Wiegand <michael.wiegand@greenbone.net>

	Set up an empty scan config as template for new configs.

	* src/tasks_sql.h (init_manage): Make sure the scan config 'empty'
	exists, create it if it does not.
	(delete_config): Refuse to delete 'empty'.
	(config_in_use): Set 'empty' as in use.

2009-11-30  Michael Wiegand <michael.wiegand@greenbone.net>

	Post-release version bump.

	* VERSION: Set to 0.9.6.SVN.

	* CMakeLists.txt: CPACK_PACKAGE_VERSION_PATCH updated.

	* doc/Doxyfile, doc/Doxyfile_full: Updated PROJECT_NUMBER.

2009-11-30  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 0.9.5 release.

	* VERSION: Set to 0.9.5.

	* CMakeLists.txt: CPACK_PACKAGE_VERSION_PATCH updated.

	* doc/Doxyfile, doc/Doxyfile_full: Updated PROJECT_NUMBER.

	* CHANGES: Updated.

2009-11-28  Matthew Mundell <matthew.mundell@greenbone.net>

	As a quick way around the very long OMP START_TASK response time, fork
	the manager when starting a task, respond in the parent, and let the
	child slowly start the task.

	* src/manage.c (start_task): Set the task status early, so that other
	processes know that the task is being started.  Check and set the task
	status in an atomic block.  Fork a child to do the bulk of the work, so
	that the current process can return to respond to the client.

	* src/omp.c (current_error, forked): New variables.
	(omp_xml_handle_end_element): Use forked to prevent the client-serving
	process from forking more than once.  Use globals to return fork status
	to process_omp_client_input.
	(init_omp_process): Init forked.
	(process_omp_client_input): Use globals to return fork status to caller.

	* src/ompd.c (recreate_session): If server_socket is zero skip freeing
	the session.
	(serve_omp): When process_omp_client_input has forked create a new scanner
	session in the parent so the child can use the old one, and end the client
	interaction in the child.  Prevent closing and freeing the respective old
	sessions as this would affect the other branch of the fork because the
	actual session is forked.

2009-11-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (latex_print_verbatim_text): Print equal signs is separate
	verb environments that use dash to begin and end the environment.

2009-11-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_help_0.c (help_text): Add new commands.

2009-11-27  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* CMakeLists.txt: Switched method of svn revision extraction to
	"offline" check.

2009-11-27  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* CMakeLists.txt: Made wording more consistent.

2009-11-27  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/tasks_sql.h: Minor doc improvement.

2009-11-27  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* CMakeLists.txt: At configure time, add svn revision to version
	number if PREPARE_RELEASE flag is not set.

2009-11-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Try to stabilise the verbatim LaTeX printing.

	* src/omp.c (next_break): Remove extra nchars-- from "\r" case.  Return
	one more than the newline when a newline ends the line so that the caller
	finds the newline before wrapping.  Try improve the doc comment.  Document
	the code.  Init last_space to -1, as 0 is a valid value for last_space.
	Move the line_width check into the while loop so that it need only be done
	once.  Do the counter increments inside each case instead of decrementing
	just to be incremented.  Make the prefix operators postfix to match the
	rest of the module and general convention.  Use an else for the '\\' case
	instead of breaking in the other branches, to make the behaviour more
	explicit for the reader.
	(latex_print_verbatim_text): Increment pos before calling next_break on
	finding a newline, otherwise next_break will just find the same newline.
	Improve the doc comment.  Document the code.  Do the counter increments
	inside each case instead of decrementing just to be incremented.  Make
	the prefix operators postfix to match the rest of the module and general
	convention.  Use an else for the '\\' case instead of breaking in the
	other branches, to make the behaviour more explicit for the reader.

2009-11-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* CMakeLists.txt: Make formatting more consistent.  Add missing .SVN to
	version.  Streamline TODO.  Match the dependency checks to the other
	check in the module.  Turn build verbosity back on.

2009-11-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ompd.c: Include string.h, which was previously included via
	ossp/uuid.h via manage.h via otp.h.

2009-11-26  Matthew Mundell <matthew.mundell@greenbone.net>

	When updating the cache, remove preferences before inserting them.

	* src/tasks_sql.h (nvt_selector_family_count): Correct return doc.
	(manage_nvt_preference_add): Add option to remove preference before
	inserting it.

	* src/otp.c (parse_scanner_preference_value): Send remove flag to
	manage_nvt_preference_add according to cache mode.

	* src/manage.h: Update header.

2009-11-26  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* CMakeLists.txt: Corrected version string change that was left over
	from debugging.

2009-11-26  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Fixing certain wrong installation locations that could be set through
	cmake. This partly fixes bug #1206 (http://bugs.openvas.org/1206).

	* CMakeLists.txt: Respect SYSCONF_INSTALL_DIR if set.

2009-11-26  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/manage.c (make_report_uuid): Minor reformatting, and replace
	incorrect call to isnull with call to uuid_is_null.

2009-11-26  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Changed checks for used libraries, with help of Matthew Mundell.

	* CMakeLists.txt: Removed explicit PATH specification in find_library
	calls, removed respective todo. Replaced check for libopenvas by check
	for libopenvas_base.

2009-11-26  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Changed used library for UUID generation from ossp-uuid to libuuid from
	e2fsprogs.

	* src/manage.h: Removed include.
	src/manage.c, src/splint.h: Changed include.
	src/manage.c (make_report_uuid): Use functionality from libuuid rather
	than from ossp-uuid.
	src/CMakeLists.txt, src/test/CMakeLists.txt: Changed library to link
	against.

2009-11-25  Matthew Mundell <matthew.mundell@greenbone.net>

	Make --update update the cache a single item at a time, locking the
	database only around the modification of each item.  Add a new option,
	--rebuild, which completely rebuilds the cache from scratch, locking
	the database for the entire duration of the rebuild.

	* src/openvasmd.c (main): Add --rebuild option.

	* src/ompd.c (init_ompd): Update param doc.
	(write_to_scanner): Add update states by refering to ompd_nvt_cache_mode.
	(serve_omp): Set ompd_nvt_cache_mode directly from client_socket, which
	determines which update mode to use.  Add update states to select setup.

	* src/omp.c (init_omp_process): Update param doc.

	* src/tasks_sql.h (init_manage_process): Update param doc.  Only remove
	NVT and preference caches when rebuilding the cache.  Move COMMIT to
	manage_complete_nvt_cache_update.
	(make_nvt_from_nvti): Add argument to control removal of NVT before
	inserting.
	(manage_complete_nvt_cache_update): Add mode argument; COMMIT if rebuild.

	* src/manage.h: Update headers.

	* src/otp.h (scanner_init_state_t): Add new states.

	* src/otp.c (parse_scanner_preference_value): Add update state.
	(parse_scanner_plugin_list_tags): Pass NVT removal flag.
	(process_otp_scanner_input): Add update states.  In particular, pass mode
	to manage_complete_nvt_cache_update.

	* README: Update usage message.

2009-11-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (start_task): Only do the credential iteration if the
	target has a credential.

2009-11-25  Matthew Mundell <matthew.mundell@greenbone.net>

	Add support for per-NVT timeout preferences.

	* src/omp.c (send_nvt): Add timeout arg.  Update callers.
	(omp_xml_handle_end_element): In CLIENT_GET_NVT_DETAILS and
	CLIENT_GET_NVT_DETAILS send TIMEOUT in PREFERENCES and NVT. In
	CLIENT_MODIFY_CONFIG_PREFERENCE_VALUE initialise the string that will
	hold the value, so that it is always some string when the OMP caller
	sends a VALUE and only NULL if the caller leaves out VALUE entirely.

	* src/tasks_sql.h (config_nvt_timeout): New function.
	(manage_set_config_preference): Enable the preference removal section.
	Remove type decoration in removal section for scanner preferences.

2009-11-25  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Added stubs for dependency checks during configure/build time.
	Fixes bug #1208 (http://bugs.openvas.org/1208) for certain
	environments.

	* CMakeLists.txt: Added stubs for (dependency) checks for glib2,
	gnutls, openvas-libraries, pcap, gpgme and uuid.

2009-11-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (manage_set_config_preference): Strip type decorations
	off names of scanner preferences.  If nvt is NULL assume the preference
	is a SERVER_PREF.
	(nvt_preference_iterator_config_value): Select any type of preference, so
	that server preferences are selected too.

2009-11-23  Michael Wiegand <michael.wiegand@greenbone.net>

	Post-release version bump.

	* VERSION: Set to 0.9.5.SVN.

	* CMakeLists.txt: CPACK_PACKAGE_VERSION_PATCH updated.

	* doc/Doxyfile, doc/Doxyfile_full: Updated PROJECT_NUMBER.

2009-11-23  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 0.9.4 release.

	* VERSION: Set to 0.9.4.

	* CMakeLists.txt: CPACK_PACKAGE_VERSION_PATCH updated.

	* doc/Doxyfile, doc/Doxyfile_full: Updated PROJECT_NUMBER.

	* CHANGES: Updated.

2009-11-23  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/omp.c (latex_header): Added fix to allow special characters like
	umlauts in latex/pdf reports.

2009-11-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (nvt_selector_plugins): Implement outstanding cases by
	iterating over NVT's per family.  Hence take config instead of selector.
	(start_task): Pass config to nvt_selector_plugins.

2009-11-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (copy_config): Correct format type in SQL string.

2009-11-20  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/manage.c (latex_print_verbatim_text): Escape ampersands, as we
	are in a tabular environment.

2009-11-20  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/manage.c (start_task): Corrected preference string to send for
	(SMB) local security checks .

2009-11-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (manage_set_config_nvts): Determine whether to include
	or exclude by checking if the family is growing in the selector, instead
	of checking for an "all" or "family include" in the selector.

2009-11-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_REPORT for the
	"html" and "html-pdf" formats, convert in a directory and remove the
	directory after sending the report.

2009-11-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (check_is_dir, file_utils_rmdir_rf): New functions.
	(omp_xml_handle_end_element): In CLIENT_GET_REPORT process the LaTeX in
	a directory and remove the directory after sending the report.

2009-11-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (create_tables_version_4): New function.
	(migrate_4_to_5): Call create_tables_version_4 to create the tables.

2009-11-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (migrate_6_to_7): Add fullstop to comment.

	* src/manage.c (start_task): Remove space from beginning of preference
	name.

2009-11-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (collate_message_type): Heed lengths in comparisons.
	Reverse order: Medium is less than High, etc.

	* src/omp.c (compare_ports_desc, compare_ports_asc): Switch arg order.

2009-11-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (target_lsc_credential_name): Add missing sql_string
	arg.
	(init_lsc_credential_iterator): Doc missing arg.

	* ChangeLog: Format migrator entry like others.

2009-11-19  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/manage.c (start_task): Corrected preference strings for
	"credential" preferences to send.

2009-11-19  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Add database migration from version 6 to 7.

	* src/tasks_sql.h (migrate_6_to_7): Added migrator that adds the new
	column in targets table.
	(database_migrators): Added migrator.
	Declared a section of the documentation as section for doxygen.

2009-11-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_LSC_CREDENTIALS
	add TYPE to LSC_CREDENTIALS.

2009-11-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (create_target, target_lsc_credential_name): Use
	lsc_credential_t for credential.
	(delete_lsc_credential): Enable in use check.

2009-11-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Add IN_USE to OMP GET_LSC_CREDENTIALS response.  Move GET_TARGETS
	credential name into NAME entity.

	* src/tasks_sql.h (init_lsc_credential_iterator): Add "in use" field.
	(lsc_credential_iterator_in_use): New function.

	* src/manage.h: Add header.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_LSC_CREDENTIALS
	send IN_USE with credential.  In CLIENT_GET_TARGETS move credential name
	into NAME entity.

2009-11-19  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/manage.c (send_config_preferences): Renamed parameter and local
	variable to avoid confusion.
	(start_task): Made trace message more explicit.

2009-11-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Add support for creating password-only credentials and for associating
	credentials with targets.

	* src/tasks_sql.h (DATABASE_VERSION): Increase to 7, for changes to table
	targets.
	(init_manage): Add column lsc_credential to table targets.
	(create_target): Take credential parameter.
	(init_target_iterator): Add lsc_credential column.
	(target_iterator_lsc_credential, target_lsc_credential_name)
	(lsc_credential_name): New functions.
	(create_lsc_credential): Add given_password argument.

	* src/manage.h: Update and add headers.
	(lsc_credential_t): New type.

	* src/omp.c (client_state_t): Add new LSC states.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add PASSWORD to CREATE_LSC_CREDENTIAL.  Add
	LSC_CREDENTIAL to CREATE_TARGET.  Add LSC_CREDENTIAL to GET_TARGETS
	response.

	* src/manage.c (start_task): Send credential preferences if there's a
	credential linked to the target.

2009-11-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_manage): Set requested and running reports to
	stopped.

2009-11-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_nvt_preference_iterator): Order by name ascending.

2009-11-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_NVT_DETAILS and
	CLIENT_GET_CONFIGS send empty PREFERENCE VALUEs when type is password.

2009-11-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h: Format migration procedure like other comments.  Add a
	description of NVT selectors.

2009-11-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (clude): Skip NVT if NVT or NVT family is missing from
	cache.
	(nvt_selector_nvt_count): Remove handling of NULL family in the family
	case.

2009-11-17  Matthew Mundell <matthew.mundell@greenbone.net>

	Improve migrators.

	* src/tasks_sql.h: Add comment with procedure for writing a migrator.
	(migrate_0_to_1, migrate_1_to_2, migrate_3_to_4): Check version inside
	transaction.
	(migrate_2_to_3): Check version inside transaction.  Ensure table
	lsc_credentials exists.  Add missing public_key and private_key columns.
	Make exe column text.
	(migrate_4_to_5): Check version inside transaction.  Ensure tables
	nvt_preferences and task_files exist.
	(migrate_5_to_6_move_other_config): New function.
	(migrate_5_to_6): Check version inside transaction.  Succeed even if the
	predefined configs are missing.  Move any configs having the predefined
	ID's.

2009-11-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Add database migration from version 5 to 6.  Remove predefined config
	"Empty and fast".

	* src/tasks_sql.h (migrate_5_to_6): New function.
	(database_migrators): Add migrate_5_to_6.
	(init_manage): Remove config "Empty and fast".
	(update_config_caches): New function, body from
	manage_complete_nvt_cache_update.
	(manage_complete_nvt_cache_update): Call update_config_caches.

2009-11-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (insert_rc_into_config): Also cache the config counts in
	the growing case.

2009-11-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (switch_representation): Free selector after last use.
	Free quoted_selector.

2009-11-15  Matthew Mundell <matthew.mundell@greenbone.net>

	Implement toggling of whether new families are added.

	* src/tasks_sql.h (copy_config): Free selector.
	(switch_representation): Implement.
	(nvt_selector_family_growing): Neaten formatting.
	(nvt_selector_remove_selector): Add NVT_SELECTOR_TYPE_ALL case.
	(nvt_selector_add): Correct comment.
	(manage_set_config_families): Move BEGIN before representation switch.
	Proceed with modification after switching.  Also set new_nvt_count for
	the generating growing_all case.

2009-11-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (set_db_version): Remove out of date assertion.
	(migrate_0_to_1, migrate_1_to_2, migrate_2_to_3, migrate_3_to_4): Enclose
	update in transaction.
	(migrate_5_to_6): Move version number update into transaction.

2009-11-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Update cached config counts after caching the NVT's.

	* src/tasks_sql.h (manage_complete_nvt_cache_update): New function.
	(nvt_selector_family_count): Recalculate the count intead of returning
	the cached value.
	(config_family_count, config_nvt_count): New functions.  Return cached
	values.
	(nvt_selector_family_selected_count): Rename to nvt_selector_count.
	Update callers.
	(nvt_selector_nvt_count): Rename to config_nvt_count.  Now new function
	renamed from nvt_selector_count.  If family is NULL return count for all
	families.
	(nvt_selector_families_growing, nvt_selector_nvts_growing): Make static.
	(nvt_selector_nvts_growing_2): Ensure return is at most 1.
	(init_family_iterator): Note when param is used in doc.
	(select_config_nvts): Improve return doc.
	(manage_set_config_families): Cleanup family iterator before exit.

	* src/manage.h: Update headers.

	* src/omp.c (omp_xml_handle_end_element): Call config_family_count,
	config_nvt_count and nvt_selector_nvt_count instead of
	nvt_selector_family_count, nvt_selector_nvt_count and
	nvt_selector_family_selected_count.

	* src/otp.c (process_otp_scanner_input): In SCANNER_PREFERENCE_NAME cache
	mode exit, call manage_complete_nvt_cache_update.

2009-11-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP commands GET_NVT_FAMILIES and MODIFY_CONFIG.  Correct and
	complete most of the NVT selector implementation.  Add a COPY_CONFIG
	alternative to OMP's CREATE_CONFIG.  Extend and improve OMP's
	CLIENT_GET_NVT_DETAILS and GET_CONFIGS.

	* src/tasks_sql.h (DATABASE_VERSION): Increase to 6, for predefined
	config ID's and addition of count caching to growing configs.
	(NVT_SELECTOR_TYPE_ANY): New define.
	(member, copy_config, manage_set_config_preference)
	(manage_set_config_nvts, switch_representation, family_count)
	(nvt_selector_nvts_growing_2, nvt_selector_remove)
	(nvt_selector_remove_selector, nvt_selector_add, family_is_selected)
	(nvt_selector_has, manage_set_config_families): New functions.
	(init_manage): Set predefined config ID's to fixed values.  Add new
	config "Empty and fast".
	(init_nvt_iterator): Add iteration of an entire family.  Add missing
	ORDER BY.
	(nvt_cache_present): Remove.  Cache is always present.  Remove from
	callers.
	(family_nvt_count): Add counting of all NVT's in all families.
	(nvt_selector_nvts_growing): Call nvt_selector_nvts_growing_2.
	(nvt_selector_family_count, nvt_selector_nvt_count): Simply read cached
	value.
	(init_family_iterator): Add iteration of all families.  Correct behaviour.
	(nvt_selector_family_growing): Correct "all" case.
	(nvt_selector_family_selected_count): Account for excluded NVT's in
	growing case.
	(select_config_nvts): Add missing cases and correct existing ones.
	(nvt_preference_iterator_real_name): Add example.  Include any trailing
	colon in the name for consistency.

	* src/manage.h: Add headers for new functions.

	* src/omp.c (free_array): New function.
	(help_text): Add GET_NVT_FAMILIES and MODIFY_CONFIG.
	(current_array_1, current_array_2, current_array_3): New variables.
	(client_state_t): Add states for new commands.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add GET_NVT_FAMILIES and MODIFY_CONFIG handling.
	Add a COPY_CONFIG alternative to CREATE_CONFIG.  Add NVT name and ID and
	radio alternatives to CLIENT_GET_NVT_DETAILS when given an NVT.  In the
	CLIENT_GET_NVT_DETAILS all case, also count preferences when just a family
	is given.  In GET_CONFIGS pass family growth to init_family_iterator and
	nvt_selector_family_growing instead of nvt growth, always call into
	the library to get the family selected count, and send alternative values
	for radios in separate entities.

	* src/manage.c (nvt_selector_plugins): Add temporary notes.

2009-11-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c: Make brief comments single lines.  Move todos out of doc
	comments so the doc is easier to read.  Match some formatting to the rest
	of the module.
	(latex_print_text, latex_escape_text): Remove.  Can be added back if
	needed.

2009-11-13  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/omp.c (send_to_client): Fixed currently not evaluated code,
	declared parameter const.
	(latex_header): Enabled color for log messages in latex/pdf report.

2009-11-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (manage_db_version): Check version instead of number.

2009-11-10  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Improved pdf reports. Text of issues like "security warning" is printed
	verbatim. To allow for page breaks in issue tables, put one verbatim
	line into one row of the table. Break lines at 80 characters and do
	word wrapping. Indicate "artificial" line breaks with a special symbol.
	Indicate that tables were broken over pages.

	* src/omp.c (print_report_latex): Use more features of the longtable
	environment in latex/pdf report.
	(next_break): New. Used for the line and word wrapping in
	latex_print_verbatim_text.
	(latex_print_verbatim_text): New. Prints verbatim text, doing line and
	word wrapping.

2009-11-09  Michael Wiegand <michael.wiegand@greenbone.net>

	Post-release version bump.

	* VERSION: Set to 0.9.4.SVN.

	* CMakeLists.txt: CPACK_PACKAGE_VERSION_PATCH updated.

	* doc/Doxyfile, doc/Doxyfile_full: Updated PROJECT_NUMBER.

2009-11-09  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 0.9.3 release.

	* VERSION: Set to 0.9.3.

	* CMakeLists.txt: CPACK_PACKAGE_VERSION_PATCH updated.

	* doc/Doxyfile, doc/Doxyfile_full: Updated PROJECT_NUMBER.

	* CHANGES: Updated.

2009-11-06  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Improved pdf report generation: Use longtable environment for issues
	(like security hole, security warning etc.) to allow for tables across
	multiple pages. For tables to break across pages, text in the tables
	has to be put in multiple rows.
	Some issues persist, added respective todos.

	* src/omp.c (latex_print_text): Replace "\n" by linebreak/
	row-termination "\\" instead of two newlines
	(print_report_latex): Use longtable instead of tabularx environment,
	added todos.

2009-11-06  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/omp.c (latex_print_text): New, extracted from latex_escape_text.
	Writes to file directly (bufferless) in contrast to memory.
	(latex_escape_text): Added todo, function might be obsolete.
	(print_report_latex): Use (new) latex_print_text.

2009-11-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_result_iterator): Include all levels if levels is
	NULL.  Add level 'd' for type "Debug Message".  Simplify the SQL if all
	levels are requested.

	* src/omp.c (omp_xml_handle_end_element): Ensure globals used for
	sort_field and levels attributes are cleared after commands.  In
	CLIENT_GET_REPORT correct attribute name in error response, set levels
	to all levels if the attribute is NULL, add a 'd' entry in FILTERS and
	add a NULL check on current_name.

2009-11-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (latex_severity_colour): Replace openvas_text with
	openvas_report.
	(latex_header): Remove openvas_text.  Match threat colours to GSA.
	(latex_footer): Correct typo.

2009-11-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_result_iterator): Add sorting and filtering args.

	* src/manage.h: Update headers.
	(collate_message_type): New header.

	* src/omp.c (compare_ports_desc, compare_ports_asc): New functions.
	(omp_xml_handle_start_element): Add sorting and filtering attributes to
	GET_REPORTS.
	(print_report_xml, print_report_latex): Add sorting args.  Pass through
	sorting and filtering attributes to init_result_iterator.  Remove LaTeX
	report hack which was filtering less important messages.
	(omp_xml_handle_end_element): For the XML report, include the filtering
	and sorting info in the response, add a port summary section.  Pass
	sorting and filtering attributes to init_result_iterator.
	(omp_xml_handle_end_element): In CLIENT_GET_CONFIGS send OID
	with NVT in PREFERENCE.

2009-11-04  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Made the nbe output of manager and openvas-client more similar.

	* src/omp.c (omp_xml_handle_end_element): Do not put pipe symbol at
	the end of "result" lines.

2009-11-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (nvt_oid): New function.

	* src/manage.h: Add header.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_CONFIGS send OID
	with NVT in PREFERENCE.

2009-11-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_nvt_preference_iterator): Filter out
	client-specific and server_info preferences.

2009-11-03  Matthew Mundell <matthew.mundell@greenbone.net>

	Send preference counts with OMP GET_NVT_DETAILS and preferences with
	OMP GET_CONFIGS.

	* src/tasks_sql.h (nvt_preference_iterator_real_name): Return name anyway
	if sscanf fails to match.
	(nvt_preference_iterator_nvt, nvt_preference_count): New functions.

	* src/manage.h: Update headers.

	* src/omp.c (current_int_3): New variable.
	(omp_xml_handle_start_element): Add "preferences" attribute to
	GET_CONFIGS.
	(send_nvt): Send preference count from new arg pref_count.
	(omp_xml_handle_end_element): In CLIENT_GET_NVT_DETAILS check type exists
	before strcmp and send preference count with each NVT.  In
	CLIENT_GET_CONFIGS send preferences according to "preferences" attribute.

2009-11-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Send NVT preferences with OMP GET_NVT_DETAILS.

	* src/tasks_sql.h (init_config_pref_iterator, config_pref_iterator_name)
	(config_pref_iterator_value, nvt_preference_iterator_real_name)
	(nvt_preference_iterator_type, nvt_preference_iterator_config_value): New
	functions.
	(init_nvt_preference_iterator): Add name arg for getting prefs for given

	* src/manage.h: Update headers.

	* src/omp.c (omp_xml_handle_end_element): Update CLIENT_GET_PREFERENCES
	init_nvt_preference_iterator call.  In CLIENT_GET_NVT_DETAILS send each
	NVT's prefs with the NVT when the config attribute is present.

2009-11-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Add sorting parameters to most OMP data retrieval commands, for very basic
	sorting.

	* src/tasks_sql.h (init_iterator): Make sql a printf style format string.
	(select_config_nvts, init_task_iterator, init_target_iterator)
	(init_config_iterator, init_nvt_iterator, init_family_iterator)
	(select_config_nvts, init_lsc_credential_iterator): Add args that control
	sorting.  Update all callers.

	* src/manage.h: Update headers.

	* src/manage.c: Update calls to init_task_iterator and init_nvt_iterator.

	* src/omp.c: Update iterator calls with sorting args.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add sort_field
	and sort_order attributes to GET_CONFIGS, GET_LSC_CREDENTIALS,
	GET_NVT_DETAILS, GET_TARGETS and GET_STATUS.

2009-10-31  Matthew Mundell <matthew.mundell@greenbone.net>

	Add config and family attributes to OMP GET_NVT_DETAILS, for getting
	NVT's in one family for a config.

	* src/tasks_sql.h (select_config_nvts): New function.
	(init_nvt_iterator): Add args for requesting from a family in a config
	only.  Update all callers.

	* src/manage.h: Update header.

	* src/manage.c: Update call to init_nvt_iterator.

	* src/omp.c (omp_xml_handle_start_element, omp_xml_handle_end_element):
	Add config and family attributes to GET_NVT_DETAILS, to limit the list of
	NVT's.

2009-10-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h: Correct revision number in comment.

2009-10-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h: Update migrator comments about appending columns.

2009-10-31  Matthew Mundell <matthew.mundell@greenbone.net>

	Name columns explicitly in SELECT statements instead of using wildcards.
	This makes it safe for a migrator to add a missing column to the end of
	the table when create_table would have created the column somewhere
	before the end.

	* src/tasks_sql.h (init_result_iterator, init_host_iterator)
	(init_task_file_iterator, init_target_iterator, init_config_iterator)
	(init_preference_iterator, init_nvt_iterator, init_nvt_selector_iterator)
	(init_nvt_preference_iterator, init_lsc_credential_iterator): Name columns
	explicitly in SELECTs.
	(config_nvt_selector): Break long string.
	(COL_CONFIG_PREFERENCES__NAME, COL_CONFIG_PREFERENCES__VALUE)
	(COL_CONFIGS__NAME, COL_CONFIGS__NVT_SELECTOR, COL_CONFIGS__COMMENT)
	(COL_CONFIGS__FAMILIES_GROWING, COL_CONFIGS__NVTS_GROWING)
	(COL_LSC_CREDENTIALS__NAME, COL_LSC_CREDENTIALS__PASSWORD)
	(COL_LSC_CREDENTIALS__COMMENT, COL_LSC_CREDENTIALS__PUBLIC_KEY)
	(COL_LSC_CREDENTIALS__PRIVATE_KEY, COL_LSC_CREDENTIALS__RPM)
	(COL_LSC_CREDENTIALS__DEB, COL_LSC_CREDENTIALS__EXE)
	(COL_NVT_PREFERENCES__NAME, COL_NVT_PREFERENCES__VALUE)
	(COL_NVT_SELECTORS__NAME, COL_NVT_SELECTORS__NVT, COL_NVTS__OID)
	(COL_NVTS__VERSION, COL_NVTS__NAME, COL_NVTS__SUMMARY)
	(COL_NVTS__DESCRIPTION, COL_NVTS__COPYRIGHT, COL_NVTS__CVE, COL_NVTS__BID)
	(COL_NVTS__XREF, COL_NVTS__TAG, COL_NVTS__SIGN_KEY_IDS)
	(COL_NVTS__CATEGORY, COL_NVTS__FAMILY, COL_REPORT_HOSTS__HOST)
	(COL_REPORT_HOSTS__START_TIME, COL_REPORT_HOSTS__END_TIME)
	(COL_REPORT_HOSTS__ATTACK_STATE, COL_REPORT_HOSTS__CURRENT_PORT)
	(COL_REPORT_HOSTS__MAX_PORT, COL_TARGETS__NAME, COL_TARGETS__HOSTS)
	(COL_TARGETS__COMMENT, COL_TASK_FILES__NAME, COL_TASK_FILES__CONTENT):
	Remove.  Revert to integers in all iterator access functions.

2009-10-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_report_iterator, init_result_iterator)
	(init_host_iterator, init_task_file_iterator, init_target_iterator)
	(init_config_iterator, init_preference_iterator, init_nvt_iterator)
	(init_nvt_selector_iterator, init_family_iterator)
	(init_nvt_preference_iterator, init_lsc_credential_iterator): Use
	init_iterator.
	(init_table_iterator): Remove.

2009-10-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/lsc_user.c (file_utils_copy_file): Correct check of
	g_file_get_contents return.
	(lsc_user_rpm_create): Rename oltap_path to generator_path.

2009-10-31  Matthew Mundell <matthew.mundell@greenbone.net>

	Add database migration from version 4 to 5.

	* src/tasks_sql.h: Move database column definitions up in file.
	(create_tables): New function, body from init_manage.
	(sql_insert, init_iterator, iterator_int64, iterator_string)
	(migrate_4_to_5_copy_data): New functions.
	(cleanup_iterator, next): Move up in file.
	(migrate_0_to_1, migrate_1_to_2, migrate_2_to_3, migrate_3_to_4): Make
	static.  Improve comments.
	(migrate_4_to_5): Enable.  Make static.  Complete.
	(database_migrators): Enable 4 to 5 migrator.
	(init_manage): Move table creation to create_tables.

2009-10-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/splint.h (g_strfreev, g_key_file_free, g_string_free)
	(g_option_context_free): New headers, as in Administrator.

	* src/openvasmd.c: Include splint.h.

2009-10-29  Matthew Mundell <matthew.mundell@greenbone.net>

	Cleanup after static analysis.

	* src/ovas-mngr-comm.c (sendf_to_server): Declare variables at start of
	block.

	* src/tasks_sql.h: Include splint.h.  Move variable declarations to block
	starts.  Mark /*@unused@*/ params.  Work around cpp string concatenation
	for splint.
	(init_manage): Free database_version.
	(make_task_rcfile): Remove name variable.
	(clude): Free formatted in same place as other prepare loops.
	(create_lsc_credential): Free rand and formatted.

	* src/splint.h: Include gnutls.h and uuid.h.
	(g_malloc, g_malloc0): Update types.
	(g_dir_read_name, g_dir_close, g_rand_new, g_rand_free): New headers.

	* src/oxpd.h (from_buffer_size): Add extern.

	* src/lsc_user.c: Include splint.h.  Move variable declarations to block
	starts.
	(file_utils_rmdir_rf): Check error before using it.  Free g_build_filename
	return.
	(file_utils_copy_file): Change bytes_written to a size_t.  Check error
	before using it.
	(ssh_privkey_create, ssh_pubkey_create): Free command.
	(get_rpm_generator_path): Make return const.
	(lsc_user_rpm_create): Make oltap_path const.

	* src/lsc_user.h (lsc_user_all_create): Remove param names.

	* src/manage.c: Move variable declarations to block starts.
	(delete_reports): Cleanup iterator afterwards.
	(start_task): Free hosts.

	* src/manage.h [!TASKS_SQL]: Add dummy declarations for splint.
	(host_iterator_end_time): Remove duplicate declaration.

	* src/omp.c: Move variable declarations to block starts.  Mark
	/*@unused@*/ params.
	(send_nvt): Work around macro for splint.
	(print_report_xml): Use fputs instead of fprintf for fixed string.
	(print_report_latex): Add RATS comments about fprintf args.
	(omp_xml_handle_end_element): Add RATS comments about system args.
	Remove duplicate free of description.

	* src/openvasmd.c: Move variable declarations to block starts.  Mark
	/*@unused@*/ params.
	(accept_and_maybe_fork): Add RATS comment about signal arg.
	(main): Use char syntax for char literal 0.  Free option_context.

2009-10-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otp.c (process_otp_scanner_input): Add RATS comments about sscanf
	field lengths.  Put a fullstop on a comment.

2009-10-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (config_preference): Add the config to the query.
	(init_preference_iterator): Use "is NULL" instead of "= NULL" in query.
	(nvt_selector_family_count): Add the growing case where there is an "all"
	selector with only "include" selectors.
	(nvt_selector_nvt_count): Add naive handling of the growing case where
	there is an "all" selector with other selectors.
	(nvt_selector_family_selected_count): Handle NULL family for static
	selection.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_CONFIGS handle the
	NULL family, rename FAMILY/SELECTED_COUNT to FAMILY/NVT_COUNT and
	FAMILY/NVT_COUNT to FAMILY/MAX_NVT_COUNT, and add MAX_NVT_COUNT and
	KNOWN_NVT_COUNT to the config.

2009-10-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (start_task): Set current_scanner_task before task run
	status, so that report run status is set with task run status.

2009-10-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Add an id column to each table to force VACUUM to respect ROWID.  This
	makes it safe to use ROWID as a foreign key.

	* src/tasks_sql.h (DATABASE_VERSION): Increase to 5, for new id columns.
	(init_manage): Add an id column to every table with constraints INTEGER
	PRIMARY KEY.
	[0] (migrate_4_to_5): Add outline of 4 to 5 migrator.
	(COL_CONFIG_PREFERENCES__NAME, COL_CONFIG_PREFERENCES__VALUE)
	(COL_CONFIGS__NAME, COL_CONFIGS__NVT_SELECTOR, COL_CONFIGS__COMMENT)
	(COL_CONFIGS__FAMILIES_GROWING, COL_CONFIGS__NVTS_GROWING)
	(COL_LSC_CREDENTIALS__NAME, COL_LSC_CREDENTIALS__PASSWORD)
	(COL_LSC_CREDENTIALS__COMMENT, COL_LSC_CREDENTIALS__PUBLIC_KEY)
	(COL_LSC_CREDENTIALS__PRIVATE_KEY, COL_LSC_CREDENTIALS__RPM)
	(COL_LSC_CREDENTIALS__DEB, COL_LSC_CREDENTIALS__EXE)
	(COL_NVT_PREFERENCES__NAME, COL_NVT_PREFERENCES__VALUE)
	(COL_NVT_SELECTORS__NAME, COL_NVT_SELECTORS__NVT, COL_NVTS__OID)
	(COL_NVTS__VERSION, COL_NVTS__NAME, COL_NVTS__SUMMARY)
	(COL_NVTS__DESCRIPTION, COL_NVTS__COPYRIGHT, COL_NVTS__CVE, COL_NVTS__BID)
	(COL_NVTS__XREF, COL_NVTS__TAG, COL_NVTS__SIGN_KEY_IDS)
	(COL_NVTS__CATEGORY, COL_NVTS__FAMILY, COL_REPORT_HOSTS__HOST)
	(COL_REPORT_HOSTS__START_TIME, COL_REPORT_HOSTS__END_TIME)
	(COL_REPORT_HOSTS__ATTACK_STATE, COL_REPORT_HOSTS__CURRENT_PORT)
	(COL_REPORT_HOSTS__MAX_PORT, COL_TARGETS__NAME, COL_TARGETS__HOSTS)
	(COL_TARGETS__COMMENT, COL_TASK_FILES__NAME, COL_TASK_FILES__CONTENT): New
	defines.  Use instead of integers in all iterator access functions.

2009-10-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Add database migration from version 3 to 4.

	* src/tasks_sql.h (nvt_selector_iterator_name): New header.
	(migrate_3_to_4, nvt_selector_iterator_name): New functions.
	(database_migrators): Enable 3 to 4 migration.
	(init_nvt_selector_iterator): If name is NULL do all selectors.

2009-10-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Add database migration from version 2 to 3.

	* src/tasks_sql.h (migrate_2_to_3): New function.
	(database_migrators): Enable 2 to 3 migration.

2009-10-26  Michael Wiegand <michael.wiegand@greenbone.net>

	Post-release version bump.

	* VERSION: Set to 0.9.3.SVN.

	* CMakeLists.txt: CPACK_PACKAGE_VERSION_PATCH updated.

	* doc/Doxyfile, doc/Doxyfile_full: Updated PROJECT_NUMBER.

2009-10-26  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 0.9.2 release.

	* VERSION: Set to 0.9.2.

	* CMakeLists.txt: CPACK_PACKAGE_VERSION_PATCH updated.

	* doc/Doxyfile, doc/Doxyfile_full: Updated PROJECT_NUMBER.

	* CHANGES: Updated.

2009-10-26  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/otp.c (process_otp_scanner_input): In OTP, NVT descriptions do
	not contain newlines, they are instead replaced by semicolons.
	Undo this before descriptions enter nvti structures and ultimately the
	database.

2009-10-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_get_lsc_credentials_0.c,
	src/tests/omp_create_lsc_credentials_0.c,
	src/tests/omp_create_lsc_credentials_1.c,
	src/tests/omp_delete_lsc_credential_0.c: Remove underscores and spaces
	from LSC names.

2009-10-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/lsc_user.c (ssh_privkey_create): Quote passwords for openssl.

2009-10-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (create_lsc_credential): Check that name is all
	alphanumeric.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_LSC_CREDENTIAL
	handle name error.

2009-10-24  Matthew Mundell <matthew.mundell@greenbone.net>

	In LSC generator, improve command exit checking and pass args around
	directly instead of via a structure.

	* src/lsc_user.c (ssh_privkey_create): Make args const.
	(ssh_pubkey_create): Make args const.  Add function to tracing.
	(lsc_user_rpm_create): Take user name and public key path directly.
	Check command exit status properly.
	(execute_alien): Check command exit status properly.  Separate function
	exit variable from command exit.
	(lsc_user_deb_create): Take user name directly.  Free the lowercased name.
	(lsc_user_all_create): Pass parameters to functions directly, instead of
	using a login structure.

2009-10-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/lsc_user.c: Add fullstops to a few comments.  Convert printfs to
	g_debugs.

2009-10-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/lsc_user.c: Make docs and comments consistent.

2009-10-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/lsc_user.c: Tidy.  Match formatting to standard.

2009-10-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (collate_message_type): New function.
	(init_manage_process): Create collate_message_type collation.
	(init_result_iterator): Order types with collation collate_message_type.

2009-10-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (print_report_latex): Skip Log and Debug messages.

2009-10-23  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/omp.c (latex_severity_heading, print_report_latex): Use
	High/Medium/Low terms.

2009-10-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/lsc_user.c (ssh_privkey_create, ssh_pubkey_create): Make return int.
	(ssh_key_create): Remove.
	(lsc_user_all_create): Call key create functions directly.  Access paths
	with variables.

2009-10-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/lsc_user.c: Remove alternate sections.  Add missing __FUNCTION__
	args to g_debug's.

2009-10-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/lsc_user.c: Replace show_error with g_debug, remove gettext _.

2009-10-23  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/omp.c (print_report_latex): Better avoidance of
	overlong pages.

2009-10-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Cleanup LSC package generation a bit.

	* src/lsc_user.c: Cleanup some indenting and comments.  Add some tracing.
	(ssh_pubkey_create): Remove existence check.  Quote some command args.
	Free GError.
	(ssh_key_create_unlink_files): Remove.
	(get_rpm_generator_path): Use new location and name for RPM generator.
	Just search in one place.
	(lsc_user_rpm_create): Create temp dir with mkdtemp.  Use new name for
	RPM generator.  Make rmdir failure an error.
	(lsc_user_all_create): Create temp dir for keys.  Free mem and remove dirs
	on exit.

	* CMakeLists.txt (DATADIR, OPENVAS_DATA_DIR): New variables.

	* src/CMakeLists.txt: Define OPENVAS_DATA_DIR if possible.

2009-10-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (accept_and_maybe_fork): Set SIGCHLD handler to
	SIG_DFL in child.
	(main): Revert SIGCHLD handler to SIG_IGN.

2009-10-23  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/omp.c (latex_header, latex_footer, print_report_latex):
	Generalized LaTeX-based PDF Report (not "OpenVAS"-specific).
	Also added table of contents.

2009-10-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_get_preferences_2.c: Correct test number.

2009-10-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Add families to NVT selectors in database when creating selectors from
	RC file.

	* src/tasks_sql.h (clude): Add a families arg.  Insert the NVT family in
	families and the database.
	(insert_rc_into_config): Let clude do the families inserting.
	(nvt_selector_family_growing): Correct column name in SQL.

2009-10-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Extend OMP GET_CONFIGS for retrieving a single config with a summary
	of the selected families.

	* src/tasks_sql.h (DATABASE_VERSION): Increase to 4, for change to
	nvt_selectors.
	(init_manage): Add row family to nvt_selectors.
	(init_config_iterator): Add name arg.
	(family_nvt_count, init_family_iterator, family_iterator_name)
	(nvt_selector_family_growing, nvt_selector_family_selected_count): New
	functions.

	* src/manage.h: Update headers.

	* src/omp.c (omp_xml_handle_start_element, omp_xml_handle_end_element):
	Add name and families attributes to GET_CONFIGS.

2009-10-22  Matthew Mundell <matthew.mundell@greenbone.net>

	Add generation of LSC user keys and packages (RPM and Debian).  Extend OMP
	GET_LSC_CREDENTIALS for retrieving packages.

	* src/lsc_user.c, src/lsc_user.h: New files.  Key and package generation.

	* src/CMakeLists.txt (manage): Add lsc_user.c.

	* src/openvasmd.c (main): Enable SIGCHLD.  Neaten some formatting.
	(serve_client): Goto fail case if read_protocol failed completely.
	(cleanup): Neaten some formatting.

	* src/tasks_sql.h (DATABASE_VERSION): Increase to 3 for changes to
	lsc_credentials table.
	(init_manage): Add password column to table lsc_credentials, rename column
	dog to exe, make the package columns of type text.
	(clude): Change sqlite3_bind_text free function to SQLITE_TRANSIENT.
	(create_lsc_credential): Create keys and packages.
	(init_lsc_credential_iterator): New function.
	(lsc_credential_iterator_password, lsc_credential_iterator_public_key)
	(lsc_credential_iterator_private_key, lsc_credential_iterator_rpm)
	(lsc_credential_iterator_deb, lsc_credential_iterator_exe): New functions.
	(lsc_credential_iterator_comment): Update column number.

	* src/manage.h: Update headers.

	* src/omp.c (omp_xml_handle_start_element, omp_xml_handle_end_element):
	Add name and format flags to GET_LSC_CREDENTIALS.

2009-10-21  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/openvasmd.c (cleanup, main): Factored out pidfile management.

2009-10-21  Matthew Mundell <matthew.mundell@greenbone.net>

	Add database migration from version 1 to 2.

	* src/tasks_sql.h (migrate_0_to_1): Clarify note slightly.
	(migrate_1_to_2): New function.
	(database_migrators): Enable 1 to 2 migration.
	(init_manage): Note that db may still need an update after migration.

2009-10-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_manage): Init current_credentials.

2009-10-20  Matthew Mundell <matthew.mundell@greenbone.net>

	Add database migration from version 0 to 1.

	* src/tasks_sql.h (manage_db_version): Correct doc.
	(set_db_version): New function.
	(migrate_0_to_1): Enable, and add implementation.
	(database_migrators): Enable 0 to 1 migration.
	(init_manage): Use set_db_version.

	* ChangeLog: Add actual versions at DATABASE_VERSION changes.  Replace
	indent spaces with tabs.

2009-10-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h: Bring docs up to date.  Remove docs from DEF_ACCESS
	invocations so that they're all the same.

2009-10-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_get_preferences_0.c: Expect success always, now that the
	manager only loads if the preferences are cached.

2009-10-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_start_task_0.c: Also expect REPORT_ID in response.

2009-10-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_get_status_5.c: Add FINISHED to REPORT_COUNT in
	expected response.

2009-10-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (cleanup): Add comment to #endif.

2009-10-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (manage_nvt_preference_add): Make args const.
	* src/manage.h: Update header.

2009-10-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otp.c (parse_scanner_preference_value): Only add the preference when
	in caching mode.
	(process_otp_scanner_input): After successfully parsing a preference, free
	current_scanner_preference and set it NULL.

2009-10-19  Michael Wiegand <michael.wiegand@greenbone.net>

	Post-release version bump.

	* VERSION: Set to 0.9.2.SVN.

	* CMakeLists.txt: CPACK_PACKAGE_VERSION_PATCH updated.

	* doc/Doxyfile, doc/Doxyfile_full: Updated PROJECT_NUMBER.

2009-10-19  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 0.9.1 release.

	* VERSION: Set to 0.9.1.

	* CMakeLists.txt: CPACK_PACKAGE_VERSION_PATCH updated.

	* doc/Doxyfile, doc/Doxyfile_full: Updated PROJECT_NUMBER.

	* CHANGES: Updated.

2009-10-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (report_counts): Swap infos and warnings.
	(task_infos_size): Count Notes instead of Warnings.
	(task_notes_size): Remove.
	(task_warnings_size): New function.
	* src/manage.h: Update header.

	* src/omp.c (omp_xml_handle_end_element): Call task_warnings_size instead
	of task_notes_size.

2009-10-19  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/omp.c (convert_to_newlines): Handle backslashes not followed by
	'n' or 'r' correctly.

2009-10-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (result_type_threat): New function.
	(omp_xml_handle_end_element): In CLIENT_GET_REPORT change the XML report
	TYPE to THREAT.

2009-10-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (send_to_client): Temporarily add conversion of msg from
	iso_8859-1 to utf-8, to catch iso chars originating from the OTP messages.

2009-10-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (rc_preference): Check whether there is a value to
	duplicate after an equal sign.

2009-10-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Include report ID in OMP START_TASK response.

	* src/tasks_sql.h (create_report): Add report_id output arg.

	* src/manage.c (start_task): Add report_id output arg.  Pass to
	create_report.
	* src/manage.h: Update header.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_START_TASK add report
	ID to OK response.

2009-10-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (set_task_parameter): Remove all task files when
	setting RC file.

2009-10-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (get_files_to_send): Cleanup a little formatting.
	(start_task): Update LSC comment.

2009-10-15  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	Do not do any logic when sending files, just send all we have in the
	db.

	* src/manage.c (files_append_lsc): Removed, replaced by
	get_files_to_send.
	(get_files_to_send): New, creates a list of files to send.
	(preference_value, send_config_preferences): Do not modify list of
	files to send.
	(start_task): Do not collect list of files to send via calls to
	preference_value and files_append_lsc, but use new get_files_to_send
	instead.

2009-10-15  Michael Wiegand <michael.wiegand@greenbone.net>

	Make sure the parent pidfile is only removed when the parent exits.

	* src/openvasmd.c: Introduce global is_parent indicator.
	(accept_and_maybe_fork): Set is_parent to 0 in the child immediately
	after forking.
	(cleanup): Check if this process is the parent before removing the
	pidfile.

2009-10-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Add parsing of NVT category from OTP.

	* src/otp.c: Include openvas/nvt_categories.h.
	(category_number): New function.
	(process_otp_scanner_input): In SCANNER_PLUGIN_LIST_CATEGORY set the
	category number according to the OTP field.

	* src/tasks_sql.h (DATABASE_VERSION): Increase to 2, due to nvts category
	column type specification.
	(init_manage): Specify type for category column in table nvts.
	(make_nvt_from_nvti): Insert category as int.
	(nvt_iterator_category): Change return to int.

	* src/manage.h: Update header.

	* src/omp.c: Include openvas/nvt_categories.h.
	(category_name): New function.
	(send_nvt): Convert category number into name.

2009-10-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Free modify_task_file.

2009-10-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (delete_task): Delete task files too.

2009-10-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (manage_task_update_file): Add missing arg to sql call.

2009-10-12  Matthew Mundell <matthew.mundell@greenbone.net>

	Add a --database option.

	* src/tasks_sql.h (manage_migrate, init_manage_process, init_manage): Add
	database arg.  Use to init database.  Update callers.
	* src/manage.h: Update headers.

	* src/omp.c (init_omp, init_omp_process): Add database arg.  Update
	callers.
	* src/omp.h: Update headers.

	* src/ompd.c (init_ompd, serve_omp): Add database arg.  Update callers.
	* src/ompd.h: Update headers.

	* src/openvasmd.c (database): New variable.
	(main): Add --database.

2009-10-09  Matthew Mundell <matthew.mundell@greenbone.net>

	Add FILE to OMP MODIFY_TASK, for clients to send files referenced by
	preferences.  Associate files with tasks instead of with configs.

	* src/otp.c (process_otp_scanner_input): Handle OTP FILE_ACCEPTED.

	* src/ovas-mngr-comm.c (sendn_to_server): Switch message type to void.
	* src/ovas-mngr-comm.h: Update header.

	* src/omp.c (current_name, modify_task_file): New variables.
	(client_state_t): Add CLIENT_MODIFY_TASK_FILE.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add MODIFY_TASK FILE handling.

	* src/tasks_sql.h (init_manage): Rename table config_files to task_files,
	associating the file with a task instead of a config.
	(manage_task_update_file, manage_task_remove_file)
	(init_task_file_iterator, task_file_iterator_content)
	(task_file_iterator_length): New functions.
	(init_config_file_iterator, config_file_iterator_content)
	(config_file_iterator_length): Remove.

	* src/manage.c (send_task_file): New function.  Renamed from
	send_config_file.  Adjust for new task-file association.

	* src/manage.h: Update headers.

2009-10-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (latex_escape_text): Replace $\backslash with $\\backslash in
	string literals.  Adjust the backslash case to move the correct portion
	of the string forward, and to move the character pointer to the correct
	final location.

2009-10-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (report_notes, report_warnings): Add missing args to
	calls.

2009-10-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (report_holes): Add missing arg to call.

2009-10-09  Matthew Mundell <matthew.mundell@greenbone.net>

	Add support for storing files referenced in preferences, and sending
	of the files to the scanner.

	* src/tasks_sql.h (init_manage): Add table config_files.
	(init_config_file_iterator, config_file_iterator_content)
	(config_file_iterator_length): New functions.

	* src/manage.c (preference_value): Add file type parsing, which pushes
	file onto new arg "files".
	(send_config_preferences): Pass files list through.
	(send_config_file): New function.
	(start_task): Send files gathered with sending preferences.

	* src/manage.h: Add new headers.

2009-10-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (preference_value): New function.  Handles radio
	preference type parsing.
	(send_config_preferences): Get actual value of preference with
	preference_value.

2009-10-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (set_task_parameter): Free rc on fail.  Moving setting
	the task description and targets to precede filling the config, as
	insert_rc_into_config modifies its rc argument.

2009-10-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (make_task_rcfile): Remove append of name.

2009-10-06  Tim Brown <timb@openvas.org>

	* src/otp.c: Fixed memory leak.

2009-10-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_manage): Log database versions on version failure.

2009-10-06  Matthew Mundell <matthew.mundell@greenbone.net>

	Complete database initialisation check started yesterday.

	* src/tasks_sql.h (init_manage): Add nvt_cache_mode arg.  Update caller.
	Enable and complete database initialisation check.
	* src/manage.h: Update header.

	* src/omp.c (init_omp): Add nvt_cache_mode arg.  Update caller.
	* src/omp.h: Update header.

	* src/ompd.c (init_ompd): Add nvt_cache_mode arg.  Update caller.
	* src/ompd.h: Update header.

	* src/openvasmd.c (main): Add "must init" failure to init_ompd return
	checks.

2009-10-05  Matthew Mundell <matthew.mundell@greenbone.net>

	Move caching of NVT preferences to the database.

	* src/otp.h (scanner_init_state_t): Add SCANNER_INIT_DONE_CACHE_MODE.

	* src/ompd.c (init_ompd): In SCANNER_INIT_GOT_PLUGINS set scanner init to
	special cache done state when in cache mode.  Add
	SCANNER_INIT_DONE_CACHE_MODE to error check.
	(serve_omp): Add SCANNER_INIT_DONE_CACHE_MODE to select setup.

	* src/otp.c (current_scanner_preferences, make_scanner_preferences)
	(add_scanner_preference): Remove.
	(init_otp_data): Remove scanner.preferences init.
	(parse_scanner_preference_value): Call manage_nvt_preference_add instead
	of add_scanner_preference.
	(process_otp_scanner_input): Add SCANNER_INIT_DONE_CACHE_MODE alongside
	SCANNER_INIT_DONE.  In NVT cache mode, instead of exiting when the
	NVTs are cached, continue to read the preferences and exit after that.

	* src/tasks_sql.h (init_manage_process): Also clear NVT prefs.
	(init_manage): Add outline for database initialisation check.  Add table
	nvt_preferences.
	(manage_nvt_preference_add, manage_nvt_preferences_enable)
	(init_nvt_preference_iterator, nvt_preference_iterator_name)
	(nvt_preference_iterator_value): New functions.

	* src/manage.h: Add headers.
	(scanner_t): Remove preferences slot.

	* src/omp.c (send_preference): Remove.
	(omp_xml_handle_end_element): In CLIENT_GET_PREFERENCES use new
	preferences iterator to send preferences.

2009-10-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ompd.c (recreate_session): Add openvas_server_free to fnctl fail.
	(serve_omp): Put the credential args the right way round.

2009-10-03  Matthew Mundell <matthew.mundell@greenbone.net>

	When parsing the OTP PREFERENCES, read in all the preferences before
	enabling them, otherwise OMP GET_PREFERENCES might return a partial
	set of preferences.

	* src/otp.c (current_scanner_preferences): New variable.
	(make_scanner_preferences): Return preferences instead of setting scanner.
	(add_scanner_preference): Set preference on a given preference table
	instead of on scanner.preferences.  Update caller.
	(process_otp_scanner_input): Initialise current_scanner_preferences
	with the make_scanner_preferences return.  In SCANNER_PREFERENCE_NAME set
	scanner.preferences to current_scanner_preferences.

	* src/tests/omp_get_preferences_2.c: New file.  Tests that first two
	successful returns from GET_PREFERENCES are identical.

	* src/tests/CMakeLists.txt: Add omp_get_preferences_2.

2009-09-30  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Post-release version bump.

	* VERSION: Set to 0.9.1.SVN.

	* CMakeLists.txt: CPACK_PACKAGE_VERSION_PATCH updated.

	* doc/Doxyfile, doc/Doxyfile_full: Updated PROJECT_NUMBER.

2009-09-30  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Preparing the openvas-manager 0.9.0 release.

	* VERSION: Set to 0.9.0.

	* CMakeLists.txt: CPACK_PACKAGE_VERSION_PATCH updated.

	* doc/Doxyfile, doc/Doxyfile_full: Updated PROJECT_NUMBER.

	* CHANGES: Updated.

2009-09-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (DATABASE_VERSION): Increase to 1, for column added
	2009-08-28.

2009-09-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* CMakeLists.txt: Rename server to scanner in defs, to match code.

	* src/CMakeLists.txt: Rename server to scanner in defs, to match code.

2009-09-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_manage): Move targets table creation up.
	(delete_config, config_in_use): Special case predefined configs.

2009-09-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* INSTALL: Note need for om user.

2009-09-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* CMakeLists.txt: Set minimum cmake version to 2.6.

2009-09-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db_postgres.sql (meta, nvts, lsc_credentials): New tables.
	(configs): Move up to match manager.

2009-09-28  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* doc/openvasmd.8.xml, README: Renaming openvasd to openvassd.

2009-09-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ompd.c, src/otpd.c: Add missing arg docs.

2009-09-25  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP commands CREATE_LSC_CREDENTIAL, DELETE_LSC_CREDENTIAL and
	GET_LSC_CREDENTIALS.

	* src/tasks_sql.h (init_manage): Create table lsc_credentials.
	(create_lsc_credential, delete_lsc_credential)
	(init_lsc_credential_iterator, lsc_credential_iterator_name)
	(lsc_credential_iterator_comment): New functions.
	* src/manage.h: Add headers.

	* src/omp.c (help_text): Add new commands.
	(client_state_t): Add new states.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add handling of new commands.

	* src/tests/omp_help_0.c: Update help text.

	* src/tests/omp_create_lsc_credential_0,
	src/tests/omp_create_lsc_credential_1,
	src/tests/omp_delete_lsc_credential_0,
	src/tests/omp_get_lsc_credentials_0: New files.

	* src/tests/CMakeLists.txt: Add omp_create_lsc_credential_0,
	omp_create_lsc_credential_1, omp_delete_lsc_credential_0 and
	omp_get_lsc_credentials_0.

2009-09-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd_log_conf.cmake_in (*): Send logs to openvasmd.log
	instead of openvas.log.

2009-09-25  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch entirely to the openvas_server library interface for handling the
	client and scanner sessions.

	* src/openvasmd.c (client_session, client_credentials): New variables.
	(serve_client, accept_and_maybe_fork, main): Use openvas_server interface
	instead of ovas_scanner interface for the client session.  Switch to
	openvas_server_new for the scanner session.  Ensure that O_NONBLOCK is
	set on the scanner socket (as this was previously done in
	openvas_server_session_new).  Remove initialisation of client session in
	NVT cache updating mode.
	(cleanup): Remove ovas_scanner_context cleanup.

	* src/otpd.c (serve_otp): Add credentials arg.  Call openvas_server_free
	instead of close_stream_connection.

	* src/otpd.h: Add include.
	(serve_otp): Add args.

	* src/ompd.c (serve_omp): Add credentials arg.  Call openvas_server_free
	instead of close_stream_connection.
	(recreate_session): Switch to openvas_server_free and openvas_server_new.
	Ensure O_NONBLOCK is set on the socket.

	* src/ompd.h (serve_omp): Add credential arg.

	* src/CMakeLists.txt (openvasmd): Remove LINK_FLAGS symbol hack for
	openvas_get_socket_from_connection.

2009-09-25  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/tests/common.h: Adjusted include.

2009-09-25  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/manage.c, src/manage.h, src/omp.c, src/otp.c, src/tests/common.h:
	Adjusted includes to recent changes in trunk (headers from
	openvas-libraries/base get installed to openvas/base/).

2009-09-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/rmdir_recursively_0.c,
	src/tests/rmdir_recursively_1.c: Remove.

2009-09-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_get_nvt_feed_checksum_1.c,
	src/tests/omp_get_nvt_details_4.c,
	src/tests/omp_get_nvt_feed_checksum_5.c,
	src/tests/omp_modify_report_0.c, src/tests/omp_get_status_2.c,
	src/tests/omp_get_status_4.c, src/tests/omp_get_nvt_all_1.c,
	src/tests/omp_get_report_5.c, src/tests/omp_start_task_1.c,
	src/tests/omp_get_report_7.c, src/tests/omp_start_task_3.c,
	src/tests/omp_delete_task_1.c, src/tests/omp_get_configs_2.c,
	src/tests/omp_get_rules_1.c, src/tests/omp_delete_report_0.c,
	src/tests/omp_get_preferences_1.c, src/tests/omp_get_nvt_details_1.c,
	src/tests/omp_get_nvt_feed_checksum_4.c, src/tests/omp_get_status_3.c,
	src/tests/omp_get_dependencies_1.c, src/tests/omp_abort_task_0.c,
	src/tests/omp_get_certificates_1.c, src/tests/omp_get_report_0.c,
	src/tests/omp_get_report_4.c, src/tests/omp_get_report_6.c,
	src/tests/omp_start_task_2.c, src/tests/omp_get_report_8.c,
	src/tests/omp_delete_task_0.c, src/tests/omp_delete_task_2.c,
	src/tests/omp_get_configs_3.c: Replace "server" with "scanner" everywhere.

2009-09-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ompd.c, src/omp.h, src/otp.c, src/ovas-mngr-comm.c,
	src/otpd.c, src/otp.h, src/tasks_sql.h, src/oxpd.c, src/oxpd.h,
	src/manage.c, src/omp.c, src/openvasmd.c, src/manage.h: Replace "server"
	with "scanner" everywhere.

2009-09-23  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/openvasmd.c: Replaced server by scanner, openvasd by openvassd.
	Reflect API change (openvas_server_context -> openvas_scanner_context).

2009-09-23  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/CMakeLists.txt: All libraries depend on libopenvas(base), added
	the 'libopenvas-config --cflag' to the compile flags.

	* src/ompd.c, src/otpd.c, src/oxpd.c: In comments, replaced 'Server' by
	'Scanner', openvasd by openvassd.

2009-09-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/CMakeLists.txt (DOC_FILES): Remove string.c and file.c.

	* INSTALL: Update reference system to Lenny.  Add space after fullstop.

	* README, src/tests/common.c: Correct doc typos.

	* src/omp.c, src/ompd.c, src/ovas-mngr-comm.c, src/otp.c, src/manage.c: In
	doc comments, put conditionals around macro function definitions and
	references to static functions.  Doc a missing param.  Refer to
	to_server more generically.

	* src/openvasmd.c (\mainpage): Update.
	(FORK): Doc.

2009-09-22  Matthew Mundell <matthew.mundell@greenbone.net>

	Remove the file library, which is out of use.

	* src/file.c, src/file.h: Remove.

2009-09-22  Matthew Mundell <matthew.mundell@greenbone.net>

	Remove the file library, which is out of use.

	* doc/Doxyfile, doc/Doxyfile_full: Remove file.c.

	* src/tests/CMakeLists.txt: Remove linkage to libfile.
	(rmdir_recursively_0, rmdir_recursively_1): Remove.

	* src/manage.c: Remove file.h include.

	* src/CMakeLists.txt: Remove file and string linkage.
	(libfile): Remove.
	(C_FILES): Remove file.c.

2009-09-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Ensure that before every
	g_base64_encode call there is a check that prevents passing NULL or an
	empty string to g_base64_encode.

2009-09-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd_log_conf.cmake_in: Match time prepend formats to
	openvas-libraries.
	(md string, libopenvas, libnasl, openvasd): Remove.
	(*): Add %t to prepend, to match other entries.

	* src/openvasmd.c (main): Remove g_log_set_handler calls, as that's what
	setup_log_handlers does.  Rename NESSUS_ENCAPS_TLSv1 to
	OPENVAS_ENCAPS_TLSv1.

2009-09-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_create_task_2.c: Update predefined config name.

2009-09-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.c (setup_test): Set g_log_default_log_handler to
	openvas_log_func.

	* src/tests/omp_get_nvt_all_0.c, src/tests/omp_get_nvt_details_0.c,
	src/tests/omp_get_nvt_feed_checksum_0.c,
	src/tests/omp_get_nvt_feed_checksum_2.c: Add checks for successful
	responses.

	* src/tests/omp_create_task_3.c, src/tests/omp_start_task_3.c,
	src/tests/omp_delete_target_1.c: Correct predefined config names.

	* src/tests/omp_get_report_7.c: Correct heading typo.

	* src/tests/omp_get_rules_0.c: Update expected result.

	* src/tests/omp_create_task_4.c: Match expected target to RC.

	* src/tests/new_task_small__many_plugins_yes_rc: New file.  Missing RC
	for omp_create_task_4.

2009-09-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_delete_target_0.c, src/tests/omp_get_targets_1.c,
	src/tests/omp_modify_task_0.c, src/tests/omp_get_nvt_details_0.c,
	src/tests/omp_get_nvt_feed_checksum_1.c, src/tests/omp_get_nvt_details_2.c,
	src/tests/omp_get_nvt_feed_checksum_3.c, src/tests/omp_get_nvt_details_4.c,
	src/tests/omp_get_nvt_feed_checksum_5.c, src/tests/omp_get_status_0.c,
	src/tests/omp_modify_report_0.c, src/tests/omp_get_status_2.c,
	src/tests/omp_get_dependencies_0.c, src/tests/omp_get_status_4.c,
	src/tests/omp_create_task_1.c, src/tests/omp_delete_config_0.c,
	src/tests/omp_create_task_3.c, src/tests/omp_get_nvt_all_1.c,
	src/tests/omp_get_certificates_0.c, src/tests/omp_create_target_0.c,
	src/tests/omp_get_report_1.c, src/tests/omp_get_report_3.c,
	src/tests/omp_get_report_5.c, src/tests/omp_start_task_1.c,
	src/tests/read_protocol_0.c, src/tests/omp_get_report_7.c,
	src/tests/omp_start_task_3.c, src/tests/omp_start_task_5.c,
	src/tests/omp_get_version_0.c, src/tests/omp_delete_task_1.c,
	src/tests/omp_get_configs_0.c, src/tests/omp_create_config_0.c,
	src/tests/omp_get_configs_2.c, src/tests/omp_get_rules_1.c,
	src/tests/omp_delete_report_0.c, src/tests/omp_commands_0.c,
	src/tests/omp_get_preferences_1.c, src/tests/omp_get_targets_0.c,
	src/tests/omp_delete_target_1.c, src/tests/omp_modify_task_1.c,
	src/tests/omp_get_nvt_feed_checksum_0.c, src/tests/omp_get_nvt_details_1.c,
	src/tests/omp_get_nvt_feed_checksum_2.c, src/tests/omp_get_nvt_details_3.c,
	src/tests/omp_get_nvt_feed_checksum_4.c, src/tests/omp_bogus_1.c,
	src/tests/omp_get_status_1.c, src/tests/omp_create_task_0.c,
	src/tests/omp_get_status_3.c, src/tests/omp_get_dependencies_1.c,
	src/tests/omp_create_task_2.c, src/tests/omp_get_status_5.c,
	src/tests/omp_delete_config_1.c, src/tests/omp_abort_task_0.c,
	src/tests/omp_create_task_4.c, src/tests/omp_get_nvt_all_0.c,
	src/tests/omp_get_certificates_1.c, src/tests/omp_get_report_0.c,
	src/tests/omp_create_target_1.c, src/tests/timeout_0.c,
	src/tests/omp_get_report_2.c, src/tests/omp_get_report_4.c,
	src/tests/omp_start_task_0.c, src/tests/omp_get_report_6.c,
	src/tests/omp_start_task_2.c, src/tests/omp_get_report_8.c,
	src/tests/omp_start_task_4.c, src/tests/omp_delete_task_0.c,
	src/tests/omp_delete_task_2.c, src/tests/omp_help_0.c,
	src/tests/omp_get_configs_1.c, src/tests/omp_get_rules_0.c,
	src/tests/omp_create_config_1.c, src/tests/omp_get_configs_3.c,
	src/tests/omp_delete_report_1.c, src/tests/omp_get_preferences_0.c: Use
	new openvas-library/omp interface names.

2009-09-18  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch to openvas-libraries string functions.

	* src/string.h, src/string.c: Remove.

	* doc/Doxyfile_full, doc/Doxyfile: Remove string.c.

	* src/omp.c, src/otp.c, src/manage.c: Switch to openvas-libraries string
	functions.

	* src/CMakeLists.txt: Remove string library.

	* src/tests/CMakeLists.txt: Drop string linkage.

	* src/tests/common.h: Include openvas_string.h for tests.

	* src/tests/strip_space_3.c, src/tests/omp_get_targets_1.c,
	src/tests/omp_get_nvt_feed_checksum_1.c,
	src/tests/omp_get_nvt_feed_checksum_5.c, src/tests/omp_get_nvt_all_1.c,
	src/tests/omp_get_report_5.c, src/tests/omp_get_report_7.c,
	src/tests/omp_get_configs_0.c, src/tests/omp_get_configs_2.c,
	src/tests/strip_space_0.c, src/tests/strip_space_2.c,
	src/tests/omp_get_targets_0.c, src/tests/omp_get_nvt_feed_checksum_4.c,
	src/tests/omp_get_report_0.c, src/tests/omp_get_report_4.c,
	src/tests/omp_get_report_6.c, src/tests/omp_get_report_8.c,
	src/tests/omp_get_configs_1.c, src/tests/omp_get_configs_3.c,
	src/tests/strip_space_1.c: Switch tests to openvas-libraries string
	functions.

2009-09-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ovas-mngr-comm.c (make_session, end_session)
	(connect_to_server): Remove.  Replaced in openvas_server library.

	* src/openvasmd.c, src/otpd.c, src/ompd.c: Replace calls to make_session,
	end_session and connect_to_server with calls to the new openvas_server
	equivalents.

2009-09-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (OPENVASD_PORT): Set to 9391.
	(OPENVASMD_PORT): Set to 9390.
	(server_context): Remove.  Rename to ovas_server_context.
	(ovas_server_context): New variable.  Was server_context.
	(accept_and_maybe_fork): Note use of save_tasks.
	(main): Set manager_port instead of manager_address.sin_port when
	generating the port, otherwise the value is overwritten later.  Set
	SO_REUSEADDR on manager socket.

2009-09-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_CONFIGS and
	CLIENT_GET_TARGETS add status attributes to responses.

	* src/tests/omp_get_configs_0.c, src/tests/omp_get_configs_1.c,
	src/tests/omp_get_configs_2.c, src/tests/omp_get_configs_3.c: Add status
	attribute checks.  Update predefined config name and comment.  Remove a
	family count check from omp_get_configs_3.

	* src/tests/omp_get_targets_0.c, src/tests/omp_get_targets_1.c: Add status
	attribute checks.

2009-09-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/CMakeLists.txt (OVAS_LDFLAG): Remove -lopenvas_omp.

2009-09-16  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/openvasmd.c (serve_client): Renamed call of
	nessus_get_socket_from_connection to
	openvas_get_socket_from_connection.

	* src/CMakeLists.txt: Renamed nessus_get_socket_from_connection
	to openvas_get_socket_from_connection.

2009-09-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (max_hosts): Handle dotted decimal CIDR addresses.  Only
	subtract broadcast from count.

	* src/tests/omp_get_targets_0.c, src/tests/omp_get_targets_1.c: Adjust
	expected results.

2009-09-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (max_hosts): Subtract network and broadcast from count.

2009-09-15  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch to OMP library in openvas-libraries.

	* src/tests/common.c (BUFFER_SIZE, TRACE, send_to_manager)
	(sendf_to_manager, context_data_t, make_entity, next_entities)
	(first_entities, add_entity, add_attribute, free_entity, entity_text)
	(entity_name, compare_entity_with_name, entity_child, entity_attribute)
	(buffer_start, buffer_point, buffer_end, add_attribute)
	(handle_start_element, handle_end_element, handle_text, handle_error)
	(read_entity_and_text, read_entity, foreach_print_attribute, print_entity)
	(print_entities, compare_find_attribute, compare_entities, DO_CHILDREN)
	(task_status, authenticate, env_authenticate, omp_create_task)
	(create_task, create_task_from_rc_file, start_task, wait_for_task_start)
	(wait_for_task_end, wait_for_task_stop, wait_for_task_delete, delete_task)
	(omp_get_status, omp_get_report, omp_delete_report, omp_delete_task)
	(omp_modify_task, omp_get_preferences, omp_get_certificates, omp_until_up)
	(omp_create_target, omp_delete_target, omp_create_config)
	(omp_create_config_from_rc_file, omp_delete_config): Remove.
	(connect_to_manager_host_port, close_manager_connection): Wrap library
	functions.
	* src/tests/common.h: Remove headers.

	* src/tests/CMakeLists.txt: Link to -lopenvas_omp.

	* src/tests/omp_abort_task_0.c, src/tests/omp_authenticate_0.c,
	src/tests/omp_bogus_0.c, src/tests/omp_bogus_1.c,
	src/tests/omp_commands_0.c, src/tests/omp_create_target_0.c,
	src/tests/omp_create_target_1.c, src/tests/omp_create_task_0.c,
	src/tests/omp_create_task_1.c, src/tests/omp_create_task_2.c,
	src/tests/omp_create_task_3.c, src/tests/omp_create_task_4.c,
	src/tests/omp_delete_config_1.c, src/tests/omp_delete_report_0.c,
	src/tests/omp_delete_report_1.c, src/tests/omp_delete_target_0.c,
	src/tests/omp_delete_target_1.c, src/tests/omp_delete_task_0.c,
	src/tests/omp_delete_task_1.c, src/tests/omp_delete_task_2.c,
	src/tests/omp_get_certificates_0.c, src/tests/omp_get_certificates_1.c,
	src/tests/omp_get_configs_0.c, src/tests/omp_get_configs_1.c,
	src/tests/omp_get_configs_2.c, src/tests/omp_get_configs_3.c,
	src/tests/omp_get_dependencies_0.c, src/tests/omp_get_dependencies_1.c,
	src/tests/omp_get_nvt_all_0.c, src/tests/omp_get_nvt_all_1.c,
	src/tests/omp_get_nvt_details_0.c, src/tests/omp_get_nvt_details_1.c,
	src/tests/omp_get_nvt_details_2.c, src/tests/omp_get_nvt_details_3.c,
	src/tests/omp_get_nvt_details_4.c,
	src/tests/omp_get_nvt_feed_checksum_0.c,
	src/tests/omp_get_nvt_feed_checksum_1.c,
	src/tests/omp_get_nvt_feed_checksum_2.c,
	src/tests/omp_get_nvt_feed_checksum_3.c,
	src/tests/omp_get_nvt_feed_checksum_4.c,
	src/tests/omp_get_nvt_feed_checksum_5.c,
	src/tests/omp_get_preferences_0.c, src/tests/omp_get_preferences_1.c,
	src/tests/omp_get_report_0.c, src/tests/omp_get_report_1.c,
	src/tests/omp_get_report_2.c, src/tests/omp_get_report_3.c,
	src/tests/omp_get_report_4.c, src/tests/omp_get_report_5.c,
	src/tests/omp_get_report_6.c, src/tests/omp_get_report_7.c,
	src/tests/omp_get_report_8.c, src/tests/omp_get_rules_0.c,
	src/tests/omp_get_rules_1.c, src/tests/omp_get_status_0.c,
	src/tests/omp_get_status_1.c, src/tests/omp_get_status_2.c,
	src/tests/omp_get_status_3.c, src/tests/omp_get_status_4.c,
	src/tests/omp_get_status_5.c, src/tests/omp_get_targets_0.c,
	src/tests/omp_get_targets_1.c, src/tests/omp_get_version_0.c,
	src/tests/omp_help_0.c, src/tests/omp_help_1.c,
	src/tests/omp_modify_report_0.c, src/tests/omp_modify_task_0.c,
	src/tests/omp_modify_task_1.c, src/tests/omp_start_task_0.c,
	src/tests/omp_start_task_3.c, src/tests/omp_start_task_4.c,
	src/tests/omp_start_task_5.c, src/tests/timeout_0.c: Use OMP interface
	from libraries.

2009-09-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/logf.h (LOG): Set to 0.  That is, turn off compilation of
	communication logging.

2009-09-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Create RC file in DB when creating a task from config and target.
	Update config and target when setting a task RC file.

	* src/tasks_sql.h: Add a static header declaration section.
	(make_task_rcfile, set_target_hosts, find_config): New function.
	(set_task_parameter): Update config and target in RCFILE case.
	(create_config): Add missing doc.
	* src/manage.h (make_task_rcfile): New export.

	* src/omp.c (omp_xml_handle_end_element): In the CLIENT_CREATE_TASK
	config and target case, generate the RC file.

2009-09-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Keep the NVT cache in memory in each process, in an attempt to speed up
	family lookups when creating configs from RC files.

	* src/tasks_sql.h (nvti_cache): New variable.
	(init_manage): Load NVT cache from DB into memory.
	(insert_rc_into_config): Do the family lookup with nvti_cache and use the
	families hash table for counting only.  Also only do the family lookup if
	the plugin is included ("yes"), and use a single SQL statement to cache
	all the config info.

2009-09-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Add an rcfile attribute to OMP GET_STATUS, for getting task RC files.

	* src/omp.c (omp_xml_handle_start_element): Check for attribute.
	(omp_xml_handle_end_element): In CLIENT_GET_STATUS include rc file
	if attribute was set.

	* src/tests/common.c (omp_get_status): Add rcfile flag param.
	* src/tests/common.h: Update header.

2009-09-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.c (BUFFER_SIZE): Increase.
	(connect_to_manager_host_port): Neaten formatting.
	(create_task, omp_modify_task, omp_create_config): Check string lengths
	before passing them to g_base64_encode.

2009-09-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (send_nvt): Correct NVT name accessor.

2009-09-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Add missing
	CLIENT_MODIFY_TASK_NAME case.

2009-09-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In the CLIENT_GET_RULES case
	response with service down instead of internal error when server.rules
	is NULL.

2009-09-14  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* VERSION: Set to 0.8.2.SVN.

	* CMakeLists.txt: CPACK_PACKAGE_VERSION_PATCH updated.

	* doc/Doxyfile, doc/Doxyfile_full: Updated PROJECT_NUMBER.

2009-09-14  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 0.8.1 relase.

	* VERSION: Set to 0.8.1.

	* CMakeLists.txt: CPACK_PACKAGE_VERSION_PATCH updated.

	* doc/Doxyfile, doc/Doxyfile_full: Updated PROJECT_NUMBER.

	* CHANGES: Updated.

2009-09-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* README: Fill paragraphs.  Change test command back to the command
	that runs the test.

2009-09-11  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/types.h, src/tests/omp_get_report_1.c,
	src/tests/omp_get_report_2.c, src/tests/omp_get_report_3.c:
	Transferred  Copyright from Intevation to Greenbone.

	* README: Reworked.

2009-09-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (max_hosts): Invert the sense of the mask.  Use longs.
	(omp_xml_handle_end_element): Improve comments a bit.

	* src/tests/omp_get_targets_0.c: Correct figures.

	* src/tests/omp_get_targets_1.c: New file.

	* src/tests/CMakeLists.txt: Add omp_get_targets_1.

2009-09-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (nvt_selector_family_count): Use config name for
	config.

2009-09-04  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/openvasmd.c (main): Adjust to new API for SSL initialization.

2009-09-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Add database migration support.

	* src/openvasmd.c (main): Add a migrate option.  Add the supported
	database version to the version string.

	* src/tasks_sql.h (backup_db, restore_db, manage_db_supported_version)
	(manage_db_version, migrate_is_available, manage_migrate): New functions.
	(migrator_t): New type.
	(database_migrators): New variable.
	* src/manage.h: Update headers.

2009-09-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (task_second_last_report_id): Use scan_run_status as
	"finished" criterion, as task_last_report_id does.

2009-09-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otp.c (parse_server_error): Set the task state to Internal Error
	for E001.
	(process_otp_server_input): In SERVER_TIME_SCAN_END leave the task state
	as Internal Error when it is Internal Error.

2009-09-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OTP ERROR handling.

	* src/otp.c (server_state_t): Add new state.
	(sync_buffer): Move up in file.
	(parse_server_error): New function.
	(process_otp_server_input): Handle OTP ERROR.

2009-09-02  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* VERSION: Set to 0.8.1.SVN.

	* CMakeLists.txt: CPACK_PACKAGE_VERSION_PATCH updated.

2009-09-02  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 0.8.0 relase.

	* VERSION: Set to 0.8.0.

	* CMakeLists.txt: CPACK_PACKAGE_VERSION_PATCH updated.

	* CHANGES: Updated.

2009-09-01  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch START_TASK response to an error if the task is active.

	* src/manage.c (start_task): Return 1 if task is active.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_START_TASK respond
	with error if task is active.

	* src/tests/omp_start_task_5.c: New file.

	* src/tests/CMakeLists.txt: Add omp_start_task_5.

2009-09-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (setup_full_config_prefs): Switch to integers for the
	option args, to work around sending string literals to `sql'.  Update
	callers.

2009-09-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.c (OPENVASMD_PORT): Change to 9390.

2009-09-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/CMakeLists.txt: Remove "-I .." from all COMPILE_FLAGS.  Add
	libopenvas-config generated flags to OVAS_LDFLAGS and OVAS_CFLAGS.

	* src/CMakeLists.txt (openvasmd): Replace -lopenvas with OPENVAS_LDFLAGS
	in LINK_FLAGS.

2009-08-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/oxpd.c: Quote in cpp error message with double quotes.

2009-08-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c, src/tasks_sql.h, src/otp.c, src/manage.c: Refer to the "NULL"
	task ID with 0 instead of NULL.

2009-08-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* CMakeLists.txt: Set project language.  Add CMP0005 policy check.

2009-08-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (setup_full_config_prefs): Add parameters.
	(init_manage): Add more predefined configs.

2009-08-28  Matthew Mundell <matthew.mundell@greenbone.net>

	Add SCAN_RUN_STATUS to REPORTs, as a reliable way of telling if the
	associated task finished.

	* src/tasks_sql.h (init_manage): Make run_status in tasks an integer.
	Add a scan_run_status field to reports.
	(set_task_run_status): Also set the run_status in the current report.
	(task_first_report_id, task_last_report_id)
	(task_finished_report_count): Use scan_run_status to indicate report
	completion.
	(report_scan_run_status): New function.

	* src/omp.c (send_reports): Add SCAN_RUN_STATUS to REPORT for
	GET_STATUS, so clients can tell which reports completed.
	(omp_xml_handle_end_element): As above, for REPORT in XML GET_REPORT
	response.

	* src/manage.c (run_status_name): New function, body from
	task_run_status_name.
	(task_run_status_name): Call run_status_name.

	* src/manage.h (run_status_name, report_scan_run_status): New headers.
	(task_status_t): Add internal error state, so user can get name of
	internal error.

2009-08-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_result_iterator): Correct SQL.

	* src/tracef.h (ALL_LOG_LEVELS): Use G_LOG_LEVEL_MASK.

2009-08-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/CMakeLists.txt (openvasmd): Remove -lpcap.

2009-08-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_get_targets_0.c: Add MAX_HOSTS checks.

2009-08-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_delete_target_0.c: Correct comment.

2009-08-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd_report_html.xsl: Note error involving preceding.

2009-08-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Make the GET_STATUS progress be attack-only and relative to the maximum
	number of hosts.

	* src/omp.c (omp_xml_handle_end_element): Base the GET_STATUS progress
	entirely on the attack progress, and make the attack progress relative
	to the maximum number of hosts defined by the task target instead of
	to the total number of hosts acknowledged by the scanner.

	* src/otp.c (server_state_t): Add SERVER_STATUS_PROGRESS.
	(process_otp_server_input): Read over portscan STATUS messages, instead
	of saving them the the database.

2009-08-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (max_hosts): New function.
	(omp_xml_handle_end_element): Add a MAX_HOSTS to GET_TARGET which is the
	number of hosts described by the target.

2009-08-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Add a database version check.

	* src/tasks_sql.h (DATABASE_VERSION): New define.  Version 0.
	(init_manage): Check database version.  Ensure version is set.

	* src/omp.c (init_omp): Add version return to doc.

	* src/ompd.c (init_ompd): Add version return to doc.

	* src/openvasmd.c (main): Check init_ompd return for wrong version.

2009-08-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (task_first_report_id, task_finished_report_count): New
	functions.
	(task_last_report_id, task_second_last_report_id): Only consider completed
	reports.
	* src/manage.h: Add headers.

	* src/omp.c (omp_xml_handle_end_element): Use 1 indexing "start" in
	RESULTS in the GET_REPORT response.  Add a FIRST_REPORT to the GET_STATUS
	response.  Include a count of finished reports in the GET_STATUS report
	count.

2009-08-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Add a "max" attribute to
	RESULT in the GET_REPORT xml case.

2009-08-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Add IN_USE element to responses from GET_TARGETS and GET_CONFIGS.

	* src/omp.c (omp_xml_handle_end_element): Add in_use to CLIENT_GET_TARGETS
	and CLIENT_GET_CONFIGS.

	* src/tasks_sql.h (target_in_use, config_in_use): New functions.
	(delete_target, delete_config): Use quoted target/config in SQL.
	* src/manage.h: Add headers.

2009-08-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Make the "first_result" attrib of GET_REPORT index from 1.

	* src/omp.c (omp_xml_handle_start_element): Adjust current_int_1 for 0
	indexing of iterator.

	* src/tests/omp_get_report_8.c: Increment "first_result".

2009-08-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Add "first_result" and "max_start" attributes to GET_REPORTS.

	* src/tasks_sql.h (init_result_iterator): Add first_result and max_results
	args.  Update callers.
	(report_scan_result_count): New function.
	* src/manage.h: Update headers.

	* src/omp.c (current_int_1, current_int_2): New variables.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Setup
	"first_result" and "max_start" for GET_REPORT init_result_iterator.  Add
	a SCAN_RESULT_COUNT to the GET_REPORT REPORT and enclose the results
	in a RESULTS.

	* src/tests/omp_get_report_8.c: New file.

	* src/tests/CMakeLists.txt: Add omp_get_report_8.

2009-08-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Add a COMMANDS OTP command.

	* src/omp.c (help_text): Add COMMANDS.
	(client_state_t): Add states for COMMANDS.
	(SEND_TO_CLIENT_OR_FAIL, SENDF_TO_CLIENT_OR_FAIL): Move up in file.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add COMMANDS
	handling.

	* src/tests/omp_help_0.c (help_text): Add COMMANDS.

	* src/tests/omp_commands_0.c: New file.

	* src/tests/CMakeLists.txt: Add omp_commands_0.

2009-08-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_manage): Ensure that the predefined database
	entries always exists.

2009-08-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (scan_start_time, scan_end_time): Return an empty string
	if the field is NULL, so that the resulting XML entity is empty.

2009-08-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c: Always free the returns from scan_start_time and
	scan_end_time.

2009-08-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Prevent deletion of hidden tasks and reports.

	* src/tasks_sql.h (init_manage): Add hidden field to reports.
	(make_report): Init hidden field.
	(delete_report, delete_task, request_delete_task): Add hidden checks.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_DELETE_REPORT and
	CLIENT_DELETE_TASK respond with syntax error if report/task was hidden.

2009-08-25  Matthew Mundell <matthew.mundell@greenbone.net>

	Setup a predefined example task and report.

	* src/tasks_sql.h (init_manage): Add hidden field to task.  Setup example
	task and report.
	(make_task): Init hidden field.
	(delete_task): Return error if task is hidden.

2009-08-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Add back progress calculation
	lost with tracing.

2009-08-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Add progress tracing to
	CLIENT_GET_STATUS.

2009-08-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/oxpd.c (read_protocol): Check for EINTR from select.

	* src/openvasmd.c (main): Check for EINTR from select.

2009-08-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (accept_and_maybe_fork): Add FORK define, for compiling
	to run in single process.

2009-08-24  Matthew Mundell <matthew.mundell@greenbone.net>

	Cache growing states of selectors in configs.

	* src/tasks_sql.h (init_manage): Add growing state caches to table
	configs.
	(insert_rc_into_config): Cache growing states afterwards.
	(config_iterator_families_growing, config_iterator_nvts_growing)
	(config_nvts_growing, config_families_growing): New functions.
	(nvt_selector_family_count, nvt_selector_nvt_count): Use cached
	growing states.
	(nvt_selector_nvts_growing, nvt_selector_families_growing): Try speed up.
	* src/manage.h: Add headers.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_CONFIGS get
	cached growing state from config.

2009-08-24  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch response for creating an existing config to a user error.

	* src/tasks_sql.h (create_config): Return -1 if config exists.
	(create_target): Match return to create_config.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_CONFIG handle
	"config exists" return.

2009-08-24  Matthew Mundell <matthew.mundell@greenbone.net>

	Speed up creating a config and getting configs.

	* src/tasks_sql.h (init_manage): Add count caches to configs table.
	(insert_rc_into_config): Pre-allocate the arrays.  Cache the family and
	NVT counts in the database.
	(nvt_cache_present, nvt_family, nvt_selector_families_growing)
	(nvt_selector_nvts_growing): Limit the SQL to one result.
	(nvt_selector_family_count, nvt_selector_nvt_count): Use cached count.
	* src/manage.h: Update headers.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_CONFIGS pass
	config name to NVT count functions.

2009-08-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (nvt_selector_family_count)
	(nvt_selector_nvt_count): Count static nvts and families in SQL instead of
	counting through the result of the SQL.

2009-08-21  Matthew Mundell <matthew.mundell@greenbone.net>

	Prevent deletion of a config/target if a task refers to the config/target.

	* src/tasks_sql.h (delete_config, delete_target): Fail if a task refers
	to the config/target.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_DELETE_CONFIG and
	CLIENT_DELETE_TARGET handle new delete_config/delete_target fail return.

	* src/tests/common.c (omp_create_task): New function.
	* src/tests/common.h: Add header.

	* src/tests/omp_delete_config_1.c, src/tests/omp_delete_target_1.c: New
	files.

	* src/tests/CMakeLists.txt: Add omp_delete_config_1 and
	omp_delete_target_1.

2009-08-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (nvt_cache_present): Correct column name in SQL.
	(nvt_selector_family_count): Add real family count for the All selector.

2009-08-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_start_task_4.c: New file.  Tests starting a task when
	another task is already running on the same connection.

	* src/tests/CMakeLists.txt: Add omp_start_task_4.

2009-08-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (start_task): Fail if a task is already running.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_START_TASK add a
	response for the above failure and extend the start_task return
	checking.

2009-08-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (stop_task): Only stop the current task if it's the
	given task.

2009-08-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/README: Convert tabs to spaces.

	* src/tests/common.c, src/omp.c, src/manage.c: Add missing docs.

	* src/oxpd.c: Add missing docs.  Add splint guard around #error.

2009-08-21  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* VERSION: Set to 0.7.1.SVN.

	* CMakeLists.txt: CPACK_PACKAGE_VERSION_PATCH updated.

2009-08-21  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 0.7.0 relase.

	* VERSION: Set to 0.7.0.

	* CMakeLists.txt: CPACK_PACKAGE_VERSION_PATCH updated.

	* CHANGES: Updated.

	* packaging/debian/control: Updated dependencies.

2009-08-21  Matthew Mundell <matthew.mundell@greenbone.net>

	When processing the server input perform any task stop requests received
	in other processes.

	* src/omp.c (process_omp_client_input): Add note about writing whole
	commands to to_server.

	* src/manage.c (manage_check_current_task): New function.
	* src/manage.h (manage_check_current_task): New header.

	* src/otp.c (process_otp_server_input): Call manage_check_current_task
	initially.

2009-08-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (set_scan_attack_state): Remove duplicate argument.

	* src/manage.h (host_iterator_attack_state): New header.

	* src/otp.c (process_otp_server_input): In SERVER_STATUS_ATTACK_STATE add
	check that there is a current report.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_STATUS send the
	portscan progress as first 50% and test progress as second 50%.

2009-08-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/logf.h (logf): Turn off comm logging and log error if fflush fails,
	instead of aborting.

2009-08-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (task_run_status_name): Capitalise all words of run
	statuses.

	* src/tests/omp_delete_task_2.c, src/tests/omp_delete_task_0.c: Match
	new run statuses.

2009-08-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (make_result): Quote description for SQL.

2009-08-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (main): Shorten --foreground description.

	* README: Describe the cache updating option.  Update the usage message.

	* INSTALL: Increase library version.

2009-08-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_nvt_iterator): Add NVT arg.
	* src/manage.h (init_nvt_iterator): Add NVT arg.

	* src/manage.c (nvt_selector_plugins): Pass NVT to init_nvt_iterator.

	* src/omp.c (omp_xml_handle_end_element): Pass NVT to init_nvt_iterator.

2009-08-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (convert_to_newlines): New function.
	(omp_xml_handle_end_element): In CLIENT_GET_REPORT convert \n's in the
	XML result decriptions to real newlines.

2009-08-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (report_task): New function.
	* src/manage.h (report_task): New header.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_REPORT add report
	ID and task with ID and name to the XML report.

2009-08-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otp.c (process_otp_server_input): In SERVER_TIME_SCAN_START only
	set task properties if the task is in the requested state, as the task
	may also be in "stop requested" or "delete requested" states.

2009-08-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ovas-mngr-comm.c (connect_to_server): Get error message from
	getsockopt return instead of errno.

2009-08-20  Matthew Mundell <matthew.mundell@greenbone.net>

	Add a permanent NVT cache.

	* src/tasks_sql.h (sql_quote): Rename to sql_nquote.  Update callers.
	(sql_nquote, sql_quote, manage_has_nvts, nvts_size, nvts_md5sum)
	(set_nvts_md5sum, find_nvt, make_nvt_from_nvti)
	(init_nvt_iterator, nvt_iterator_oid, nvt_iterator_version)
	(nvt_iterator_name, nvt_iterator_summary, nvt_iterator_description)
	(nvt_iterator_copyright, nvt_iterator_cve, nvt_iterator_bid)
	(nvt_iterator_xref, nvt_iterator_tag, nvt_iterator_sign_key_ids)
	(nvt_iterator_category, nvt_iterator_family): New functions.
	(init_manage_process): Add clearing of NVT cache, controlled by param.
	(init_manage): Add meta and nvts tables.
	(nvt_family, nvt_selector_family_count, nvt_selector_nvt_count): Adjust
	for new NVT cache.

	* src/manage.h: Add new interfaces defined in tasks_sql.h.
	(server_t): Remove plugins.
	(nvt_t): New type.

	* src/manage.c (nvt_selector_plugins): Always return a list of all the
	plugins.
	(start_task): Expect all plugins as a list from nvt_selector_plugins.

	* src/omp.c (send_plugin): Switch to nvt iterator, rename send_nvt.
	(send_nvt): New function.
	(omp_xml_handle_end_element): In CLIENT_GET_NVT_ALL,
	CLIENT_GET_NVT_FEED_CHECKSUM and CLIENT_GET_NVT_DETAILS switch to new
	cache interface.
	(init_omp_process): Pass an update_nvt_cache flag through to
	init_manage_process.

	* src/otp.c (current_plugins): Remove.
	(init_otp_data): Remove server.plugins init.
	(parse_server_plugin_list_tags): Add nvti to database instead of to
	server.plugins.
	(process_otp_server_input): Remove current_plugins and server.plugins
	handling.  On receiving the final plugin from a plugin list, set the
	md5sum and return as though the server sent BYE.

	* src/ompd.c (ompd_nvt_cache_mode): New variable.
	(write_to_server): In "cache mode" request the plugin list, otherwise fall
	through to the "GO ON".
	(serve_omp): If the client_socket is -1 initiate "cache mode" and only do
	the server part of the service.

	* src/openvasmd.c (main): Add an update program option that causes the
	manager to run as a single process that simply calls serve_omp in "cache
	mode" to update the NVT cache.

	* src/logf.h (logf): Only log if log_stream is set.

2009-08-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (setup_full_config_prefs): New function.
	(init_manage): Setup SERVER_PREFS of Full config.

2009-08-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (send_config_preferences): Send newline after preference.
	(start_task): Check nvt_selector_plugins return for NULL.

2009-08-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_get_configs_3.c: Match config name to test.

2009-08-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h, src/omp.c, src/otp.c: Replace strncmp and
	strncasecmp with strcmp and strcasecmp in comparisons involving NULL
	terminated strings.

2009-08-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_start_task_3.c: New file.  Tests START_TASK with a task
	created with a target and a config.

	* src/tests/CMakeLists.txt: Add omp_start_task_3.

2009-08-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_modify_task_0.c, src/tests/omp_modify_task_1.c: Use a
	real RC so that CREATE_TASK succeeds.

2009-08-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_start_task_3.c: Remove, replaced by omp_create_task_0.
	* src/tests/omp_start_task_4.c: Remove, CREATE_TASK now prevents creation
	of such a task.

	* src/tests/CMakeLists.txt: Remove omp_start_task_3 and omp_start_task_4.

2009-08-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.c (wait_for_task_stop): Make the Done return the
	same as Stopped.  Add return -2, in case the task has been deleted.

	* src/tests/omp_abort_task_0.c: Only fail if wait_for_task_stop returns
	-1, as the server may do the pending removal during the wait.

2009-08-18  Matthew Mundell <matthew.mundell@greenbone.net>

	Address errors in last commit.

	* src/tasks_sql.h (set_task_target, set_task_config): New functions.
	(init_preference_iterator): Correct column name in SQL.
	* src/manage.h: Update headers.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_TASK set the
	task target and config when creating from an rcfile.

2009-08-18  Matthew Mundell <matthew.mundell@greenbone.net>

	Add targets and configs to CREATE_TASK.

	* src/ovas-mngr-comm.c (sendn_to_server, send_to_server): Make params
	const.
	* src/ovas-mngr-comm.h: Update headers.

	* src/tasks_sql.h (init_manage): Add config and target to tasks table.
	Setup a "Localhost" target.
	(task_config, task_target, target_hosts, append_to_task_config)
	(append_to_task_target, init_preference_iterator)
	(preference_iterator_name, preference_iterator_value)
	(config_nvt_selector): New functions
	(create_target, create_config): Add tracing to error cases.  Handle NULL
	comment.
	(insert_rc_into_config): Add tracing to error cases.
	(nvt_selector_nvt_count): Only check server.plugins for the growing case.

	* src/manage.c (task_preference): Remove.  Body moved to rc_preference.
	(task_plugins, send_task_preferences, send_task_rules): Remove.
	(rc_preference, nvt_selector_plugins, send_config_preferences)
	(send_config_rules): New functions.
	(start_task): Rework to send target, plugins, preferences and rules from
	the task's config and target.

	* src/manage.h: Update headers.

	* src/omp.c (client_state_t): Add new states.
	(omp_xml_handle_start_element, omp_xml_handle_text)
	(omp_xml_handle_end_element): Handle targets and configs in CREATE_TASK.

	* src/tests/omp_create_task_0.c, src/tests/omp_create_task_1.c: Adjust
	expected value.

	* src/tests/omp_create_task_2.c, src/tests/omp_create_task_3.c,
	src/tests/omp_create_task_4.c: New files.

	* src/tests/CMakeLists.txt: Add omp_create_task_2, omp_create_task_3
	and omp_create_task_4.

	* doc/db_postgres.sql (configs): Remove id field, to match manager.
	(tasks): Add target field.  Refer config to name in configs.

2009-08-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_create_target_0.c, src/tests/omp_create_target_1.c,
	src/tests/omp_get_targets_0.c, src/tests/omp_delete_target_0.c,
	ChangeLog: Switch to full email address.

2009-08-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otp.c (rmdir_recursively): Close pwd after use.

2009-08-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otp.c (parse_server_certificate_public_key): Add missing semicolon.

2009-08-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.c (connect_to_manager): Pass environment variables
	OPENVAS_TEST_HOST and OPENVAS_TEST_PORT as host and port if set.

2009-08-17  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/otp.c (parse_server_plugin_list_tags):
	Duplicate string only if needed, closed memleak, free gchar with g_free.
	Memleak found by cppcheck.

2009-08-17  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/otp.c (parse_server_certificate_public_key):
	Duplicate string only if needed, closed memleak, free gchar with g_free.
	Memleak found by cppcheck.

	* ChangeLog:
	Minor reformatting.

2009-08-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_modify_task_0.c, src/tests/omp_get_nvt_feed_checksum_1.c,
	src/tests/omp_get_nvt_details_4.c,
	src/tests/omp_get_nvt_feed_checksum_5.c, src/tests/omp_get_status_0.c,
	src/tests/omp_get_status_2.c, src/tests/omp_get_nvt_all_1.c,
	src/tests/omp_get_rules_1.c,
	src/tests/omp_get_nvt_details_1.c,
	src/tests/omp_get_nvt_feed_checksum_4.c, src/tests/omp_get_status_1.c,
	src/tests/omp_get_dependencies_1.c, src/tests/omp_abort_task_0.c: Either
	enable or remove the arbitrary mid-session re-authentications.

2009-08-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (cleanup): Add "Exiting" message.

2009-08-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (authenticate): Quote username for INSERT.

	* src/tests/omp_authenticate_0.c: New file.  Test with quote in name.

	* src/tests/CMakeLists.txt: Add omp_authenticate_0.

2009-08-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (authenticate): SELECT then INSERT instead of using
	"INSERT OR REPLACE", so that the ROWID stays the same.

2009-08-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_get_certificates_1.c: Expect the status in an attribute.

2009-08-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_get_nvt_feed_checksum_5.c: Correct expected status.

2009-08-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_get_preferences_1.c: Check response parts instead of
	comparing to an expected entity.

2009-08-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/read_protocol_0.c: Correct typo in heading.

2009-08-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_get_status_5.c: Add status_text and progress to
	expectations.

	* src/tests/omp_create_target_0.c, src/tests/omp_create_target_1.c,
	src/tests/omp_delete_target_0.c: Add status_text to expectations. Remove
	the target before starting.

	* src/tests/omp_get_dependencies_0.c: Add status_text to expectations.
	Correct return code.

	* src/tests/omp_start_task_0.c: Add status_text to expectations.  Remove
	second authentication.

	* src/tests/omp_abort_task_0.c, src/tests/omp_bogus_0.c,
	src/tests/omp_bogus_1.c, src/tests/omp_create_task_0.c,
	src/tests/omp_create_task_1.c, src/tests/omp_delete_report_0.c,
	src/tests/omp_delete_report_1.c, src/tests/omp_delete_task_0.c,
	src/tests/omp_delete_task_1.c, src/tests/omp_get_certificates_0.c,
	src/tests/omp_get_nvt_all_0.c, src/tests/omp_get_nvt_details_0.c,
	src/tests/omp_get_nvt_details_2.c, src/tests/omp_get_nvt_details_3.c,
	src/tests/omp_get_nvt_feed_checksum_0.c,
	src/tests/omp_get_nvt_feed_checksum_2.c,
	src/tests/omp_get_nvt_feed_checksum_3.c,
	src/tests/omp_get_preferences_0.c, src/tests/omp_get_report_1.c,
	src/tests/omp_get_report_2.c, src/tests/omp_get_report_3.c,
	src/tests/omp_get_rules_0.c, src/tests/omp_get_rules_1.c,
	src/tests/omp_get_version_0.c, src/tests/omp_help_0.c,
	src/tests/omp_help_1.c, src/tests/omp_modify_report_0.c,
	src/tests/omp_modify_task_0.c, src/tests/omp_modify_task_1.c,
	src/tests/omp_start_task_3.c, src/tests/omp_start_task_4.c: Add
	status_text to expectations.

2009-08-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (STATUS_INTERNAL_ERROR_TEXT): Make case more consistent.
	(omp_xml_handle_end_element): Remove status_text fullstop in
	CLIENT_GET_NVT_FEED_CHECKSUM.  In CLIENT_CREATE_TARGET improve "name and
	hosts" status_text and convert the create_target response to a syntax
	error.  In CLIENT_START_TASK manually send the response, as
	send_find_error_to_client adds quotation marks.

2009-08-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ompd.c (write_to_server): In SERVER_INIT_GOT_PLUGINS also request
	certificates.

2009-08-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_NVT_DETAILS
	free current_uuid.

2009-08-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Add more specific status_text attributes for "resource missing" (404)
	errors.

	* src/manage.c (start_task): Return -3 if create_report fails.

	* src/omp.c (send_find_error_to_client): New function.
	(omp_xml_handle_end_element): Use send_find_error_to_client for resource
	missing errors.  Convert CLIENT_GET_NVT_FEED_CHECKSUM algorithm error
	to syntax error.  Convert report generation and missing XSL file errors
	to internal errors.  Handle new start_task error.

2009-08-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_STATUS rename
	the per host PROGRESS element to HOST_PROGRESS.

2009-08-14  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* src/openvasmd_log_conf.cmake,
	src/openvasmd_cong_conf.cmake_in:
	Renamed file to not create confusion, as its not a file generated by
	cmake.

	* CMakeLists.txt:
	Reverted exclude list, as filename of the critical file was changed.

	* src/CMakeLists.txt:
	Updated reference to changed filename.

2009-08-14  Felix Wolfsteller <felix.wolfsteller@greenbone.net>

	* CMakeLists.txt:
	Increased Project version number.
	Changed the CPACK_SOURCE_IGNORE_FILES with the aim to not exclude
	openvasmd_log_conf.cmake (pre-commit *cmake was excluded) when building
	a (release) tar-ball.

2009-08-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_manage): Make name in table users UNIQUE.
	(authenticate): Always fail for user "om".  On success ensure that the
	username is in the users table.

2009-08-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Adjust OMP behaviour to always respond to the authentication XML.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_AUTHENTICATE add
	responses to the success cases.

	* src/tests/common.c (authenticate): Read and check response.

2009-08-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tracef.h (tracef): Add format string to g_log call.

2009-08-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Add generic description of status code to each response.  For "syntax
	error" (400) add a specific description for each type of error, instead of
	a generic description.

	* src/omp.c (STATUS_ERROR_MUST_AUTH_TEXT, STATUS_ERROR_MISSING_TEXT)
	(STATUS_ERROR_AUTH_FAILED_TEXT, STATUS_OK_TEXT, STATUS_OK_CREATED_TEXT)
	(STATUS_OK_REQUESTED_TEXT, STATUS_INTERNAL_ERROR_TEXT)
	(STATUS_SERVICE_DOWN_TEXT): New defines.
	(send_element_error_to_client): New function.
	(XML_ERROR_SYNTAX): Add text param for status_text.  Pass in all callers.
	(XML_ERROR_MISSING, XML_ERROR_AUTH_FAILED, XML_OK, XML_OK_CREATED)
	(XML_OK_REQUESTED, XML_INTERNAL_ERROR, XML_SERVICE_DOWN): Add static
	status_text attribute.
	(omp_xml_handle_end_element): In CLIENT_MODIFY_TASK almost always
	respond with internal error when set_task_parameter fails.

	* src/tasks_sql.h (set_task_parameter): Cleanup doc.

2009-08-12  Matthew Mundell <matthew.mundell@greenbone.net>

	Add comments to configs.

	* src/tasks_sql.h (init_manage): Add comment column to targets configs.
	Init comment in "Full" config.
	(create_config): Add comment param.
	(config_iterator_comment): New function.
	* src/manage.h: Update headers.

	* src/omp.c (client_state_t): Add comment state.
	(omp_xml_handle_start_element, omp_xml_handle_text)
	(omp_xml_handle_end_element): Handle config comments.

	* src/tests/common.c (omp_create_config, omp_create_config_from_rc_file):
	Add comment param.
	* src/tests/common.h: Update headers.

	* src/tests/omp_create_config_0.c, src/tests/omp_create_config_1.c,
	src/tests/omp_get_configs_0.c, src/tests/omp_get_configs_1.c,
	src/tests/omp_get_configs_2.c, src/tests/omp_get_configs_3.c,
	src/tests/omp_delete_config_0.c: Add comments and comment checks.

2009-08-12  Matthew Mundell <matthew.mundell@greenbone.net>

	Add comments to targets.

	* src/tasks_sql.h (init_manage): Add comment column to targets table.
	(create_target): Add comment param.
	(target_iterator_comment): New function.
	* src/manage.h: Update headers.

	* src/omp.c (client_state_t): Add comment state.
	(omp_xml_handle_start_element, omp_xml_handle_text)
	(omp_xml_handle_end_element): Handle target comments.

	* src/tests/common.c (omp_create_target): Add comment param.
	* src/tests/common.h: Update header.

	* src/tests/omp_get_targets_0.c: Add comment to first target.

2009-08-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/new_task_small_rc: Add 1.3.6.1.4.1.25623.1.0.10330 to
	scanner set.  Add a second host.  Set port_range to default.

2009-08-12  Matthew Mundell <matthew.mundell@greenbone.net>

	Add real OMP GET_CONFIGS family counts for static selectors.

	* src/tasks_sql.h (NVT_SELECTOR_TYPE_ALL, NVT_SELECTOR_TYPE_FAMILY)
	(NVT_SELECTOR_TYPE_NVT): New defines.  Use instead of numbers in
	callers.
	(nvt_selector_iterator_nvt, nvt_family): New functions.
	(nvt_selector_family_count): Add counting for static selector.

	* src/tests/omp_get_configs_3.c: Add family count check.

2009-08-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (latex_severity_colour): Add "Debug Message" and "Log
	Message".  Return "{openvas_text}" on fail.
	(latex_header): Add colours openvas_text, openvas_debug and
	openvas_log.

2009-08-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (insert_rc_into_config): Leave trailing paren off
	section name.

2009-08-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* README: Cleanup and elaborate sample test invocation.

	* INSTALL: Add sqlfairy dependency.  Try improve the configure
	description.

2009-08-12  Laban Mwangi <lmwangi@penguinlabs.co.ke>

	* README: Added a sample invocation for tests
	* INSTALL: Instructions for custom prefix openvas installs

2009-08-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (delete_report): Remove transaction, as
	delete_reports calls delete_report inside an iterator.

2009-08-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Add real OMP GET_CONFIGS count figures for static selectors.

	* src/tasks_sql.h (init_nvt_selector_iterator)
	(nvt_selector_iterator_include): New functions.
	(nvt_selector_nvt_count): Add static selector counting.

	* src/tests/CMakeLists.txt: Add omp_get_configs_3.

	* src/tests/omp_get_configs_3.c: New file.

2009-08-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/tasks_sql.h (delete_report, create_target, delete_config):
	Wrap SQL statements in transactions.

2009-08-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_get_configs_0.c,
	src/tests/omp_get_configs_1.c: Add checks of growing values.

2009-08-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_start_task_3.c: Correct expected status.

2009-08-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (start_task): Add trace to fail case.

2009-08-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Convert GET_CONFIGS RC NVTs to an NVT selector.

	* src/tasks_sql.h (config_preference, clude): New functions.
	(insert_rc_into_config): Buffer NVT ids in array and convert to selector
	before returning.
	(create_config): Drop const restriction on param rc.  Wrap the database
	calls in a transaction.
	* src/manage.h: Update header.

2009-08-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tracef.h (tracef): Convert the message to UTF-8 before logging.

2009-08-10  Matthew Mundell <matthew.mundell@greenbone.net>

	Add real OMP GET_CONFIGS count figures for the all selector case.

	* src/tasks_sql.h (nvt_selector_families_growing)
	(nvt_selector_nvts_growing): Add docs.
	(nvt_selector_family_count, nvt_selector_nvt_count): New functions.

	* src/manage.c (server_t): Move here from otp.c.
	* src/otp.c (server): Move to manage.c.
	* src/otp.h (server_t, server): Move to manage.h.

	* src/manage.h (nvt_selector_family_count, nvt_selector_nvt_count)
	(server_t, server): New headers.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_CONFIGS add
	some real count figures.

	* src/tests/CMakeLists.txt: Add omp_get_configs_2.
	(make_report_uuid_0): Pass OpenVAS headers to compiler.

	* src/tests/omp_get_configs_2.c: New file.

2009-08-10  Matthew Mundell <matthew.mundell@greenbone.net>

	Add real OMP GET_CONFIGS growing figures.

	* src/tasks_sql.h (init_manage): Note selector types.
	(nvt_selector_families_growing, nvt_selector_nvts_growing): New functions.
	* src/manage.h: Add headers.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_CONFIGS add
	real growing figures.

2009-08-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_get_targets_0.c: Compare strcmps to 0.  Correct return.

2009-08-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (task_plugins, send_task_preferences)
	(send_task_rules): Only consider "begin(..." lines that are newline
	terminated.

2009-08-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (insert_rc_into_config): Include the scanners in the
	nvt selector list.  Remove quotes from an SQL integer value.

2009-08-07  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP CREATE_CONFIG, DELETE_CONFIG and GET_CONFIGS commands.

	* doc/db_postgres.sql (config_preferences, configs): New tables.
	(tasks): Replace nvt_selector and rcfile field with config field.
	(nvt_selectors): Remove rowid and id.  Rename details family_or_nvt.

	* src/tasks_sql.h (config_t): New type.
	(init_manage): Add nvt_selectors, configs and config_preferences tables.
	Setup predefined selectors and configs.
	(init_table_iterator): Add table arg.
	(init_target_iterator): Pass table name to init_target_iterator.
	(insert_rc_into_config, create_config, delete_config)
	(init_config_iterator, config_iterator_name)
	(config_iterator_nvt_selector): New functions.
	* src/manage.h: Update headers.

	* src/omp.c (help_text): Add config commands.
	(client_state_t): Add config states.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add config command handling.

	* src/common.c (first_entity): Add NULL guard.
	(create_config, omp_create_config_from_rc_file, omp_delete_config): New
	functions.
	* src/common.h: Update headers.

	* src/tests/omp_create_config_0.c, src/tests/omp_create_config_1.c,
	src/tests/omp_delete_config_0.c, src/tests/omp_get_configs_0.c,
	src/tests/omp_get_configs_1.c: New files.

	* src/tests/CMakeLists.txt: Add omp_create_config_0, omp_create_config_1,
	omp_delete_config_0, omp_get_configs_0 and omp_get_configs_1.

	* src/tests/omp_help_0.c: Add config commands to expected help text.

2009-08-06  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP CREATE_TARGET, DELETE_TARGET and GET_TARGETS.

	* doc/db_postgres.sql: Add targets table.

	* src/tasks_sql (init_manage): Add targets table.
	(DEF_ACCESS): Take the full name of the function.  Update callers.
	(create_target, delete_target, init_table_iterator, init_target_iterator)
	(target_iterator_name, target_iterator_hosts): New functions.
	* src/manage.h: Update headers.

	* src/omp.c (help_text): Add target commands.
	(client_state_t): Add target states.
	(XML_OK_CREATED): New macro.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add target command handling.

	* src/common.c (first_entity): Add NULL guard.
	(omp_create_target, omp_delete_target): New functions.
	* src/common.h: Update headers.

	* src/tests/omp_create_target_0.c, src/tests/omp_create_target_1.c,
	src/tests/omp_delete_target_0.c, src/tests/omp_get_targets_0.c: New files.

	* src/tests/CMakeLists.txt: Add omp_create_target_0, omp_create_target_1,
	omp_delete_target_0 and omp_get_targets_0.

	* src/tests/omp_help_0.c: Add target commands to expected help text.

2009-08-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_get_report_5.c: Match task name to test.

2009-08-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.c (next_entities): Add NULL guard.

2009-08-05  Matthew Mundell <matthew.mundell@greenbone.net>

	Extend PROGRESS in GET_STATUS to include per-host progress percentages.

	* src/tasks_sql.h (init_manage): Move attack_state, current_port and
	max_port from tasks table to report_hosts table
	(task_running_report, host_iterator_attack_state)
	(host_iterator_current_port, host_iterator_max_port)
	(set_scan_attack_state, set_scan_ports): New functions.
	(task_attack_state, set_task_attack_state, task_current_port)
	(task_max_port, set_task_ports): Remove.
	(reset_task): Remove moved fields from SQL.
	* src/manage.h: Update headers.

	* src/otp.c (process_otp_server_input): In SERVER_STATUS_ATTACK_STATE set
	the attack state of the host scan instead of the task.  In
	SERVER_STATUS_HOST set current_host.  In SERVER_STATUS_PORTS set scan
	ports instead of task ports.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_STATUS add
	per-host progresses to PROGRESS.

2009-07-31  Matthew Mundell <matthew.mundell@greenbone.net>

	Improve the LaTeX PDF report.

	* src/tasks_sql.h (report_holes, report_notes, report_warnings): New
	functions.
	(init_result_iterator): Add a host argument to limit the results to a
	particular host.  Update callers.
	* src/manage.h: Update headers.

	* src/omp.c (latex_escape_text): Replace body with working implementation.
	(latex_severity_heading, latex_severity_colour): New functions.
	(latex_header): Define colours.  Refine settings.  Add title.
	(latex_footer): Center.  Add spacing.
	(print_report_latex): Move summary to abstract.  Use defined colours.
	Add totals.  Fill in the "Most Severe Result(s)" column.  Use sections
	with numbering.  Improve links.  Init result iterator with host.
	Add the "[ return to host ]" link.  Colour issue headings according to
	severity.
	(omp_xml_handle_end_element): In CLIENT_GET_REPORT remove "xml" from latex
	file name and run pdflatex twice to ensure that references are correct.

2009-07-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (latex_escape_text, print_report_latex): New functions.
	(latex_header, latex_footer): New variables.
	(omp_xml_handle_end_element): Add a second rough PDF generator to
	CLIENT_GET_REPORTS.  This one produces the PDF via LaTeX instead of via
	HTML via XSL via XML.

2009-07-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd_report_html.xsl: Lay the report out more like the
	client PDF report.

2009-07-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/common.c (read_entity_and_text): New function.  Body from
	read_entity.
	(read_entity): Replace body with call to read_entity_and_text.
	* src/common.h (read_entity_and_text): New header.

2009-07-28  Matthew Mundell <matthew.mundell@greenbone.net>

	Add rough initial HTML and PDF report generation.

	* src/omp.c (print_report_xml): New function.
	(omp_xml_handle_end_element): Add HTML and PDF format handling to
	GET_REPORTS.

	* src/openvasmd_report_html.xsl: New file.  Stylesheet for HTML report.

	* src/CMakeLists.txt: Install openvasmd_report_html.xsl.

	* src/tests/omp_get_report_6.c, src/tests/omp_get_report_7.c: New files.

	* src/tests/CMakeLists.txt: Add omp_get_report_6 and omp_get_report_7.

2009-07-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd_log_conf.cmake: Remove quotes from "prepend" key.

2009-07-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_get_report_0.c, src/tests/omp_get_report_1.c,
	src/tests/omp_delete_report_0.c, src/tests/omp_get_report_4.c,
	src/tests/omp_delete_task_1.c, src/tests/omp_get_report_2.c,
	src/tests/omp_get_report_3.c: Add format to GET_REPORT XML.

2009-07-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (task_run_status_name): Add TASK_STATUS_STOPPED.

	* src/tests/common.c (wait_for_task_stop): New function.
	(wait_for_task_end): Also check for "Stopped".
	* src/tests/common.h (wait_for_task_stop): New header.

	* src/tests/omp_abort_task_0.c: Wait for the task to stop after reading
	the ABORT_TASK response.

2009-07-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.c (omp_get_report): Add format to GET_REPORT XML.

2009-07-24  Matthew Mundell <matthew.mundell@greenbone.net>

	Add handling of the GET_REPORT FORMAT attribute.  Add a simple XML format.

	* src/omp.c (current_format): New variable.
	(omp_xml_handle_start_element): Handle GET_REPORT FORMAT attribute.
	(SENDF_TO_CLIENT_OR_FAIL): Send with g_markup_printf_escaped.
	(omp_xml_handle_end_element): In CLIENT_GET_REPORT check which format was
	requested.  Add a simple initial XML format.

	* src/tests/CMakeLists.txt: Add omp_get_report_5.

	* src/tests/omp_get_report_5.c: New file.  Tests requesting an XML report.

2009-07-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.h (new_report): Rename to current_report.
	(current_report): New variable, was new_report.

	* src/tasks_sql.h, src/otp.c, src/manage.c: Rename new_report to
	current_report.

2009-07-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otp.c (process_otp_server_input): In SERVER_TIME_SCAN_END always
	clear current_server_task when current_server_task is set.

2009-07-24  Matthew Mundell <matthew.mundell@greenbone.net>

	Add a SECOND_LAST_REPORT element to the GET_STATUS response.

	* src/tasks_sql.h (task_second_last_report_id): New function.

	* src/manage.h (task_second_last_report_id): New header.

	* src/omp.c (omp_xml_handle_end_element): Add SECOND_LAST_REPORT in
	CLIENT_GET_STATUS.

2009-07-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/proto_postgres.sql: Use date types for dates.
	(results): Add subnet and nvt fields.
	(reports): Add date field.

2009-07-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Match the db model better to the state of the manager.

	* doc/db_postgres.sql (nvt_selectors, results, report_hosts)
	(report_results): New tables.
	(tasks): Add reference to nvt_selector.
	(reports): Add date, start_time, end_time.

2009-07-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Store the reports in the database instead of on the file system.

	* src/manage.c (create_task_report, delete_task_report)
	(report_path_task_uuid, report_task, current_report, current_report_name)
	(create_report_file): Remove.
	(task_last_report_id, report_counts, report_timestamp, delete_report)
	(set_report_parameter): Remove, to manage.c.
	(delete_reports): Drop file system handling.  Use iterator to delete
	reports.
	(start_task): Call create_report instead of create_report_file.

	* src/manage.h: Update headers.
	(result_t, report_t, iterator_t): New types.

	* src/tasks_sql.h (sql_string): Return NULL on error.
	(init_manage): Create results, report_hosts and report_results tables.
	Remove some caching fields from tasks table.  Add date, start_time and
	end_time to reports table.
	(task_last_report_id, report_counts, report_timestamp, delete_report): New
	functions, from manage.c.  Convert to db equivalents.
	(cleanup_iterator, next, make_result, make_report, create_report)
	(report_uuid, report_add_result, init_report_iterator, next_report)
	(init_result_iterator, result_iterator_subnet, result_iterator_host)
	(result_iterator_port, result_iterator_nvt, result_iterator_type)
	(result_iterator_descr, init_host_iterator, host_iterator_host)
	(host_iterator_start_time, host_iterator_end_time, scan_start_time)
	(set_scan_start_time, scan_end_time, set_scan_end_time)
	(set_scan_host_end_time, set_scan_host_start_time, find_report): New
	functions.
	(create_task_report, delete_task_report, inc_task_debugs_size)
	(inc_task_holes_size, inc_task_infos_size, inc_task_logs_size)
	(inc_task_notes_size, inc_task_report_count)
	(dec_task_report_count): Remove.
	(task_report_count, task_debugs_size, task_holes_size, task_infos_size)
	(task_logs_size, task_notes_size): Use SQL "count" instead of a cache
	field.
	(delete_task): Remove file deleting.  Also delete from results table.
	(reset_task): Remove cache fields.

	* src/omp.c (send_reports): Loop with report iterator.
	(omp_xml_handle_end_element): Adjust CLIENT_DELETE_REPORT for new
	delete_report interface.  Rework CLIENT_GET_REPORT to reduce indentation,
	building the nbe from the results table.  Adjust CLIENT_MODIFY_REPORT for
	new set_report_parameter interface.  In CLIENT_GET_STATUS pass task to
	task_last_report_id instead of passing uuid, free timestamp and add
	missing cleanup_task_iterator calls.

	* src/otp.c (write_message): Call make_result instead of writing to
	stream.
	(write_timestamp, save_report, append_timestamp): Remove.
	(append_debug_message, append_hole_message, append_info_message)
	(append_log_message, append_note_message):  Drop current report checks and
	cache incrementing.
	(process_otp_server_input): Replace append_timestamp calls with calls to
	libmanage scan time setters.  In TASK_STATUS_DELETE_REQUESTED and
	SERVER_TIME_SCAN_END remove report file handling and initialise
	new_report.

	* src/tests/CMakeLists.txt: Remove report_path_task_uuid_0,
	report_path_task_uuid_1 and report_path_task_uuid_2.

	* src/tests/report_path_task_uuid_0.c,
	src/tests/report_path_task_uuid_1.c,
	src/tests/report_path_task_uuid_2.c: Remove.

2009-07-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/string.c (isbase64): New function.
	* src/string.h (isbase64): New header.

	* src/tests/omp_get_report_0.c: Check that the report is all base64
	characters instead of all alphanumeric characters.

2009-07-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_fs.h: Remove.

2009-07-22  Matthew Mundell <matthew.mundell@greenbone.net>

	Retire file system based task storage (-DTASKS_FS).

	* doc/Doxyfile, doc/Doxyfile_full (INPUT): Remove tasks_fs.h

	* doc/CMakeLists.txt (DOC_FILES): Remove tasks_fs.h.

	* src/manage.h: Remove TASKS_FS alternative.

	* src/manage.c: Remove tasks_fs.h include.

	* src/tests/CMakeLists.txt: Add -DTASKS_SQL to definitions.

	* src/openvasmd.c (\mainpage): Remove tasks_fs.h reference.

	* src/CMakeLists.txt: Remove TASKS_FS comments.
	(C_FILES): Remove tasks_fs.h.

2009-07-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/proto_postgres.sql (meta): Type nvts_md5sum.

2009-07-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/proto_postgres.sql: New file.  Broad database prototype.

2009-07-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (main): Set log handlers for comm and otp domains.

2009-07-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd_log_conf.cmake: Add comm section.

2009-07-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (G_LOG_DOMAIN): Correct name.

2009-07-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c, src/otp.c, src/otpd.c, src/oxpd.c: Remove stray full stops
	from log messages.

2009-07-20  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch to GLib facilities for all remaining logging.

	* src/openvasmd_log_conf.cmake: Rename domains.  Add domains for libs.
	Add time formats.

	* src/tracef.h (G_LOG_DOMAIN, ALL_LOG_LEVELS): New defs.
	(tracef): Pass G_LOG_DOMAIN as g_log domain.

	* src/openvasmd.c: Convert perrors and printfs to glib calls.
	(main): Set log handlers.

	* src/ompd.c: Convert perrors and printfs to glib calls.
	(init_ompd): Pass log config through to init_omp.
	* src/ompd.h: Update header.

	* src/otpd.c, src/oxpd.c: Convert perrors and printfs to glib calls.

	* src/omp.c: Convert printfs to glib calls.
	(G_LOG_DOMAIN): New def.
	(init_omp): Pass log config through to init_manage.  Set log handler.
	* src/omp.h: Update header.

	* src/ovas-mngr-comm.c, src/otp.c: Convert perrors and printfs to glib calls.
	(G_LOG_DOMAIN): New def.

	* src/string.c (G_LOG_DOMAIN): New def.

	* src/file.c (G_LOG_DOMAIN): Update.

	* src/manage.c: Convert printfs to glib calls.
	(G_LOG_DOMAIN): New def.
	* src/manage.h: Update header.

	* src/tasks_sql.h: Convert perrors and printfs to glib calls.
	(next_task): Reduce tracing.
	(init_manage): Set log handler.

2009-07-17  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch trace messages to the openvas_libraries logging facility.

	* src/openvasmd.c (cleanup): Free log config.
	(main): Setup logging.

	* src/tracef.h (tracef): Log with g_log.
	(log_config): New def.

	* src/ovas-mngr-comm.c (log_config): New variable.

	* CMakeLists.txt (OPENVAS_SYSCONF_DIR): New variable.

	* src/openvasmd_log_conf.cmake: New file.

	* src/CMakeLists.txt: Setup OPENVAS_SYSCONF_DIR.  Configure and install
	openvasmd_log.conf.

2009-07-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.c (init_manage): Insert the "om" user if the users
	table is empty.

2009-07-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.c (init_manage): Remove sqlite3_finalize that was for
	the table-per-user model.

2009-07-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Add a users table to the database.  Share one tasks table and one
	reports table between all users.

	* src/tasks_sql.c: Adjust all SQL queries to access the shared task or
	report table, instead of a per-user table.
	(init_task_iterator): If the credentials are set then iterate over that
	user's tasks, otherwise iterate over all tasks.
	(init_manage): Move table creation here from authenticate.  Create users
	table.  Adjust the task consistency check for the new single table.
	(authenticate): Move table creation to init_manage.

2009-07-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (serve_client): Leave the lowat value alone.

2009-07-15  Matthew Mundell <matthew.mundell@greenbone.net>

	Add a reports table to the database.

	* src/tasks_sql.h (init_manage): Only run task checks on tasks tables.
	(authenticate): Create reports table.
	(create_task_report, delete_task_report): New functions.

	* src/manage.c (delete_report): Call the database report deleter.
	(create_report_file): Call the database report creator.

2009-07-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/read_protocol_0.c: Increase sleep.  Remove extra read from
	fail case.

2009-07-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (delete_report): Remove the last report link.

2009-07-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Correct the handling of the case where the initial OMP XML elements are
	shorter than the OTP init string.

	* src/oxpd.c (read_protocol): Update the comment about how much is read.
	Convert some direct returns to break out of the main loop instead.  Break
	out of the loop at the first '>'.

	* src/ompd.c (serve_omp): Add back handling of initial client input, as
	read_protocol may well read in a full OMP command.

	* src/tests/omp_help_1.c: New file.  Tests HELP before authenticating.

	* src/tests/CMakeLists.txt: Add omp_help_1.

2009-07-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ovas-mngr-comm.c (end_session): Remove full stop from perror string.

2009-07-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ompd.c (recreate_session): Remove close, which is done in
	end_session.

2009-07-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (sql, sql_x, init_task_iterator, init_manage): Handle
	SQLITE_BUSY returns from sqlite3_prepare.

2009-07-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* TODO: Remove the lazy login entry which is done.  Add an entry about
	atomicity of CREATE_TASK.  Correct a typo.

2009-07-10  Matthew Mundell <matthew.mundell@greenbone.net>

	Add a Manager database model.

	* src/doc/CMakeLists.txt (db.png, .built-html_db): New rules.
	(SQLT_EXECUTABLE, SQLT-DIAGRAM_EXECUTABLE): New vars.

	* src/doc/db_postgres.sql: New file.

2009-07-08  Matthew Mundell <matthew.mundell@greenbone.net>

	Store the original port strings in messages, and use these strings in the
	reports.

	* src/manage.c (port_t): Add string.

	* src/otp.c (port_t): Add string.
	(PARSE_PORTS): New conditional define.
	(make_message): Init port string.
	(free_message): Free port string.
	(set_message_port_string): New function.
	(write_message): Write port from original string.
	(process_otp_server_input): Set port string on receiving message.

2009-07-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otp.c (process_otp_server_input): Move settings of SERVER_DONE
	in SERVER_PLUGIN_LIST_OID back to precede switch (moved into switch in
	previous commit today).

2009-07-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_get_report_3.c, src/tests/omp_get_report_2.c,
	src/tests/omp_get_report_1.c, src/tests/omp_get_report_0.c: Correct
	header comments.

2009-07-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (send_task_preferences): Send less of the whitespace around
	the fields.

2009-07-08  Matthew Mundell <matthew.mundell@greenbone.net>

	Extend the initialisation mechanism, so that client-driven OTP begins
	after the server sends the plugin list.

	* src/otp.h (server_init_state_t): Add new states.

	* src/ompd.c (write_to_server): Handle SERVER_INIT_GOT_MD5SUM and
	SERVER_INIT_GOT_PLUGINS, by replying with the next OTP step.
	(serve_omp): Account for new init states when preparing for select.

	* src/otp.c (process_otp_server_input): Add
	SERVER_INIT_SENT_COMPLETE_LIST and SERVER_INIT_SENT_PASSWORD to the done
	init state case.  In SERVER_PLUGIN_LIST_OID and SERVER_PLUGINS_MD5 set a
	further init state instead of replying to the server directly.

2009-07-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otpd.c (serve_otp): Add sender to log messages.  Remove logging of
	first input, which is done by read_protocol now.

2009-07-08  Matthew Mundell <matthew.mundell@greenbone.net>

	Add logging of data sent to server.  Include sender in all log messages.

	* src/ovas-mngr-comm.c: Include logf.h.
	(write_string_to_server, write_to_server_buffer): Log writes.

	* src/ompd.c (write_to_client, serve_omp): Add sender to log messages.

	* src/oxpd.c (read_protocol): Add sender to log messages.

	* src/tests/report_path_task_uuid_0.c,
	src/tests/report_path_task_uuid_1.c, src/tests/report_path_task_uuid_2.c,
	src/tests/make_report_id_0.c, src/tests/common.c (log_stream): New
	variable.

2009-07-07  Matthew Mundell <matthew.mundell@greenbone.net>

	Use the actual host name for results in reports.

	* src/manage.h (message_t): Add subnet and host.

	* src/otp.c (message_t): Add subnet and host.
	(make_message): Take host instead of port info.
	(free_message): Free host and subnet.
	(set_message_port_number, set_message_port_protocol): New functions.
	(write_message): Write host and subnet from message structure.
	(process_otp_server_input): Add message host handling.

2009-07-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otp.c (current_host): New variable.
	(process_otp_server_input): Use the actual host name for host timestamps.

2009-07-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (inc_task_infos_size): Increment infos instead of
	holes.

2009-07-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (set_task_end_time, set_task_start_time): Free time.

2009-07-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (create_report_file): Initialise cache files.

2009-07-07  Matthew Mundell <matthew.mundell@greenbone.net>

	Add actual timestamps to GET_STATUS.

	* src/otp.c (save_report): Save timestamp to a cache file.
	(process_otp_server_input): Set task start and end times after SCAN_START
	and SCAN_END instead of HOST_START and HOST_END.

	* src/manage.c (report_timestamp): New function.
	* src/manage.h (report_timestamp): New header.

	* src/omp.c (send_reports, omp_xml_handle_end_element): Add counts to
	GET_STATUS <timestamp>.

2009-07-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otp.c (save_report): Correct file name.

2009-07-06  Matthew Mundell <matthew.mundell@greenbone.net>

	Add actual message counts to GET_STATUS.

	* src/otp.c (save_report): Save message counts to a cache file.

	* src/manage.c (report_counts): New function.
	* src/manage.h (report_counts): New header.

	* src/omp.c (send_reports, omp_xml_handle_end_element): Add counts to
	GET_STATUS <messages>.

2009-07-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (send_reports, omp_xml_handle_end_element): Ensure all
	GET_STATUS cases include <warning> in <messages>.

2009-07-06  Matthew Mundell <matthew.mundell@greenbone.net>

	Reset task running information before starting the task.

	* src/tasks_sql.h (reset_task): New function.
	* src/manage.h (reset_task): New header.

	* src/manage.c (start_task): Call reset_task before starting the task.

2009-07-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_get_report_4.c: New file.  Tests GET_REPORT with extra
	elements.

	* src/tests/CMakeLists.txt (omp_get_report_4): New test.

2009-07-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_start_element): In CLIENT_GET_REPORT remove
	"_response", which is added by XML_ERROR_SYNTAX.

2009-07-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ompd.c (serve_omp): Only setup the client in the fd sets when the
	client is active.  As a result move the first timeout check to precede
	the setup of the client socket in the fd sets, in case the timeout check
	closes the client socket.  Also, only pass select a timeout when the
	client is active, and only do the second timeout check when the client is
	active.

2009-07-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* CMakeLists.txt (CMAKE_BUILD_TYPE): Set to debug.

2009-07-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/oxpd.h (READ_PROTOCOL_TIMEOUT): Increase.

2009-07-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.c (connect_to_manager_host_port): After connecting,
	if the environment variable OPENVAS_TEST_WAIT is true, then read a char
	before continuing.

2009-07-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (sql_quote): Increment start in quote counting loop.

	* src/tests/new_task_small_rc (SERVER_PREFS): Add some fields with quotes.

2009-07-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_start_task_4.c: New file.  Tests START_TASK with missing
	rcfile.

	* src/tests/CMakeLists.txt: Add omp_start_task_4.

2009-07-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Check task_description return.

	* src/manage.c (task_preference, task_plugins, send_task_preferences)
	(send_task_rules): Check task_description return.

2009-07-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ompd.c (serve_omp): Only select on client for exceptions when
	client is active.

2009-07-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ompd.c (serve_omp): Improve the "safe to select" comment a bit.

2009-07-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/oxpd.c (read_protocol): Log what is read.

2009-07-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (send_plugin): Send a dummy checksum.

2009-07-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Before starting a task, check that the task has targets.

	* src/manage.c (start_task): Check for targets in the task definition.

	* src/omp.c (omp_xml_handle_end_element): Send ERROR_MISSING if the task
	is missing targets.

	* src/tests/omp_start_task_3.c,
	src/tests/new_task_small__missing_targets_rc: New files.

	* src/tests/CMakeLists.txt: Add omp_start_task_3.

2009-07-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/oxpd.c (read_protocol): Read as much as possible at a time up to
	the length of the OTP protocol string, in case the client presumes that
	what it has written has been entirely read.

2009-07-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Account for 0 current_port in
	GET_STATUS progress calculation.

2009-07-01  Matthew Mundell <matthew.mundell@greenbone.net>

	Add a PROGRESS element to the GET_STATUS response.

	* src/manage.c (task_last_report_id): Remove old comment.
	* src/tasks_sql.h (task_current_port, task_max_port): New functions.
	* src/manage.h: Update headers.

	* src/omp.c (omp_xml_handle_end_element): Add PROGRESS to GET_STATUS.

2009-07-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_STATUS only print a
	LAST_REPORT if there is a last report.

2009-06-30  Matthew Mundell <matthew.mundell@greenbone.net>

	Add a LAST_REPORT element to the GET_STATUS response.

	* src/manage.c (task_last_report_id): New function.
	(current_report_name): New variable.
	(create_report_file): Store report name in current_report_name.
	* src/manage.h: Update headers.

	* src/otp.c (save_report): Adjust or create symlink to the current report.
	(process_otp_server_input): Free current_report_name if save_report fails.

	* src/omp.c (omp_xml_handle_end_element): Add LAST_REPORT to GET_STATUS.

2009-06-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (send_to_client): Trace when out of space.

2009-06-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Add report_count to
	the plural GET_STATUS response.

2009-06-29  Matthew Mundell <matthew.mundell@greenbone.net>

	(start_task): Use send_to_server instead of sendf_to_server for constant
	string.

2009-06-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (request_plugin_list): Remove.
	(acknowledge_md5sum_sums, acknowledge_md5sum_info)
	(acknowledge_md5sum): New functions.
	* src/manage.h: Update headers.

	* src/otp.c (process_otp_server_input): Request the plugin list on
	getting the feed md5.  Acknowledge the md5sum (GO ON) after receiving the
	plugin list.

2009-06-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Remove attempts at initiating
	connections in XML_SERVICE_DOWN cases, now that serve_omp connects
	eagerly.

2009-06-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_MODIFY_TASK respond
	with XML_OK instead of XML_OK_REQUESTED.

2009-06-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_start_element): In CLIENT_CREATE_TASK
	initialise the task description.
	(omp_xml_handle_end_element): In CLIENT_CREATE_TASK_RCFILE check the
	return from g_base64_decode.

2009-06-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ompd.c (serve_omp): Eagerly initiate the OTP server connection.

2009-06-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ompd.c (serve_omp): Let the select loop handle the first input, as
	read_protocol now only reads up to the first '>'.

2009-06-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/oxpd.c (read_protocol): Read at most up to the first '>', so that
	the caller can select on the socket after the call and be sure that the
	select will return within the first command.

2009-06-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (serve_client): Remove server socket closing, which
	is now done in end_session.

2009-06-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (set_task_parameter): Convert rcfile before storing it
	in database.

2009-06-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_create_task_1.c: New file.  Tests OMP CREATE_TASK with
	empty RC file.

	* src/tests/CMakeLists.txt: Add omp_create_task_1.

2009-06-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.c (connect_to_manager_host_port, create_task)
	(create_task_from_rc_file, start_task, wait_for_task_end)
	(delete_task): Add const to string parameters.
	(omp_delete_report, omp_delete_task, omp_modify_task, omp_get_preferences)
	(omp_get_certificates, omp_until_up): New functions.
	* src/tests/common.h: Update headers.

2009-06-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ovas-mngr-comm.c (end_session): Break out of the gnutls_bye loop
	if the bye succeeds.  Enable close code.  Move gnutls_deinit and
	gnutls_certificate_free_credentials after shutdown and close.

2009-06-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ovas-mngr-comm.c (sendn_to_server): Trace when out of space.

2009-06-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ovas-mngr-comm.c (TO_SERVER_BUFFER_SIZE): Increase.

2009-06-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_manage_process): Ensure that the
	OPENVAS_STATE_DIR "mgr/" directory exists.

2009-06-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (init_manage): Close the database before returning,
	so that forked processes open their own connections.

2009-06-23  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* VERSION: Set to 0.6.2.SVN.

	* CMakeLists.txt: Updated CPACK_PACKAGE_VERSION_PATCH.

	* doc/Doxyfile, doc/Doxyfile_full: Updated PROJECT_NUMBER.

	* ChangeLog: Corrected path in last entry.

2009-06-23  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 0.6.1 release.

	* VERSION: Set to 0.6.1.

	* CMakeLists.txt: Updated CPACK_PACKAGE_VERSION_PATCH.

	* doc/Doxyfile, doc/Doxyfile_full: Updated PROJECT_NUMBER.

	* packaging/debian/control: Updated version requirements for Debian
	package.

	* CHANGES: Updated, fixed typos in change notes for the last release.

2009-06-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.c (omp_get_status): Return statuses of all tasks if
	ID is NULL.

2009-06-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.c (foreach_print_attribute): New function.
	(print_entity): Add attribute printing.

	* TODO: Remove associated entry.

2009-06-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.c (omp_get_report): New function.
	* src/tests/common.h (omp_get_report): New header.

2009-06-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.h: Add multiple-include guard.

2009-06-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (main): Neaten formatting.

2009-06-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.c (wait_for_task_start, wait_for_task_end): Return
	if task state becomes "Internal Error".

2009-06-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otp.c (parse_server_bad_login): New function.
	(process_otp_server_input): Check for bad login response from server.

	* src/ompd.c (serve_omp): Handle "bad login" return from
	process_otp_server_input.

2009-06-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ompd.c (recreate_session): New function.
	(serve_omp): Move session creation to recreate_session.

2009-06-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ompd.c (write_to_server): Change OTP username and password.

2009-06-18  Michael Wiegand <michael.wiegand@greenbone.net>

	Adding support for creating a process ID file.

	* CMakeLists.txt: Set OPENVAS_PID_DIR to the appropriate directory.

	* src/CMakeLists.txt: Expose OPENVAS_PID_DIR.

	* src/openvasmd.c: Added pidfile handling.
	(main): Write the PID to the pidfile once the server is running.
	(cleanup): Remove the pidfile on exit.

2009-06-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (send_reports, omp_xml_handle_end_element): Use
	OPENVAS_STATE_DIR instead of PREFIX "/var/lib/openvas/".
	(PREFIX): Remove.

	* src/otp.c (PREFIX): Remove.

	* src/manage.c (report_task, delete_report, set_report_parameter)
	(create_report_file, delete_reports): Use OPENVAS_STATE_DIR instead of
	 PREFIX "/var/lib/openvas/".
	(PREFIX): Remove.

	* src/tasks_fs.h (load_tasks, save_tasks, delete_task): Use
	OPENVAS_STATE_DIR instead of PREFIX "/var/lib/openvas/".

2009-06-17  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/tasks_sql.h (init_manage_process, delete_task): Use
	OPENVAS_STATE_DIR instead of PREFIX "/var/lib/openvas/".

	* src/CMakeLists.txt: Expose OPENVAS_STATE_DIR.

2009-06-17  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* VERSION: Set to 0.6.1.SVN.

	* doc/Doxyfile, doc/Doxyfile_full: Updated PROJECT_NUMBER.

	* CMakeLists.txt: Updated version information.

2009-06-17  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 0.6.0 release.

	* VERSION: Set to 0.6.0.

	* CHANGES: Updated.

	* doc/Doxyfile, doc/Doxyfile_full: Updated PROJECT_NUMBER.

	* CMakeLists.txt: Updated version information.

2009-06-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c, TODO: Move note about communication functions to TODO.

2009-06-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ompd.c (serve_omp): Remove lastfds tracing.

2009-06-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Move read_protocol from the main manager daemon into oxpd.

	* src/openvasmd.c (READ_PROTOCOL_TIMEOUT, protocol_read_t)
	(read_protocol): Move to oxpd.h and oxpd.c.

	* src/oxpd.c (read_protocol): New function, from src/openvasmd.c.

	* src/oxpd.h (READ_PROTOCOL_TIMEOUT): New define from src/openvasmd.c.
	(protocol_read_t): New type, from src/openvasmd.c.
	(read_protocol): New header.

2009-06-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/oxpd.c: Enable FROM_BUFFER_SIZE check.

2009-06-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/CMakeLists.txt (DOC_FILES): Add oxpd.c.

2009-06-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Separate the common ompd and otpd globals into a new file.

	* src/oxpd.c, src/oxpd.h: New files.

	* src/ompd.c: Include oxpd.h.
	(server_address): Move to oxpd.c.
	(from_buffer_size, from_client, from_client_start, from_client_end)
	(from_server, from_server_start, from_server_end): Remove.
	* src/ompd.h (server_address): Remove.

	* src/otpd.c: Include oxpd.h instead of ompd.h.
	(from_buffer_size, from_client, from_client_start, from_client_end)
	(from_server, from_server_start, from_server_end): Remove.

	* src/openvasmd.c: Include oxpd.h.
	(FROM_BUFFER_SIZE, from_buffer_size, from_client, from_client_start)
	(from_client_end, from_server, from_server_start, from_server_end): Move
	to src/oxpd.c.

	* src/CMakeLists.txt (openvasmd, C_FILES): Add oxpd.c.

	* doc/Doxyfile, doc/Doxyfile_full (INPUT): Add src/oxpd.c.

2009-06-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/file.c (rmdir_recursively): Add descriptive comments.

2009-06-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (send_task_preferences): Free orig_desc in error cases.

2009-06-16  Michael Wiegand <michael.wiegand@greenbone.net>

	* CMakeLists.txt: Make source archive filenames consistent with other
	modules and Debians expectations.

2009-06-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* CMakeLists.txt: Turn off optimisation for now, as it results in a
	warning about the uuid_export call in make_report_uuid.

2009-06-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* TODO: Add missing paren.

2009-06-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Acknowledge OTP server BYE messages.

	* src/otp.c (process_otp_server_input): In SERVER_BYE leave setting of the
	init state to the caller and queue the BYE ACK in to_server.

	* src/ompd.c (serve_omp): On receiving server BYE flush the to_server
	buffer and set the server init state.

	* src/ovas-mngr-comm.c (end_session): Turn off blocking before the
	gnutls_bye, and limit the number of gnutls_bye attempts.

	* src/manage.c (acknowledge_bye): New function.
	* src/manage.h (acknowledge_bye): New header.

2009-06-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* TODO: New file.

2009-06-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (sql_int, sql_string): Check return from sql_x.

2009-06-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_get_preferences_1.c: Enable test for expected value.

2009-06-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_get_preferences_0.c: Correct expected status code.

2009-06-12  Matthew Mundell <matthew.mundell@greenbone.net>

	Move OID entity of OMP GET_NVT_DETAILS to an attribute.

	* src/omp.c (client_state_t): Remove CLIENT_GET_NVT_DETAILS_OID.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Move GET_NVT_DETAILS OID to an attribute.

	* src/tests/omp_get_nvt_details_2.c, src/tests/omp_get_nvt_details_3.c,
	src/tests/omp_get_nvt_details_4.c: Pass OID in an attribute.

2009-06-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.c (delete_task): Pass TASK_ID as attribute.

2009-06-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Move REPORT_ID entities of OMP DELETE_REPORT, GET_REPORT and
	MODIFY_REPORT commands to attributes.

	* src/omp.c (client_state_t): Remove CLIENT_GET_REPORT_ID,
	CLIENT_DELETE_REPORT_ID and CLIENT_MODIFY_REPORT_REPORT_ID.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Move REPORT_ID to an attribute.

	* src/tests/omp_delete_report_0.c, src/tests/omp_delete_report_1.c,
	src/tests/omp_delete_task_1.c, src/tests/omp_get_report_0.c,
	src/tests/omp_get_report_1.c, src/tests/omp_get_report_2.c,
	src/tests/omp_get_report_3.c, src/tests/omp_modify_report_0.c: Adjust for
	updated OMP.

2009-06-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_get_report_0.c: Improve check of expected response.

	* src/tests/omp_get_report_1.c, src/tests/omp_get_report_2.c,
	src/tests/omp_get_report_3.c: New files.

	* src/tests/CMakeLists.txt: Add omp_get_report_1, omp_get_report_2 and
	omp_get_report_3.

2009-06-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_delete_report_0.c, src/tests/omp_delete_task_0.c,
	src/tests/omp_delete_task_1.c, src/tests/omp_delete_task_2.c,
	src/tests/omp_get_dependencies_1.c, src/tests/omp_get_nvt_all_1.c,
	src/tests/omp_get_nvt_details_1.c, src/tests/omp_get_nvt_details_4.c,
	src/tests/omp_get_nvt_feed_checksum_1.c,
	src/tests/omp_get_nvt_feed_checksum_4.c,
	src/tests/omp_get_nvt_feed_checksum_5.c, src/tests/omp_get_preferences_1.c,
	src/tests/omp_get_report_0.c, src/tests/omp_get_rules_1.c,
	src/tests/omp_modify_report_0.c, src/tests/omp_modify_task_1.c: Pass
	GET_STATUS TASK_ID as an attribute.

	* src/tests/common.c (wait_for_task_delete, omp_get_status): Pass
	GET_STATUS TASK_ID as an attribute.

2009-06-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Move TASK_ID entity of OMP GET_STATUS to an attribute.

	* src/omp.c (client_state_t): Remove CLIENT_GET_STATUS_TASK_ID.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Move GET_STATUS TASK_ID to an attribute.

	* src/tests/omp_get_status_1.c, src/tests/omp_get_status_2.c,
	src/tests/omp_get_status_4.c, src/tests/omp_get_status_5.c: Pass TASK_ID
	in an attribute.

2009-06-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_get_status_0.c: Correct expectations.

2009-06-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Move TASK_ID entity of OMP ABORT_TASK to an attribute.

	* src/omp.c (client_state_t): Remove CLIENT_ABORT_TASK_TASK_ID.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Move ABORT_TASK TASK_ID to an attribute.

	* src/tests/omp_abort_task_0.c: Pass TASK_ID in an attribute.

	* ChangeLog: Correct function names in last three entries.

2009-06-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_abort_task_0.c: Expect that the operation may also
	succeed completely.

2009-06-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Move TASK_ID entity of OMP START_TASK to an attribute.

	* src/omp.c (client_state_t): Remove CLIENT_START_TASK_TASK_ID.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Move START_TASK TASK_ID to an attribute.

	* src/tests/common.c (start_task): Pass TASK_ID in an attribute.

	* src/tests/omp_start_task_0.c: Pass TASK_ID in an attribute.

	* ChangeLog: Correct descriptions in last two entries.

2009-06-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Move TASK_ID entity of OMP DELETE_TASK to an attribute.

	* src/omp.c (client_state_t): Remove CLIENT_DELETE_TASK_TASK_ID.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Move DELETE_TASK TASK_ID to an attribute.

	* src/tests/omp_delete_task_0.c, src/tests/omp_delete_task_1.c,
	src/tests/omp_delete_task_1.c: Pass TASK_ID in an attribute.

2009-06-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Move TASK_ID entity of OMP MODIFY_TASK to an attribute.

	* src/omp.c (client_state_t): Remove CLIENT_MODIFY_TASK_TASK_ID.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Move MODIFY_TASK TASK_ID to an attribute.

	* src/tests/omp_modify_task_0.c, src/tests/omp_modify_task_1.c: Pass
	TASK_ID in an attribute.

2009-06-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Move OID entity of OMP GET_NVT_ALL and GET_NVT_DETAILS to an attribute.

	* src/omp.c (send_plugin): Move OID to an attribute.

	* src/tests/omp_get_nvt_details_4.c: Expect OID in an attribute.

2009-06-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Get the GET_NVT_DETAILS tests passing.

	* src/tests/omp_get_nvt_details_3.c,
	src/tests/omp_get_nvt_details_2.c: Keep querying the manager until the
	feed details are available.

	* src/tests/omp_get_nvt_details_1.c,
	src/tests/omp_get_nvt_details_4.c: Expect status in an attribute.

2009-06-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_delete_report_0.c, src/tests/omp_delete_task_1.c
	src/tests/omp_get_report_0.c, src/tests/omp_modify_report_0.c: Adjust
	for move of GET_STATUS REPORT ID to an attribute.

2009-06-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (send_reports): Move ID of GET_STATUS REPORT to an attribute.

2009-06-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (task_preference): Free orig_desc after last use,
	instead of before.

2009-06-10  Matthew Mundell <matthew.mundell@greenbone.net>

	Account for the move of GET_STATUS TASK_ID to an attribute in all
	remaining tests.

	* src/tests/common.c (task_status): Match updated GET_STATUS.
	(omp_get_status): Improve status param doc slightly.

	* src/tests/omp_delete_report_0.c, src/tests/omp_delete_task_1.c,
	src/tests/omp_delete_task_2.c, src/tests/omp_get_report_0.c,
	src/tests/omp_modify_report_0.c, src/tests/omp_modify_task_1.c: Match
	updated GET_STATUS.

2009-06-10  Matthew Mundell <matthew.mundell@greenbone.net>

	Move GET_STATUS response TASK_ID to an attribute of the task.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_STATUS add the
	enclosing TASK entity to the ID case and in both cases move the TASK_ID
	to an attribute.

	* src/common.c (wait_for_task_start, wait_for_task_end): Expect task ID
	in attribute.

	* src/tests/omp_get_status_0.c, src/tests/omp_get_status_1.c,
	src/tests/omp_get_status_1.c, src/tests/omp_get_status_3.c,
	src/tests/omp_get_status_4.c, src/tests/omp_get_status_5.c: Improve checks
	and match updated OMP.

2009-06-10  Matthew Mundell <matthew.mundell@greenbone.net>

	Merge the OMP MODIFY_REPORT command's VALUE and PARAMETER entities.

	* src/omp.c (client_state_t): Remove CLIENT_MODIFY_REPORT_VALUE.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Merge MODIFY_REPORT VALUE and PARAMETER.

	* src/tests/omp_modify_report_0.c: Match updated OMP.

2009-06-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_start_element): Reorder CLIENT_MODIFY_TASK
	conditions.

2009-06-09  Matthew Mundell <matthew.mundell@greenbone.net>

	Merge the OMP MODIFY_TASK command's VALUE and PARAMETER entities.

	* src/omp.c (client_state_t): Remove CLIENT_MODIFY_TASK_VALUE.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Merge MODIFY_TASK VALUE and PARAMETER.

	* src/tests/omp_modify_task_0.c, src/tests/omp_modify_task_1.c: Match
	updated OMP.

2009-06-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_get_status_0.c: Change "identifier" to "name" in
	expected response.

	* src/tests/omp_modify_task_1.c: Expect "name" instead of "identifier".
	Use new response code.

	* src/tests/omp_modify_task_0.c: Use new response code.

2009-06-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.c: Rename task name symbols to use "name" instead of
	"identifier".

2009-06-09  Matthew Mundell <matthew.mundell@greenbone.net>

	Add RCFILE, NAME and COMMENT elements to OMP MODIFY_TASK.

	* src/omp.c (modify_task_comment, modify_task_name)
	(modify_task_rcfile): New variables.
	(client_state_t): Add new MODIFY_TASK states.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Handle new MODIFY_TASK elements.

2009-06-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* ChangeLog: Convert space indentation to tabs.

2009-06-09  Matthew Mundell <matthew.mundell@greenbone.net>

	Rename TASK_FILE to RCFILE in the OMP command CREATE_TASK.

	* src/omp.c (client_state_t): Rename CLIENT_CREATE_TASK_TASK_FILE to
	CLIENT_CREATE_TASK_RCFILE.  Ajust all users.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Parse
	RCFILE instead of TASK_FILE.

	* src/tasks_fs.h (set_task_parameter): Parse RCFILE instead of TASK_FILE.
	* src/tasks_sql.h (set_task_parameter): Parse RCFILE instead of TASK_FILE.

	* src/tests/common.c (create_task): Send RCFILE instead of TASK_FILE.

	* src/tests/omp_create_task_0.c: Send RCFILE instead of TASK_FILE.

2009-06-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (set_task_parameter): Correct doc parameter description.

2009-06-09  Matthew Mundell <matthew.mundell@greenbone.net>

	Rename task name symbols to use "name" instead of "identifier".

	* src/omp.c (client_state_t): Rename CLIENT_CREATE_TASK_IDENTIFIER to
	CLIENT_CREATE_TASK_NAME.  Adjust all users.

	* src/tasks_sql.h (append_to_task_identifier): Rename append_to_task_name.
	(append_to_task_name): New function, renamed from append_to_task_identifier.
	* src/tasks_fs.h (append_to_task_identifier): Rename append_to_task_name.
	(append_to_task_name): New function, renamed from append_to_task_identifier.
	* src/manage.h: Update header.

2009-06-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_get_nvt_feed_checksum_1.c: Include ../string.h.

2009-06-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/read_protocol_0.c: Correct task name.

2009-06-09  Matthew Mundell <matthew.mundell@greenbone.net>

	Rename IDENTIFIER to NAME in OMP commands CREATE_TASK and GET_STATUS.

	* src/omp.c (omp_xml_handle_start_element): Rename IDENTIFIER to NAME.

	* src/tests/omp_get_status_5.c: New file, tests GET_STATUS with an ID
	before running the task.

	* src/tests/CMakeLists.txt: Add omp_get_status_5.

	* src/tests/common.c (create_task): Rename IDENTIFIER to NAME.

	* src/tests/omp_create_task_0.c: Rename IDENTIFIER to NAME.

	* src/tests/omp_get_status_2.c: Improve expected response.

2009-06-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (serve_client): Improve comment slightly.

2009-06-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otpd.c (serve_otp): Close client socket on return.

2009-06-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (read_protocol): Check return from time for error.

	* ChangeLog: Correct entry dates for yesterday.

2009-06-08  Matthew Mundell <matthew.mundell@greenbone.net>

	Close client connections that are idle for longer than a fixed limit.

	* src/openvasmd.c (serve_client): Close client socket on return.
	(accept_and_maybe_fork): Leave it to serve_client to close the client
	socket.

	* src/ompd.c (CLIENT_TIMEOUT): New definition.
	(serve_omp): Close client_socket on return.  Timeout if the client
	connection is idle for CLIENT_TIMEOUT or more seconds.

	* src/tests/timeout_0.c: New file, tests client timeout.

	* src/tests/CMakeLists.txt: Add timeout_0.  Move timeout tests to end.

2009-06-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (accept_and_maybe_fork): Close client socket in
	parent process.

2009-06-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otp.c (process_otp_server_input): In the cases where the OTP that
	follows is either a field or "<|> SERVER", check for the '|' in
	addition to checking if the length of "field" is zero, as "field" may
	legitimately be an empty field (" <|> field2 ...").

2009-06-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (stringify): Remove.

2009-06-05  Matthew Mundell <matthew.mundell@greenbone.net>

	Bring comment docs up to date.

	* src/string.c (isalnumstr): Doc param.

	* src/omp.c: Add docs to new defines.  Move DEF out of send_plugin.
	(SENDF_TO_CLIENT_OR_FAIL): Doc params properly.

	* src/tests/common.c (next_entities, first_entity): New functions.
	(add_attribute): Correct param name in doc.
	(add_attributes, setup_test): Add doc.
	(compare_find_attribute): Doc attributes2 param.
	(omp_get_status): Doc status param.

2009-06-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_sql.h (make_task): Initialise task run state.

2009-06-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_create_task_0.c: Add check that task run status is
	initialised correctly.

2009-06-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.c (omp_get_status): New function.
	* src/tests/common.h (omp_get_status): New header.

2009-06-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otp.c (parse_server_plugin_list_tags, process_otp_server_input): Use
	new nvtis function names.

	* src/omp.c (omp_xml_handle_end_element): Use new nvtis function names.

2009-06-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (find_attribute): New function.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Handle
	GET_NVT_FEED_CHECKSUM "algorithm" attribute.

	* src/tests/omp_get_nvt_feed_checksum_2.c,
	src/tests/omp_get_nvt_feed_checksum_3.c,
	src/tests/omp_get_nvt_feed_checksum_4.c,
	src/tests/omp_get_nvt_feed_checksum_5.c: New files which test
	GET_NVT_FEED_CHECKSUM "algorithm" attribute.

	* src/tests/CMakeLists.txt: Add omp_get_nvt_feed_checksum_2,
	omp_get_nvt_feed_checksum_3, omp_get_nvt_feed_checksum_4 and
	omp_get_nvt_feed_checksum_5.

2009-06-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_NVT_ALL change
	algorithm entity to a feed_checksum attribute.

	* src/tests/omp_get_nvt_all_1.c: Match updated GET_NVT_ALL.  Add
	algorithm and checksum checks.

	* ChangeLog: Add entry for last commit.

2009-06-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/string.h (isalnumstr): New header.
	* src/string.c (isalnumstr): New function.
	* src/tests/omp_get_nvt_feed_checksum_1.c (isalnumstr): Remove.

2009-06-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In
	CLIENT_GET_NVT_FEED_CHECKSUM add checksum entity with algorithm.

	* src/tests/omp_get_nvt_feed_checksum_1.c: Match updated OMP.

2009-06-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_VERSION move
	preferred entity to attribute.

	* src/tests/omp_get_version_0.c: Move expected preferred entity to
	attribute.

2009-06-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_delete_task_2.c: Correct expected tag name and string
	comparison.  Compare the response status instead of the task status, to
	the response code.

2009-06-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_delete_task_0.c: Add check of whether delete request
	succeeded immediately.  Correct expected tag name and string comparison.

2009-06-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_delete_task_1.c: Wait for the task to stop before
	requesting the report.  Use one entity at a time and free the entities
	after use.  Pass sendf_to_manager the ID text instead of the ID entity.

2009-06-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.c (wait_for_task_delete): New function.
	* src/tests/common.h (wait_for_task_delete): New header.

2009-06-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.c (task_status): Revert to correct implementation.

2009-06-03  Matthew Mundell <matthew.mundell@greenbone.net>

	When stopping tasks, account for the case where the task is stopped
	already.

	* src/manage.c (stop_task): Return 1 instead of 0 if stop is requested.

	* src/tasks_sql.h (sql_int64, sql_x): Add return values to indicate when
	there are fewer rows than requested.
	(request_delete_task): Return 1 instead of 0 if delete requested.  If
	task is already stopped, then do the delete.
	(find_task): Return FALSE only on error and return with task 0 to indicate
	failure to find the task.  Update caller.

	* src/omp.c (omp_xml_handle_end_element): When stopping and deleting a
	task respond with OK if the operation is already done, instead of always
	with OK_REQUESTED.  Add INTERNAL_ERROR cases to the return checks
	of all find_task calls.

2009-06-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_STATUS correct
	opening tag and add closing tag.

2009-06-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_bogus_0.c, src/tests/omp_bogus_1.c: New files, which
	test the manager with a bogus command.

	* src/tests/CMakeLists.txt: Add omp_bogus_0 and omp_bogus_1.

2009-06-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Move response statuses into attributes, in tests.

	* src/tests/omp_abort_task_0.c, src/tests/omp_create_task_0.c,
	src/tests/omp_delete_report_0.c, src/tests/omp_delete_report_1.c,
	src/tests/omp_delete_task_0.c, src/tests/omp_delete_task_1.c,
	src/tests/omp_get_certificates_0.c, src/tests/omp_get_dependencies_0.c,
	src/tests/omp_get_nvt_all_0.c, src/tests/omp_get_nvt_details_0.c,
	src/tests/omp_get_nvt_details_2.c, src/tests/omp_get_nvt_details_3.c,
	src/tests/omp_get_nvt_feed_checksum_0.c, src/tests/omp_get_preferences_0.c,
	src/tests/omp_get_preferences_1.c, src/tests/omp_get_report_0.c,
	src/tests/omp_get_rules_0.c, src/tests/omp_get_rules_1.c,
	src/tests/omp_get_status_0.c, src/tests/omp_get_status_1.c,
	src/tests/omp_get_status_2.c, src/tests/omp_get_status_3.c,
	src/tests/omp_get_status_4.c, src/tests/omp_get_version_0.c,
	src/tests/omp_help_0.c, src/tests/omp_modify_report_0.c,
	src/tests/omp_modify_task_0.c, src/tests/omp_modify_task_1.c,
	src/tests/omp_start_task_0.c: Adjust for attribute statuses.

	* src/tests/common.h (entity_t): Add attributes.
	(add_attribute, entity_child, entity_attribute): New headers.

	* src/tests/common.c (make_entity): Init attributes.
	(add_attribute, entity_attribute, add_attributes)
	(compare_find_attribute): New functions.
	(free_entity): Free attributes.
	(entity_child): Make name param const.
	(handle_start_element): Add attributes.
	(compare_entities): Compare attributes.  Correct NULL check.
	(task_status, authenticate, start_task, wait_for_task_start)
	(wait_for_task_end, delete_task): Adjust for attribute statuses.

2009-06-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Move response statuses into attributes.

	* src/ompd.c (serve_omp): On process_omp_client_input error, write out
	the rest of the to_client buffer before exiting.  Handle the response
	from the very first process_omp_client_input.

	* src/omp.c (XML_ERROR_SYNTAX, XML_ERROR_MISSING, XML_ERROR_AUTH_FAILED)
	(XML_OK, XML_OK_REQUESTED, XML_INTERNAL_ERROR, XML_SERVICE_DOWN): New
	macros.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Convert all
	status tags to attributes.
	(process_omp_client_input): Return -4 on XML syntax error.

2009-05-29  Matthew Mundell <matthew.mundell@greenbone.net>

	Make the tests compile and run again.

	* src/tests/report_path_task_uuid_1.c,
	src/tests/report_path_task_uuid_0.c,
	src/tests/report_path_task_uuid_2.c: Comment out setup_test and common.h
	include.

	* src/tests/strip_space_0.c, src/tests/strip_space_2.c,
	src/tests/strip_space_3.c, src/tests/strip_space_1.c,
	src/tests/rmdir_recursively_0.c, src/tests/rmdir_recursively_1.c: Include
	common.h.

	* src/tests/omp_start_task_2.c, src/tests/omp_abort_task_0.c,
	src/tests/omp_delete_task_0.c, src/tests/omp_start_task_1.c,
	src/tests/omp_delete_task_1.c, src/tests/omp_start_task_0.c: Turn on
	TRACE.

	* src/tests/CMakeLists.txt (rmdir_recursively_0, rmdir_recursively_1)
	strip_space_0, strip_space_1, strip_space_2, strip_space_3): Link to
	common and requirement of common.

2009-05-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_abort_task_0.c, src/tests/omp_create_task_0.c,
	src/tests/omp_delete_report_0.c, src/tests/omp_delete_report_1.c,
	src/tests/omp_delete_task_0.c, src/tests/omp_delete_task_1.c,
	src/tests/omp_delete_task_2.c, src/tests/omp_get_dependencies_0.c,
	src/tests/omp_get_dependencies_1.c, src/tests/omp_get_nvt_all_0.c,
	src/tests/omp_get_nvt_all_1.c, src/tests/omp_get_nvt_details_0.c,
	src/tests/omp_get_nvt_details_2.c, src/tests/omp_get_nvt_details_3.c,
	src/tests/omp_get_nvt_details_4.c, src/tests/omp_get_nvt_feed_checksum_0.c,
	src/tests/omp_get_nvt_feed_checksum_1.c, src/tests/omp_get_preferences_0.c,
	src/tests/omp_get_preferences_1.c, src/tests/omp_get_report_0.c,
	src/tests/omp_get_rules_0.c, src/tests/omp_get_rules_1.c,
	src/tests/omp_get_status_0.c, src/tests/omp_get_status_1.c,
	src/tests/omp_get_status_2.c, src/tests/omp_get_status_3.c,
	src/tests/omp_get_status_4.c, src/tests/omp_get_version_0.c,
	src/tests/omp_help_0.c, src/tests/omp_modify_report_0.c,
	src/tests/omp_modify_task_0.c, src/tests/omp_modify_task_1.c,
	src/tests/omp_start_task_0.c, src/tests/omp_start_task_1.c,
	src/tests/omp_start_task_2.c, src/tests/report_path_task_uuid_0.c,
	src/tests/report_path_task_uuid_1.c, src/tests/report_path_task_uuid_2.c,
	src/tests/rmdir_recursively_0.c, src/tests/rmdir_recursively_1.c,
	src/tests/strip_space_0.c, src/tests/strip_space_1.c,
	src/tests/strip_space_2.c, src/tests/strip_space_3.c: Call setup_test
	before testing.

2009-05-29  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OTP CERTIFICATES handling and OMP GET_CERTIFICATES.

	* src/manage.c (request_certificates): New function.
	* src/manage.h: Update headers.

	* src/omp.c (help_text, client_state_t): Add GET_CERTIFICATES entries.
	(send_certificate): New function.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add
	GET_CERTIFICATES handling.

	* src/otp.h (server_t): Add certificates.

	* src/otp.c (init_otp_data): Init server certificates.
	(server_state_t): Add CERTIFICATES states.
	(current_certificates, current_certificate): New variables.
	(parse_server_certificate_public_key): New function.
	(parse_server_server, process_otp_server_input): Add CERTIFICATES
	handling.

	* src/tests/omp_help_0.c (help_text): Add GET_CERTIFICATES entry.

	* src/tests/omp_get_certificates_0.c,
	src/tests/omp_get_certificates_1.c: New files.

	* src/tests/CMakeLists.txt: Add omp_get_certificates_0 and
	omp_get_certificates_1.

2009-05-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/CMakeLists.txt: Sort rules.

2009-05-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (help_text, client_state_t): Sort entries.

	* src/tests/omp_help_0.c (help_text): Sort entries.

2009-05-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.c (create_task): Rename NEW_TASK call to CREATE_TASK.
	(wait_for_task_start, wait_for_task_end): Rename STATUS call to
	GET_STATUS.

2009-05-28  Matthew Mundell <matthew.mundell@greenbone.net>

	Rename OMP STATUS to GET_STATUS.

	* src/omp.c (help_text, client_state_t, omp_xml_handle_start_element)
	(omp_xml_handle_end_element, omp_xml_handle_text): Rename STATUS to
	GET_STATUS.

	* src/tests/CMakeLists.txt: Rename tests to match new command name.

	* src/tests/omp_status_0.c: Remove.  Rename to omp_get_status_0.c.
	* src/tests/omp_get_status_0.c: New file.  Was omp_status_0.c.  Adjust for
	new name.

	* src/tests/omp_status_1.c: Remove.  Rename to omp_get_status_0.c.
	* src/tests/omp_get_status_1.c: New file.  Was omp_status_0.c.  Adjust for
	new name.

	* src/tests/omp_status_2.c: Remove.  Rename to omp_get_status_2.c.
	* src/tests/omp_get_status_2.c: New file.  Was omp_status_2.c.  Adjust for
	new name.

	* src/tests/omp_status_3.c: Remove.  Rename to omp_get_status_3.c.
	* src/tests/omp_get_status_3.c: New file.  Was omp_status_3.c.  Adjust for
	new name.

	* src/tests/omp_status_4.c: Remove.  Rename to omp_get_status_4.c.
	* src/tests/omp_get_status_4.c: New file.  Was omp_status_4.c.  Adjust for
	new name.

	* src/tests/omp_get_report_0.c, src/tests/omp_delete_report_0.c,
	src/tests/omp_get_preferences_1.c, src/tests/omp_modify_task_1.c,
	src/tests/omp_delete_task_0.c, src/tests/omp_get_nvt_details_4.c,
	src/tests/omp_get_rules_1.c, src/tests/omp_delete_task_1.c,
	src/tests/omp_delete_task_2.c, src/tests/omp_get_dependencies_1.c,
	src/tests/omp_get_nvt_feed_checksum_1.c,
	src/tests/omp_get_nvt_details_1.c, src/tests/omp_get_nvt_all_1.c,
	src/tests/omp_modify_report_0.c: Rename all STATUS calls to GET_STATUS.

2009-05-28  Matthew Mundell <matthew.mundell@greenbone.net>

	Rename OMP GET_NVT_FEED_DETAILS to GET_NVT_DETAILS.

	* src/omp.c (help_text, client_state_t, omp_xml_handle_start_element)
	(omp_xml_handle_end_element, omp_xml_handle_text): Rename
	GET_NVT_FEED_DETAILS to GET_NVT_DETAILS.

	* src/tests/CMakeLists.txt: Rename tests to match new command name.

	* src/tests/omp_get_nvt_feed_details_0.c: Remove.  Rename to
	omp_get_nvt_details_0.c.
	* src/tests/omp_get_nvt_details_0.c: New file.  Was
	omp_get_nvt_feed_details_0.c.  Adjust for new name.

	* src/tests/omp_get_nvt_feed_details_1.c: Remove.  Rename to
	omp_get_nvt_details_0.c.
	* src/tests/omp_get_nvt_details_1.c: New file.  Was
	omp_get_nvt_feed_details_0.c.  Adjust for new name.

	* src/tests/omp_get_nvt_feed_details_2.c: Remove.  Rename to
	omp_get_nvt_details_2.c.
	* src/tests/omp_get_nvt_details_2.c: New file.  Was
	omp_get_nvt_feed_details_2.c.  Adjust for new name.

	* src/tests/omp_get_nvt_feed_details_3.c: Remove.  Rename to
	omp_get_nvt_details_3.c.
	* src/tests/omp_get_nvt_details_3.c: New file.  Was
	omp_get_nvt_feed_details_3.c.  Adjust for new name.

	* src/tests/omp_get_nvt_feed_details_4.c: Remove.  Rename to
	omp_get_nvt_details_4.c.
	* src/tests/omp_get_nvt_details_4.c: New file.  Was
	omp_get_nvt_feed_details_4.c.  Adjust for new name.

2009-05-28  Matthew Mundell <matthew.mundell@greenbone.net>

	Rename OMP GET_NVT_FEED_ALL to GET_NVT_ALL.

	* src/omp.c (help_text, client_state_t, omp_xml_handle_start_element)
	(omp_xml_handle_end_element): Rename GET_NVT_FEED_ALL to GET_NVT_ALL.

	* src/tests/CMakeLists.txt: Rename omp_get_nvt_feed_all_0 to
	omp_get_nvt_all_0 and omp_get_nvt_feed_all_1 to omp_get_nvt_all_1.

	* src/tests/omp_get_nvt_feed_all_0.c: Remove.  Rename to
	omp_get_nvt_all_0.c.
	* src/tests/omp_get_nvt_all_0.c: New file.  Was omp_get_nvt_feed_all_0.c.
	Adjust for new name.

	* src/tests/omp_get_nvt_feed_all_1.c: Remove.  Rename to
	omp_get_nvt_all_1.c.
	* src/tests/omp_get_nvt_all_1.c: New file.  Was omp_get_nvt_feed_all_1.c.
	Adjust for new name.

2009-05-28  Matthew Mundell <matthew.mundell@greenbone.net>

	Rename OMP NEW_TASK to CREATE_TASK.

	* src/omp.c (help_text, client_state_t, omp_xml_handle_start_element)
	(omp_xml_handle_end_element, omp_xml_handle_text): Rename NEW_TASK to
	CREATE_TASK.

	* src/tests/CMakeLists.txt: Rename omp_new_task_0 to omp_create_task_0.

	* src/tests/omp_new_task_0.c: Remove.  Rename to omp_create_task_0.c.
	* src/tests/omp_create_task_0.c: New file.  Was omp_new_task_0.c.  Adjust
	for new name.

2009-05-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (help_text): Remove dummy implementation key.

2009-05-28  Matthew Mundell <matthew.mundell@greenbone.net>

	Rename OMP OMP_VERSION to GET_VERSION.

	* src/omp.c (help_text, omp_xml_handle_start_element)
	(omp_xml_handle_end_element): Rename OMP_VERSION to GET_VERSION.

	* src/tests/CMakeLists.txt: Rename omp_version_0 to omp_get_version_0.

	* src/tests/omp_version_0.c: Remove.  Rename to omp_get_version_0.c.
	* src/tests/omp_get_version_0.c: New file.  Was omp_version_0.c.  Adjust
	for new name.

2009-05-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.h (TO_CLIENT_BUFFER_SIZE): Increase, for now.

2009-05-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_get_nvt_feed_details_4.c: Get ID via get_nvt_feed_all
	instead of get_nvt_feed_details.  Remove printing.

2009-05-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (read_protocol): Use the right socket.

2009-05-28  Matthew Mundell <matthew.mundell@greenbone.net>

	Timeout if reading the protocol takes too long.

	* src/openvasmd.c (READ_PROTOCOL_TIMEOUT): New define.
	(protocol_read_t): Add PROTOCOL_TIMEOUT.
	(read_protocol): Timeout if reading takes PROTOCOL_TIMEOUT or longer.
	(serve_client): Handle read_protocol timeout.

	* src/tests/common.c (setup_test): New function.
	* src/tests/common.h (setup_test): New header.

	* src/tests/CMakeLists.txt: Add read_protocol_0.c.

	* src/tests/read_protocol_0.c: New file.

2009-05-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (send_plugin): Correct g_convert charset names.

2009-05-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch to libopenvas nvtis for plugin information.

	* src/manage.c (find_plugin, free_plugin_for_hash_table)
	(make_plugin, free_plugin, make_plugins, free_plugin, make_plugins)
	(free_plugins, plugin_tags, plugins_size, add_plugin)
	(plugin_oid, plugin_name, plugin_category, plugin_copyright)
	(plugin_description, plugin_summary, plugin_family, plugin_version)
	(plugin_cve_id, plugin_bugtraq_id, plugin_xrefs, plugin_fingerprints)
	(set_plugin_oid, set_plugin_name, set_plugin_category)
	(set_plugin_copyright, set_plugin_description, set_plugin_summary)
	(set_plugin_family, set_plugin_version, set_plugin_cve_id)
	(set_plugin_bugtraq_id, set_plugin_xrefs, set_plugin_fingerprints)
	(set_plugin_tags): Remove.
	* src/manage.h: Update headers.

	* src/omp.c: Convert plugin-related calls into nvti equivalents.

	* src/otp.h (server_t): Make plugins an nvtis_t.

	* src/otp.c: Convert plugin-related calls into nvti equivalents.
	(current_plugins, current_plugin): Convert types to nvti equivalents.

	* src/CMakeLists.txt (omp, otp): Add openvas headers dir to compile flags.

2009-05-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Implement OMP GET_NVT_FEED_DETAILS when called to return a specific NVT.

	* src/manage.c (find_plugin): New function.
	* src/manage.h (find_plugin): New header.

	* src/omp.c (client_state_t): Add CLIENT_GET_NVT_FEED_DETAILS_OID.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add GET_NVT_FEED_DETAILS ID handling.
	(send_plugin): Convert strings to UTF-8 for g_markup_escape_text.  Free
	the correct strings.  Correct XML tag.

	* src/omp.h (TO_CLIENT_BUFFER_SIZE): Increase.

	* src/tests/omp_get_nvt_feed_details_2.c,
	src/tests/omp_get_nvt_feed_details_3.c,
	src/tests/omp_get_nvt_feed_details_4.c: New files.

	* src/tests/CMakeLists.txt: Add new tests.

2009-05-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Implement OMP GET_NVT_FEED_DETAILS when called to return all NVTs.

	* src/omp.c (send_plugin): Add a details option.
	(omp_xml_handle_end_element): Add real CLIENT_GET_NVT_FEED_DETAILS
	handling.

	* src/tests/omp_get_nvt_feed_details_0.c: Improve comments.  Use new status
	code.

	* src/tests/omp_get_nvt_feed_details_1.c: Get feed initially.  Check
	response.

	* src/tests/omp_get_nvt_feed_all_1.c: Also check for response status 503.

2009-05-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Implement OMP GET_NVT_FEED_ALL.

	* src/manage.c (plugin_t, plugins_t): New types.
	(plugins_find): New definition.
	(make_plugin, free_plugin, make_plugins, free_plugin, make_plugins)
	(free_plugins, request_plugin_list, plugins_size, add_plugin): New
	functions.
	(plugin_oid, plugin_name, plugin_category, plugin_copyright)
	(plugin_description, plugin_summary, plugin_family, plugin_version)
	(plugin_cve_id, plugin_bugtraq_id, plugin_xrefs, plugin_fingerprints)
	(plugin_tags): New access functions.
	(set_plugin_oid, set_plugin_name, set_plugin_category)
	(set_plugin_copyright, set_plugin_description, set_plugin_summary)
	(set_plugin_family, set_plugin_version, set_plugin_cve_id)
	(set_plugin_bugtraq_id, set_plugin_xrefs, set_plugin_fingerprints)
	(set_plugin_tags): New set functions.
	* src/manage.h: Update headers.

	* src/omp.c (send_plugin): New function
	(SENDF_TO_CLIENT_OR_FAIL): New macro.
	(omp_xml_handle_end_element): Add real CLIENT_GET_NVT_FEED_ALL handling.

	* src/otp.h (server_t): Add plugins.

	* src/otp.c (current_plugin, current_plugins): New variables.
	(init_otp_data): Init plugins.
	(server_state_t): Add PLUGIN_LIST states.
	(parse_server_plugin_list_tags): New function.
	(process_otp_server_input): Add PLUGIN_LIST handling.

	* src/tests/src/tests/omp_get_preferences_0.c,
	src/tests/omp_get_nvt_feed_checksum_0.c,
	src/tests/omp_get_dependencies_0.c:  Correct test numbers in headings.

	* src/tests/omp_get_nvt_feed_all_0.c: Match new response code.

	* src/tests/omp_get_nvt_feed_all_1.c: Get feed initially.  Check response.

2009-05-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Enable real
	CLIENT_GET_NVT_FEED_CHECKSUM implementation.

	* src/tests/omp_get_nvt_feed_checksum_0.c: Use new status code.

	* src/tests/omp_get_nvt_feed_checksum_1.c: Add comparison to expected
	response.

2009-05-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_start_element): Add enclosing tags that were
	missing from certain responses.  Initialise current_uuid in STATUS.

	* src/tasks_sql.h (make_task): Quote uuid in SQL.
	(find_task): Quote uuid in SQL.  Invert return.

	* src/tests/common.c (next_entities, first_entity): New functions.
	(create_task, create_task_from_rc_file, wait_for_task_start)
	(wait_for_task_end, delete_task): Change task ID param to a string.
	(id_string): Remove.
	* src/tests/common.h: Update headers.

	* src/tests/omp_get_report_0.c, src/tests/omp_delete_report_0.c,
	src/tests/omp_start_task_2.c, src/tests/omp_get_preferences_1.c,
	src/tests/omp_modify_task_1.c, src/tests/omp_abort_task_0.c,
	src/tests/omp_delete_task_0.c, src/tests/omp_get_rules_1.c,
	src/tests/omp_start_task_1.c, src/tests/omp_delete_task_1.c,
	src/tests/omp_get_nvt_feed_details_1.c, src/tests/omp_status_2.c,
	src/tests/omp_delete_task_2.c, src/tests/omp_get_dependencies_1.c,
	src/tests/omp_get_nvt_feed_checksum_1.c, src/tests/omp_status_4.c,
	src/tests/omp_start_task_0.c, src/tests/omp_modify_task_0.c,
	src/tests/omp_status_1.c, src/tests/omp_status_0.c,
	src/tests/omp_status_3.c, src/tests/omp_delete_report_1.c,
	src/tests/omp_modify_report_0.c,
	src/tests/omp_get_nvt_feed_all_1.c: Switch to string task IDs.  Match
	response statuses to manager.

2009-05-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (main): Fork into background on start, or stay in
	foreground if -f switch given.

2009-05-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (STATUS_SERVICE_DOWN): New status code.
	(omp_xml_handle_start_element): Initialise current_uuid in operations that
	use it.
	(omp_xml_handle_end_element): Use STATUS_SERVICE_DOWN instead of
	STATUS_INTERNAL_ERROR in CLIENT_GET_PREFERENCES, CLIENT_GET_DEPENDENCIES
	and CLIENT_GET_NVT_FEED_CHECKSUM.  In CLIENT_STATUS adjust the
	current_uuid check to account for the new initial value of current_uuid.

2009-05-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/make_report_id_0.c: Rename make_report_uuid_0.c.
	* src/tests/report_path_task_name_0.c: Rename report_path_task_uuid_0.c.
	* src/tests/report_path_task_name_1.c: Rename report_path_task_uuid_1.c.
	* src/tests/report_path_task_name_2.c: Rename report_path_task_uuid_2.c.

	* src/tests/make_report_uuid_0.c, src/tests/report_path_task_uuid_0.c,
	src/tests/report_path_task_uuid_1.c,
	src/tests/report_path_task_uuid_2.c: Update function names in header
	comments.

	* src/tests/CMakeLists.txt: Update file names.  Remove duplicate entries.

2009-05-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (report_task): Correct variable name.  Move free to after
	last use.

2009-05-20  Matthew Mundell <matthew.mundell@greenbone.net>

	Better match HTTP response codes in response statuses.

	* src/omp.c (STATUS_ERROR_SYNTAX, STATUS_ERROR_MUST_AUTH)
	(STATUS_ERROR_MISSING, STATUS_ERROR_AUTH_FAILED, STATUS_OK)
	(STATUS_OK_CREATED, STATUS_OK_REQUESTED, STATUS_INTERNAL_ERROR): New
	defines.  Use instead of codes in all XML status entities.

2009-05-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (current_task_task_id): Rename current_uuid.  Update callers.

2009-05-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/CMakeLists.txt (OVAS_LDFLAG): Add libopenvas.

2009-05-20  Matthew Mundell <matthew.mundell@greenbone.net>

	Rename make_report_id to make_report_uuid, and report_path_task_name to
	report_path_task_uuid.

	* src/manage.c (make_report_id): Rename to make_report_uuid.  Update
	callers.
	(report_path_task_name): Free task_dir in alternate version.  Rename to
	report_path_task_uuid.  Update callers.
	(make_report_uuid, report_path_task_uuid): New functions.
	* src/manage.h: Update headers.

	* src/tests/report_path_task_name_0.c,
	src/tests/report_path_task_name_1.c, src/tests/report_path_task_name_2.c:
	Update to report_path_task_uuid.

	* src/tests/make_report_id_0.c: Update to make_report_uuid.

2009-05-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/CMakeLists.txt: Remove OPENVAS_USERS_DIR definition added too
	eagerly.

2009-05-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (\mainpage): Add License Information section.

2009-05-20  Matthew Mundell <matthew.mundell@greenbone.net>

	Add task UUIDs.

	* src/tasks_fs.h (task_uuid): New function.
	(task_id_string): Remove.
	(save_tasks, delete_task): Use task_uuid instead of task_id_string.

	* src/tasks_sql.h (task_uuid): New function.
	(task_id_string): Switch to UUID alternative.  Rename task_uuid.
	(make_task): Also insert UUID.
	(save_tasks, delete_task): Use task_uuid instead of task_id_string.
	(find_task): Switch to UUID alternative.

	* src/manage.c (make_task_uuid): New function.
	(create_report_file, delete_reports): Use task_uuid instead of
	task_id_string.

	* src/manage.h: Update headers.

	* src/omp.c: Use task_uuid instead of task_id_string.

2009-05-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Add real authentication.

	* src/manage.c: Include openvas/openvas_auth.h.

	* src/tasks_sql.h (authenticate): Call openvas_authenticate to check
	credentials.

	* src/tasks_fs.h (authenticate): Call openvas_authenticate to check
	credentials.

	* src/manage.h (authenticate): Ajust parameter type.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_AUTHENTICATE respond
	with error code on error.

	* src/CMakeLists.txt (TEMP): Split into LIB_TEMP and HEADER_TEMP.
	(manage): Pass openvas headers.

2009-05-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_delete_task_2.c: Add check of whether removal has been
	requested.

2009-05-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (create_report_file): Use stored start time.

2009-05-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otp.c (process_otp_server_input): In SERVER_TIME_SCAN_END close
	current report after removing report and check if the current report
	still exists before writing to it.

2009-05-18  Matthew Mundell <matthew.mundell@greenbone.net>

	Bring FS based tasks up to date.

	* src/tasks_sql.h (init_manage_process): New function, was init_manage.
	(init_manage): Move body to init_manage_process.  Replace with placeholder
	function.
	(cleanup_manage_process): New function, was cleanup_manage.  Turn off task
	printing.
	(cleanup_manage): Rename cleanup_manage_process.
	(request_delete_task): New function.
	(delete_task): Move some of body to request_delete_task.

2009-05-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_modify_task_1.c: Declare name.  Correct init of name.

2009-05-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (init_omp): Doc return.

	* src/tasks_sql.h (init_manage): Return -1 on error instead of
	aborting.

	* ChangeLog: Add heading to last log.

2009-05-18  Matthew Mundell <matthew.mundell@greenbone.net>

	Ensure that task statuses are consistent on startup.

	* src/openvasmd.c (main): Call init_ompd.

	* src/tasks_sql.h (init_manage_process): New function, was init_manage.
	(init_manage): Move body to init_manage_process.  Replace with function
	that makes database consistent.  Adjust callers.
	(cleanup_manage_process): New function, was cleanup_manage.
	(cleanup_manage): Rename cleanup_manage_process.  Adjust callers.
	* src/manage.h: Update headers.

	* src/omp.c (init_omp, init_omp_process): New functions.
	(init_omp_data): Rename init_omp_process.  Adjust callers.
	* src/omp.h: Update headers.

	* src/ompd.c (init_ompd): New function.
	* src/ompd.h: Update headers.

2009-05-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.h (DO_CHILDREN, id_string): Move back to common.c.

	* src/tests/common.c (DO_CHILDREN, id_string): Move back from common.h.

	* src/tests/omp_modify_task_1.c: Use new ID STATUS return instead of
	searching in STATUS return.

	* ChangeLog: Log last commit.

2009-05-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/Doxyfile (EXTRACT_ALL): Turn off, to enable warnings about
	missing function docs.

2009-05-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/logf.h (LOG_FILE): Change extension to comm, as this file is only
	a log of communication.

	* src/openvasmd.c (main): Create log directory if required.

	* src/CMakeLists.txt: Remove making of log directory from install.

2009-05-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tasks_fs.h, src/tasks_sql.h: Update doc params.

	* src/manage.c (task_run_status_name): Add missing doc.

2009-05-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.c (task_status): New function.

	* src/tests/common.h (task_status): New header.

	* src/tests/omp_delete_task_0.c: Add check of whether removal has been
	requested.

2009-05-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Extend the ID version of OMP
	STATUS to return more task information.

2009-05-15  Matthew Mundell <matthew.mundell@greenbone.net>

	Add an intermediate "delete requested" task state, and delete the task
	only after receiving the SCAN_END message from the server.

	* src/manage.h (task_status_t): Add TASK_STATUS_DELETE_REQUESTED.
	(request_delete_task): New header.
	(delete_task): Update header.

	* src/manage.c (task_run_status_name): Add TASK_STATUS_DELETE_REQUESTED.

	* src/tasks_sql.c (request_delete_task): New function.
	(delete_task): Move request parts to request_delete_task.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_DELETE_TASK call
	request_delete_task instead of delete_task.

	* src/otp.c (process_otp_server_input): In SERVER_TIME_SCAN_END call
	delete_task if a delete was requested.

2009-05-15  Matthew Mundell <matthew.mundell@greenbone.net>

	Add an intermediate "stop requested" task state, and set the task
	to "done" or "stopped" only when receiving the SCAN_END message
	from the server.

	* src/manage.h (task_status_t): Add TASK_STATUS_STOP_REQUESTED and
	TASK_STATUS_STOPPED.
	(task_run_status_name): New header.

	* src/manage.c (stop_task): Replace TASK_STATUS_DONE with
	TASK_STATUS_STOP_REQUESTED.
	(task_run_status_name): New function.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_STATUS use
	task_run_status_name.

	* src/otp.c (process_otp_server_input): In SERVER_TIME_SCAN_END set
	task status to TASK_STATUS_STOPPED if a stop was requested.

2009-05-15  Michael Wiegand <michael.wiegand@greenbone.net>

	Initial set of changes to make Debian packaging work.

	* packaging/debian/compat: New. Sets debhelper compatibility level to
	5.

	* packaging/debian/control: Set dependencies for package.

	* packaging/debian/openvas-manager.dirs: New. Request creation of
	var/lib/openvas/mgr.

	* packaging/debian/openvas-manager.install: New. Request installation of
	the created binary.

	* packaging/debian/rules: Adjusted calls to cmake and make to make the
	package build as expected.

	* src/logf.h: Changed to honour OPENVAS_LOG_DIR because PREFIX might be
	in a different hierarchy than the appropriate place for the log file.

	* src/CMakeLists.txt: Define OPENVAS_LOG_DIR when compiling. Temporarily
	disabled directory creation since it broke Debian packaging; the mkdir
	should use DESTDIR, not CMAKE_INSTALL_PREFIX directly. Changed install
	to honour LIBDIR and BINDIR.

	* CMakeLists.txt: Make it possible to set different prefixes for
	individual directories; this is expected by Debian.

	* src/openvasmd.c: (cleanup) Better NULL guard for fclose since it
	seemed to somehow trigger a segfault in the packaged Debian binary when
	compiled on Lenny.

2009-05-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/new_task_empty_rc, src/tests/new_task_medium_rc: Remove old
	XML wrapper tags.

2009-05-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/new_task_small_rc (CLIENTSIDE_USERRULES): Add two rules.

	* src/manage.c (send_task_rules): New function.
	(start_task): Move required preferences to follow task preferences.
	Enable sending of task rules.

2009-05-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_delete_task_2.c: New file.  Tests removing a running
	task.

	* src/tests/CMakeLists.txt: Add omp_delete_task_2.

2009-05-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otp.c (process_otp_server_input): Clear server_active in
	SERVER_BYE.  (Missing file from 2009-05-13 client exit commit.)

2009-05-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ovas-mngr-comm.c (sendn_to_server): New function.
	(send_to_server): Use sendn_to_server.

	* src/ovas-mngr-comm.h (sendn_to_server): New header.

	* src/manage.c (send_task_preferences): New function.
	(start_task): Send 0 if plugin set is empty.  Send server and plugin
	preferences.

2009-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_status_4.c: Correct test number in comment.

2009-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_start_task_2.c: New file.

	* src/tests/CMakeLists.txt: Add omp_start_task_2.

2009-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Ensure that the manager process continues handling server messages if
	the client exits before the server has finished a running task.

	* src/manage.h (server_active): New header.

	* src/manage.c (server_active): New variable.
	(start_task): Mark server as active after starting task.

	* src/omp.h (server_is_active): New header.

	* src/omp.c (server_is_active): New function.

	* src/ompd.c (serve_omp): If the server is active when the client
	connection closes then only exit after the server is done.

2009-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_modify_task_1.c: Turn off verbosity.

2009-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_modify_task_1.c: New file.

	* src/tests/CMakeLists.txt: Add omp_modify_task_1.

	* src/tests/common.h (id_string): New header.

2009-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.c (DO_CHILDREN): Move to header.

	* src/tests/common.h (DO_CHILDREN): New macro, from common.c.

2009-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_status_3.c: Remove tracing.

2009-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_modify_task_0.c: Improve task name.

	* ChangeLog: Correct last log.

2009-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_status_4.c: Remove tracing.

2009-05-13  Michael Wiegand <michael.wiegand@greenbone.net>

	More post release version bumps for documentation and packaging.

	* doc/Doxyfile, doc/Doxyfile_full, CMakeLists.txt: Set to 0.5.1.SVN.

2009-05-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (cleanup): Check log_stream before closing.

2009-05-12  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* VERSION: Set to 0.5.1.SVN.

2009-05-12  Michael Wiegand <michael.wiegand@greenbone.net>

	* CMakeLists.txt: Added doc/generated to CPACK_SOURCE_IGNORE_FILES.

2009-05-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.c (DO_CHILDREN): Add back (accidentally removed
	yesterday).

2009-05-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/Doxyfile, doc/Doxyfile_full (INPUT): Revert to explicit file list.

	* doc/CMakeLists.txt (DOC_FILES): New variable.
	(.built-html, .built-html_full): Add back dependencies.

	* src/openvasmd.c (manpage): Adjust include for updated Doxyfile
	EXAMPLE_PATH.

2009-05-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/Doxyfile_full: Flush trailing whitespace.

2009-05-12  Michael Wiegand <michael.wiegand@greenbone.net>

	Made generated source code documentation more consistent with the
	documentation generated for other modules.

	* doc/Doxyfile: Adjusted a few settings to be consistent.

	* doc/Doxyfile_full: New. Provides a more complete documentation with
	call graphs and the like.

	* doc/CMakeLists.txt: Adjusted to provide the make doc and doc-full
	targets consistent with the other modules.

2009-05-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Add an OMP HELP command.

	* src/omp.c (help_text): New variable.
	(client_state_t): Add CLIENT_HELP.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add HELP
	handling.

	* src/tests/omp_help_0.c: New file.

	* src/tests/CMakeLists.txt: Add omp_help_0.

2009-05-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Add a verbose flag.

	* src/ovas-mngr-comm.c (verbose): New variable.

	* src/tests/common.c (verbose): New variable.
	(TRACE): Enable.

	* src/openvasmd.c (main): Add verbose flag.

	* src/tracef.h (verbose): New header.
	(tracef): Honour verbose variable.

	* README: Update usage message.

2009-05-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/Doxyfile (INPUT): Add src/tasks_sql.h and src/tasks_fs.h.

	* src/openvasmd.c (\mainpage): Note src/tasks_sql.h and src/tasks_fs.h.

2009-05-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* README: Revert sentence about connecting as though to server.

2009-05-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Address remaining warnings.

	* src/tasks_sql.h (sql_string): Return signed char.  Cast away signs.
	(append_to_task_string): Make "current" signed.
	(free_task): Remove.

	* src/manage.c (print_tasks): Direct out.

2009-05-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otpd.c (serve_otp): Connect to server initially.

2009-05-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (task_plugins): Separate plugins with semicolons.

2009-05-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/Doxyfile (EXTRACT_STATIC): Enable.

	* src/ompd.c (serve_omp): Doc missing params.

	* src/file.c (G_LOG_DOMAIN): Add doc.

	* src/ompd.c (error_send_to_client): Add doc.

	* src/otp.c, src/manage.c: Add missing docs.

2009-05-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/CMakeLists.txt (install): Create PREFIX/var/lib/openvas/mgr/.

2009-05-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_start_element): Correct lengths in
	CLIENT_TOP comparisons.

2009-05-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* README, INSTALL: Update requirements and descriptions.

2009-05-08  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 0.5.0 release.

	* CHANGES: New.

	* VERSION: Set to 0.5.0.

	* CMakeLists.txt: Adjusted version.

2009-05-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/CMakeLists.txt: Add SQLite linkage.  Move tests of support
	libraries before rest.  Order tests alphabetically.

2009-05-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* CMakeLists.txt: Add check for SQLite3 library.

2009-05-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (start_task): Free task_plugins string after use.

2009-05-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (task_plugins): New function.
	(start_task): Request plugins listed in RC file instead of always
	requesting all plugins.
	(task_preference): Correct parsing.

2009-05-08  Matthew Mundell <matthew.mundell@greenbone.net>

	Ensure that the memory allocated in sql_string is always freed.

	* src/manage.h (task_name, task_comment, task_description)
	(task_start_time, task_end_time, task_attack_state): Drop const from
	return type.

	* src/manage.c (task_name, task_comment, task_description)
	(task_start_time, task_end_time, task_attack_state): Drop const from
	return type.
	(print_tasks, create_report_file, task_preference): Free task string
	elements after use.

	* src/tasks_fs.h (task_comment): New function.
	(task_name, task_description, task_start_time, task_end_time)
	(task_attack_state): Return duplicate of task element.

	* src/tasks_sql.h (append_to_task_string): Free return from sql_string
	after use.
	(task_name, task_comment, task_description, task_start_time)
	(task_end_time, task_attack_state): Drop const from return type.

	* src/omp.c (omp_xml_handle_end_element): Free task string elements after
	use.

	* src/otp.c (save_report): Free task_start_time return after use.

2009-05-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ovas-mngr-comm.c (sendf_to_server): New function.

	* src/ovas-mngr-comm.h (sendf_to_server): New header.

	* src/manage.c (task_preference): New function.
	(start_task): Use RC file targets instead of hardcoded target.
	(stop_task): Send STOP_WHOLE_TEST instead of STOP_ATTACK.

2009-05-07  Michael Wiegand <michael.wiegand@greenbone.net>

	* CMakeLists.txt: Added initial support for creating source and binary
	packages with CPack.

2009-05-06  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch to an embedded database for task storage, keeping file
	system based storage as an alternative.

	* src/tasks_fs.h: New file.

	* src/manage.c: Include tasks file according to TASKS_FS.  Move all
	code specific to the task representation to tasks_fs.h
	(report_task): Move the return to a parameter and return an error status.
	Adjust all callers.
	(print_tasks): Make comment and description const.
	(create_report_file, start_task, stop_task): Use task functions for
	accessing and incrementing values, instead of working with the task
	member.

	* src/tasks_sql.h: New file which implements database equivalents of
	the code moved to tasks_fs.h.

	* src/manage.h (init_manage, cleanup_manage, task_comment): New headers.
	(task_t, task_iterator_t): Add defininitions for database tasks.
	(report_task): Update header.
	(task_name, task_description, task_start_time, task_end_time)
	(task_attack_state): Make returns const.

	* src/omp.c: Always cast the NULL task.
	(init_omp_data): Call init_manage.

	* src/otp.c: Always cast the NULL task.

	* src/openvasmd.c (cleanup): Call cleanup_manage.

	* src/CMakeLists.txt (TASKS_CFLAG, TASKS_LDFLAG): New variables for
	controlling task backend.  Add to targets.
	(C_FILES): Add task include files.

2009-04-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Improve the task abstraction by moving parsing of the task ID into
	find_task.  Separate out task code specific to the task representation.

	* src/manage.c: Reorder code to separate out representation-specific
	parts.
	(task_comment): New function.
	(free_task): Free attack_state.
	(make_task): Init start_time and end_time.
	(find_task): Update to take the ID as a string.
	(set_task_parameter): Replace IDENTIFIER parameter with NAME.

	* src/manage.h: Reorder headers.
	(find_task): Adjust header.

	* src/omp.c: Update find_task callers.

2009-04-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Improve the task abstraction by accessing all task fields via functions
	and storing the current report in a global variable instead of in the
	task.

	* src/manage.c (current_report): New variable.
	(task_id, task_name, task_description, set_task_description)
	(task_run_status, set_task_run_status, task_start_time)
	(set_task_start_time, task_end_time, set_task_end_time)
	(task_report_count, task_attack_state, set_task_attack_state)
	(task_debugs_size, inc_task_debugs_size, task_holes_size)
	(inc_task_holes_size, task_infos_size, inc_task_infos_size)
	(task_logs_size, inc_task_logs_size, task_notes_size)
	(inc_task_notes_size): New functions.
	(free_task, make_task, create_report_file): Use new current_report
	variable.

	* src/manage.h: Add new headers.
	(fs_task_t): Remove current_report.

	* src/otp.c, src/omp.c: Use new task access functions and new global
	current_report.

2009-04-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Improve task abstraction by changing task_t to a pointer and adding a
	task iterator.

	* src/manage.h (fs_task_t): New name for task_t.
	(task_t): Change to pointer to fs_task_t.  Update all users.
	(task_iterator_t): New struct.
	(task_count, init_task_iterator, next_task): New headers.
	(tasks_size, tasks, num_tasks): Remove.

	* src/manage.c (task_count, init_task_iterator, next_task): New functions.
	Update all task_t users.

	* src/otp.c: Update all task_t users.

	* src/omp.c: Update all task_t users.
	(omp_xml_handle_end_element): Add tracing and comment to
	CLIENT_DELETE_TASK case.  In CLIENT_STATUS iterate with task iterator.

2009-04-09  Matthew Mundell <matthew.mundell@greenbone.net>

	Write OTP report messages directly to the report on disk, instead of
	buffering the messages in memory.

	* src/manage.h (task_t): Correct run_status type.  Add current_report.
	Remove message arrays.
	(make_task): Adjust annotation.
	(make_report_id): Include in exportlocal annotation.

	* src/manage.c (free_message): Remove.
	(free_task, make_task): Handle current report.  Remove message array
	handling.
	(create_report_file): New function.  Body from src/otp.c save_report.
	(start_task): Create report stream before starting

	* src/otp.c (free_message): Enable.  Take only one arg.
	(write_message): Take stream and type args directly.
	(write_timestamp): Take host arg.
	(save_report): Just close the report stream.
	(append_timestamp): New function.
	(append_debug_message, append_hole_message, append_info_message)
	(append_log_message, append_note_message): Write the message to the report
	stream.
	(process_otp_server_input): Free current_message after appending it.
	Append timestamps in time cases.  In SERVER_DEBUG_OID and SERVER_HOLE_OID
	also check that the current_server_task exists.  Move report saving from
	HOST_END to SCAN_END.

2009-04-09  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/tests/common.c: Added connect_to_manager_host_port, a modification
	of connect_to_manager which allows connections to arbitrary hosts and
	ports. Made connect_to_manager a wrapper around
	connect_to_manager_host_port using OPENVASMD_ADDRESS and OPENVASMD_PORT.

2009-04-08  Matthew Mundell <matthew.mundell@greenbone.net>

	Cleanup and annotate more, from Splint.

	* src/types.h: New file.

	* src/splint.h (g_malloc, g_malloc0, g_ptr_array_add, g_slist_append,
	g_hash_table_destroy): New headers.
	(dirent_pointer_pointer): Remove "out" annotation.

	* src/ompd.h: Turn off exportlocal around server_address.
	(to_client_start, to_client_end): Change to buffer_size_t.

	* src/ompd.c (from_buffer_size, from_client_start, from_client_end,
	from_server_start, from_server_end): Change to buffer_size_t.
	(read_from_server): Remove tracing.  Cast count for += and gnutls_perror.
	Add count assertion.
	(serve_omp): Use buffer_size_t format in tracefs.  Change lastfds and fds
	to uint8_t.  Make fds checks explicitly boolean.  Change initial_start
	to buffer_size_t.

	* src/otp.h: Turn off exportlocal around server.

	* src/otp.c (from_buffer_size): Change to buffer_size_t.
	(tcp_string, udp_string, other_string, empty_string): New variables.
	(port_protocol_name): Return refs to variables instead of strings.  Add
	shared annotation.
	(print_port): Update format specifier for type change.
	(current_message): Add only annotation.
	(make_message): Annotate.  Cast g_malloc return.
	(message_data_t): Annotate members temp.
	(append_debug_message, append_hole_message, append_info_message,
	append_log_message, append_note_message): Annotate message arg keep.
	(current_server_preference, current_server_plugin_dependency_name)
	(current_server_plugin_dependency_dependencies): Annotate only.
	(add_server_preference,
	append_to_current_server_plugin_dependency): Annotate args keep.
	(add_server_plugins_dependency): Annotate args keep.  Make assert
	explicitly boolean.
	(finish_current_server_plugin_dependency): Make assert explicitly
	boolean.
	(free_rule): Annotate rule arg.  Check rule before freeing.
	(add_server_rule): Change arg annotation to keep.
	(from_server_start, from_server_end): Change to buffer_size_t.
	(parse_server_preference_value, parse_server_preference_value): Make
	assert explicitly boolean. Cast char for memchr.
	(parse_server_plugin_dependency_dependency, parse_server_server): Make
	from_start and from_end buffer_size_t.  Annotate dependent variables.
	Correct <|> checks.
	(sync_buffer): Use buffer_size_t format in tracef.
	(process_otp_server_input): Make from_start and from_end size_t.
	Annotate dependent variables.  Cast char for memchr.  Ensure pointer
	comparisons are explicitly boolean.  Use g_malloc0 instead of g_newa.

	* src/manage.h: Turn off exportlocal around report_path_task_name and
	report_task.
	(set_task_parameter): Add null annotation to arg.
	(port_t): Add unsigned to type of number.

	* src/manage.c (set_task_parameter): Fail if value is NULL.
	(start_task): Send ntp_opt_show_end "no".
	(grow_description): Remove tracing.
	(append_task_open_port): Check task->open_ports before use.  Cast away
	g_array_append_val return.

	* src/ovas-mngr-comm.c (end_session): Pass fcntl a long zero.  Handle
	gnutls_bye return.
	(to_server_buffer_space): Check end and start before use.  Cast return.
	(connect_to_server): Cast socklen_t for fprintf and size_t for
	gnutls_perror.  Use z modifier for size_t tracef.

	* src/omp.h (to_client_start, to_client_end): Change type to buffer_size_t.

	* src/omp.c (to_client_start, to_client_end): Change type to buffer_size_t.
	(current_client_task): Add dependent annotation.
	(xml_context): Initialise.
	(SEND_TO_CLIENT): Remove.
	(send_to_client, error_send_to_client): New functions.
	(SEND_TO_CLIENT_OR_FAIL): New macro.
	(omp_xml_handle_start_element, send_requirement, send_dependency,
	send_preference, send_rule, send_reports): Replace old SEND_TO_CLIENT macro
	with new functions.
	(omp_xml_handle_end_element): Use SEND_TO_CLIENT_OR_FAIL and new send
	functions instead of SEND_TO_CLIENT.  Always check current_task_task_id
	before use.  Change pointer comparisons to be explicitly boolean.
	(from_client_start, from_client_end): Change to buffer_size_t.
	(init_omp_data): Free xml_context before setting it.
	(process_omp_client_input): Check xml_context before use.

	* src/otpd.c (from_buffer_size, from_client_start, from_client_end,
	from_server_start, from_server_end): Change to buffer_size_t.
	(serve_otp): Use buffer_size_t format for tracef.  Make fds checks
	explicitly boolean.  Change initial_start to buffer_size_t.  Cast count
	for gnutls_perror.

	* src/openvasmd.c (from_buffer_size, from_client_start, from_client_end,
	from_server_start, from_server_end): Change to buffer_size_t.
	(read_protocol): Pass fcntl a long zero.

2009-04-07  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* CMakeLists.txt, doc/CMakeLists.txt, doc/openvasmd.8.xml,
	src/CMakeLists.txt, src/file.c, src/file.h, src/logf.h,
	src/manage.c, src/manage.h, src/omp.c, src/omp.h, src/ompd.c,
	src/ompd.h, src/openvasmd.c, src/otp.c, src/otp.h, src/otpd.c,
	src/otpd.h, src/ovas-mngr-comm.c, src/ovas-mngr-comm.h, src/splint.h,
	src/string.c, src/string.h, src/task.h, src/tracef.h,
	src/tests/CMakeLists.txt, src/tests/common.c, src/tests/common.h,
	src/tests/make_report_id_0.c, src/tests/omp_abort_task_0.c,
	src/tests/omp_delete_report_0.c, src/tests/omp_delete_report_1.c,
	src/tests/omp_delete_task_0.c, src/tests/omp_delete_task_1.c,
	src/tests/omp_get_dependencies_0.c, src/tests/omp_get_dependencies_1.c,
	src/tests/omp_get_nvt_feed_all_0.c, src/tests/omp_get_nvt_feed_all_1.c,
	src/tests/omp_get_nvt_feed_checksum_0.c, src/tests/omp_get_nvt_feed_checksum_1.c,
	src/tests/omp_get_nvt_feed_details_0.c, src/tests/omp_get_nvt_feed_details_1.c,
	src/tests/omp_get_preferences_0.c, src/tests/omp_get_preferences_1.c,
	src/tests/omp_get_report_0.c, src/tests/omp_get_rules_0.c,
	src/tests/omp_get_rules_1.c, src/tests/omp_modify_report_0.c,
	src/tests/omp_modify_task_0.c, src/tests/omp_new_task_0.c,
	src/tests/omp_start_task_0.c, src/tests/omp_start_task_1.c,
	src/tests/omp_status_0.c, src/tests/omp_status_1.c,
	src/tests/omp_status_2.c, src/tests/omp_status_3.c,
	src/tests/omp_status_4.c, src/tests/omp_version_0.c,
	src/tests/report_path_task_name_0.c, src/tests/report_path_task_name_1.c,
	src/tests/report_path_task_name_2.c, src/tests/rmdir_recursively_0.c,
	src/tests/rmdir_recursively_1.c, src/tests/strip_space_0.c,
	src/tests/strip_space_1.c, src/tests/strip_space_2.c,
	src/tests/strip_space_3.c, packaging/debian/copyright:
	Transferred Copyright from Intevation to Greenbone Networks.

2009-04-01  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* packaging/debian/control: Lower dependecy for debhelper from 6 to 5.

	* packaging/debian/changelog: New. A initial stub.

	* packaging/debian/copyright: New.

	* packaging/debian/rules: New. Initial version, not fully functional yet.

2009-04-01  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/tests/CMakeLists.txt: Added missing GLIB_CFLAGS to target properties.

2009-03-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.c (env_authenticate): Remove RATS annotation.

2009-03-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_delete_task_0.c: Test by checking status instead of
	counting tasks.

2009-03-31  Matthew Mundell <matthew.mundell@greenbone.net>

	Cleanup and annotate, from Splint.  Comment RATS annotations.

	* src/CMakeLists.txt (splint): Switch to +unixlib.

	* src/splint.h: Add page headings.
	(gerrorpointer): New type.
	(g_error_free, g_ptr_array_free, g_file_set_contents,
	g_build_filename): New headers.
	(g_base64_decode): Correct return type.
	(strncasecmp, symlink): Remove.
	(scandir): Annotate filter arg.  "allocate" instead of "define" *namelist.

	* src/ompd.c (serve_omp): Set fds to a char.

	* src/manage.h (task_t): Annotate open_ports.
	(delete_task): Change arg type to **.

	* src/omp.c (omp_xml_handle_end_element): Use new delete_task arg type
	in CLIENT_DELETE_TASK.

	* src/ovas-mngr-comm.c: Remove socklen_t typedef.
	(write_to_server_buffer): Cast size for gnutls_record_send.

	* src/openvasmd.c (main): Comment RATS annotations.

	* src/manage.c (make_report_id): Check id before freeing.
	(grow_tasks): Comment RATS annotation.
	(free_task): Complete "releases" annotation.  Check task->description
	before freeing.  Turn off "branchstate" around free_task.
	(only_dirent_pointer): New type.
	(load_tasks_free, save_task_error): New functions.
	(load_tasks): Check names after scandir.  Call a shared cleanup function
	instead of jumping.  Free file_name at the end of each task iteration.
	(save_task): Call a shared cleanup function instead of jumping.  Check
	task->description before using it.
	(set_task_parameter): Annotate value arg.  Check parameter for tracef.
	Fail if parameter is NULL.  Check values before freeing them.  Always free
	value.
	(delete_reports): Initialise names.
	(delete_task): Take a pointer to the task pointer.  Set the task pointer
	NULL before successfully returning.
	(append_to_task_comment, append_to_task_identifier): Free task member
	before assigning.  strdup to a temp for Splint.
	(grow_description): Comment RATS annotation.  Change tracef specifier.
	(add_task_description_line): Compare return to integer.

2009-03-30  Matthew Mundell <matthew.mundell@greenbone.net>

	Cleanup and annotate, from Splint.

	* src/otp.c: Include unistd.h and splint.h.
	(set_message_description, set_message_oid,
	append_to_current_server_plugin_dependency): Annotate.  Describe freeing of args.
	(write_messages): Add whitespace.
	(save_report): Check make_report_id return.  Cast away rmdir and unlink
	returns in error cases.
	(maybe_free_server_preferences,
	maybe_free_server_plugins_dependencies,
	maybe_free_current_server_plugin_dependency): Remove.
	(make_server_preferences): Free preferences first.
	(add_server_preference, make_current_server_plugin_dependency): Annotate
	args.
	(make_server_plugin_dependencies): Free dependencies first.
	(free_rule): Annotate args.  Cast away g_ptr_array_free rule.
	(add_server_rule): Annotate args.
	(init_otp_data): Clear plugins_md5.
	(parse_server_plugin_dependency_dependency): Return gboolean instead of
	int.  Annotate args.  Cast char for memchr.
	(parse_server_server): Annotate args and vars.  Cast char for memchr.
	Remove call to make_server_plugins_dependencies.
	(process_otp_server_input): Annotate vars.  Initialise match.  Free
	server.plugins_md5 before setting.  Remove call to
	maybe_free_server_preferences.

	* src/otpd.c (from_buffer_size): Change int to size_t.
	(serve_otp): Change fds to a short.

	* src/openvasmd.c (from_buffer_size, from_client_start, from_server_start,
	from_server_end): Change types to size_t.

2009-03-30  Matthew Mundell <matthew.mundell@greenbone.net>

	Cleanup and annotate, from Splint.

	* src/omp.h: Include sys/types.h.
	(to_client_start, to_client_end): Change type to size_t.

	* src/omp.c: Include splint.h.
	(to_client_start, to_client_end): Change type to size_t.
	(current_task_task_id, modify_task_parameter, modify_task_value,
	xml_context, send_requirement, send_preference,
	omp_xml_handle_error): Annotate.
	(send_dependency): Annotate.  Free msg.
	(SEND_TO_CLIENT): Cast TO_CLIENT_BUFFER_SIZE to size_t.
	(omp_xml_handle_start_element): Annotate arguments.  Check save_task
	return.
	(send_reports): Change return to int.
	(omp_xml_handle_end_element): Annotate.  In CLIENT_GET_REPORT case
	check for credentials username and check g_file_get_contents return
	directly.  In CLIENT_STATUS cast send_reports return and free reponse.
	(omp_xml_handle_text): Annotate args.  Use append_text instead of
	append_string.
	(process_omp_client_input): Check g_markup_parse_context_parse return
	directly.  Check error before using.

	* src/ovas-mngr-comm.c: Change Splint socklen_t to typedef.  Include
	splint.h.
	(end_session): Return success if shutdown error is ENOTCONN.
	(write_string_to_server): Cast gnutls_record_send arg.

2009-03-30  Matthew Mundell <matthew.mundell@greenbone.net>

	Cleanup and annotate, from Splint.

	* src/ompd.h: (to_client_start, to_client_end): Change to size_t.

	* src/ompd.c: Define socket for Splint.
	(read_from_client, read_from_server): Mark alert_name dependent.
	(write_to_client): Cast count for tracef.
	(serve_omp): Note old functions.  Use a single ret variable.  Check the
	return from end_session.

	* src/string.h (string): New type.
	(append_text): New function.
	(append_string): Use string.
	(strip_space): Annotate.

	* src/string.c (append_text): New function.
	(append_string): Change chars to gchars.
	(free_string_var): Chage var type to string.

	* src/file.c (G_LOG_DOMAIN): New define.
	(g_propagate_error, g_set_error, g_dir_close): New annotated headers for
	Splint.
	(rmdir_recursively): Annotate g_return_val_if_fail call.  Check return
	from g_dir_open directly, and on failure check that temp_error is set.
	Remove duplicate cleanup calls.

2009-03-30  Matthew Mundell <matthew.mundell@greenbone.net>

	Cleanup and annotate, from Splint.

	* src/splint.h: New file.

	* src/manage.h (credentials_t): Null annotate username and password.
	(task_t): Change types to gsize.  Annotate description.
	(tasks, task_id_string, make_task, find_task, set_task_parameter,
	make_report_id, report_task): Annotate.
	(add_task_description_line): Change int to size_t.

	* src/manage.c: Include splint.h.
	(append_to_credentials_username, append_to_credentials_password): Use
	append_text.
	(make_report_id): Doc fail return.  Init uuid.  Check returns.
	(report_task): Check that username is set.  Free link_name afterwards.
	(delete_report): Check that username is set.  Check error before use.
	Free link_name is fail case.
	(set_report_parameter): Check that username is set.  Check return of
	g_file_set_contents directly.  Check error before use.
	(tasks): Annotate.
	(task_id_string): Use snprintf instead of sprintf.
	(print_tasks): Check index before use.
	(grow_tasks): Change return to boolean.  Turn off checks around realloc
	and return.  Change memset arg to int.  Correct tracef directive.
	(free_message): Annotate args.
	(free_task): Annotate args.  Cast for tracef.  Cast away g_ptr_array_free
	returns.
	(free_tasks): Check tasks first.
	(make_tasks): Free name and comment on failure.  Add safety check on
	tasks.  Cast for id.  Turn off checks around assignments.  Correct tracef
	directive.
	(load_tasks): Init names and comment.  Free names[index] for hidden files.
	Check g_file_get_contents return directly.  Check error before use.
	Remove freeing of name and comment on failure, as now done in make_task.
	(save_task): Check g_file_get_contents return directly.  Check error before
	use.  Use snprintf instead of sprintf.
	(save_tasks): Free dir_name.
	(find_task): Check tasks before using.  Compare to NULL explicitly.
	(set_task_parameter): Check parameter before use.
	(start_task): Cast away g_array_free return.  Cast size for g_array_new.
	(delete_reports): Anotate var.  Free names[index] for hidden files.
	(delete_task): Check return from rmdir_recursively directly.  Check error
	before use.
	(append_to_task_comment): Annotate arg.  Return integer explicitly.
	(append_to_task_identifier): Annotate arg.  Free task->name.  Return
	integer explicitly.  Correct return value.
	(grow_description): Change new_size to size_t.  Cast char for memset.
	(add_task_description_line): Use return from g_array_append_val.

2009-03-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.c (env_authenticate): Add "RATS: ignore" for getenv.

2009-03-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/CMakeLists.txt: Add omp_delete_report_1.

2009-03-28  Matthew Mundell <matthew.mundell@greenbone.net>

	Start implementing splint and RATS cleanups.

	* src/ovas-mngr-comm.h (end_session): Correct return type.
	(connect_to_server): Change argument "interrupted" to a gboolean.

	* src/ovas-mngr-comm.c: Define socklen_t for splint.  Include glib.
	Declare global vars static.  Move all local vars to beginnings of blocks.
	(make_session): Cast some returns to please splint.
	(send_to_server): Use memmove instead of memcpy, just to be sure.
	(connect_to_server): Change argument "interrupted" to a gboolean.  Cast
	the sizeof return to match the ret_len type.

	* src/otp.c: Define PREFIX.  Declare functions and vars static.  Move
	all local vars to beginnings of blocks.  Annotate most global vars as
	null.
	(process_otp_server_input): Add fallthrough to SERVER_INIT_SENT_VERSION
	case.

	* src/otpd.c: Move all local vars to beginnings of blocks.
	(serve_otp): Annotate reach.

2009-03-28  Matthew Mundell <matthew.mundell@greenbone.net>

	Start implementing splint and RATS cleanups.

	* src/manage.h (append_to_credentials_username): Change third arg to
	gsize.
	(current_server_task): Annotate as null.

	* src/manage.c: Define g_free with annotation for splint.  Include
	string and strings.  Define PREFIX.  Declare functions and vars static.
	Move all local vars to beginnings of blocks.  Annotate global vars as null.
	(append_to_credentials_username, append_to_credentials_password): Append
	with append_string.
	(report_path_task_name): Change type of path2_length to size_t.
	(print_tasks): Use standard ternary format.
	(grow_tasks): Add "RATS: ignore" to realloc.
	(grow_description): Add "RATS: ignore" to realloc.  Clear new memory.

	* src/file.c: Declare fchdir for splint.  Move all local variable
	declarations to beginnings of blocks.
	(rmdir_recursively): Cast variables to quiet splint.

	* src/string.h (append_string, free_string_var): Drop arg names.
	(strip_space): Annotate return as shared.

2009-03-28  Matthew Mundell <matthew.mundell@greenbone.net>

	Start implementing splint and RATS cleanups.

	* src/openvasmd.c: Conditionalise some includes for splint.  Correct
	the openvas includes.
	(cleanup): Move the OMP freeing note to src/ompd.c.
	(handle_signal): Remove.
	(handle_sigint, handle_sighup, handle_sigterm): New functions.
	(main): Separate signal handlers.

	* src/omp.c: Define PREFIX.  Declare functions and vars static.
	Annotate global null vars.  Move all local vars to beginnings of
	blocks.
	(send_reports): Correct freeing of msg and names.
	(omp_xml_handle_end_element): Add block for CLIENT_NEW_TASK case.  Free
	response in CLIENT_STATUS case.

	* src/ompd.c: Declare functions and vars static.  Move all local
	variable declarations to beginnings of blocks.  Add missing includes.
	(read_from_client, read_from_server, write_to_client): Cast variables
	to quiet splint.  Annotate dummy arguments.
	(write_to_server): Annotate fallthrough cases.
	(serve_omp): Add OMP freeing note from src/openvasmd.c.  Cast
	variables.

2009-03-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/logf.h: Include stdlib.
	(logf): Cast getpid return.  Check fflush return.

	* src/tracef.h: Include stdlib.
	(tracef): Cast getpid return.  Check fflush return.

2009-03-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/CMakeLists.txt (splint, rats, flawfinder, check, etags, ctags,
	tags): New targets.
	(ovas-mngr-comm): Add Glib C flags.

2009-03-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_delete_task_1.c: Read report ID from response.

2009-03-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Always respond to the client,
	in CLIENT_DELETE_REPORT.

	* src/tests/omp_delete_report_1.c: New test.  Tests DELETE_REPORT with
	empty ID.

2009-03-24  Matthew Mundell <matthew.mundell@greenbone.net>

	Add more tests.

	* src/tests/make_report_id_0.c, src/tests/omp_delete_task_1.c,
	src/tests/omp_get_dependencies_0.c, src/tests/omp_get_dependencies_1.c,
	src/tests/omp_get_nvt_feed_all_0.c, src/tests/omp_get_nvt_feed_all_1.c,
	src/tests/omp_get_nvt_feed_checksum_0.c,
	src/tests/omp_get_nvt_feed_checksum_1.c,
	src/tests/omp_get_nvt_feed_details_0.c,
	src/tests/omp_get_nvt_feed_details_1.c,
	src/tests/omp_get_preferences_0.c, src/tests/omp_get_preferences_1.c,
	src/tests/omp_delete_report_0.c, src/tests/omp_get_report_0.c,
	src/tests/omp_get_rules_0.c, src/tests/omp_get_rules_1.c,
	src/tests/omp_modify_report_0.c, src/tests/omp_start_task_1.c,
	src/tests/omp_status_1.c, src/tests/omp_status_2.c,
	src/tests/omp_status_3.c, src/tests/omp_status_4.c,
	src/tests/report_path_task_name_0.c, src/tests/report_path_task_name_1.c,
	src/tests/report_path_task_name_2.c: New tests.

	* src/tests/CMakeLists.txt: Add rules for new tests.

2009-03-21  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch to universal report identifiers.

	* src/manage.h (make_report_id, report_path_task_name, report_task): New
	headers.

	* src/manage.c (make_report_id, report_path_task_name, report_task): New
	functions.
	(delete_report, set_report_parameter): Switch to UUIDs.

	* src/omp.c (send_reports): Switch to UUIDs.  Free all names on send fail.
	(omp_xml_handle_end_element): Switch to UUIDs for reports.  Correct
	response tag in CLIENT_GET_REPORTS.

	* src/otp.c (save_report): Switch to UUIDs.

	* src/CMakeLists.txt: Add -lossp-uuid to openvasmd.

2009-03-20  Matthew Mundell <matthew.mundell@greenbone.net>

	Add a task status enumeration.  Rename task_t running slot to run_status.

	* src/manage.h (task_status_t): New type.
	(task_t): Rename running to run_state.

	* src/manage.c (make_task, start_task, stop_task): Use new task status
	enum.

	* src/omp.c (omp_xml_handle_end_element): Use new task status enum.

	* src/otp.c (process_otp_server_input): Use new task status enum.

2009-03-20  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* packaging/: New.

	* packaging/debian: New.

	* packaging/debian/control: New. First approaches for
	Debian packaging.

2009-03-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Add per-report directories.  Add initial OMP MODIFY_REPORT.

	* src/omp.c (client_state_t): Add MODIFY_REPORT states.
	(omp_xml_handle_start_element, omp_xml_handle_text): Add MODIFY_REPORT
	 handling.
	(omp_xml_handle_end_element): In CLIENT_GET_REPORT get the report from the
	report's directory.  Add MODIFY_REPORT handling.

	* src/otp.c (save_report): Save report to a dedicated directory.

	* src/manage.h (set_report_parameter): New header.

	* src/manage.c (set_report_parameter): New function.
	(delete_report): Account for per-report directory.

2009-03-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Update OTP BYE handling for reconnecting to the server during an OMP
	session.

	* src/openvasmd.c (serve_client): Move session creation and freeing to
	src/ovas-mngr-comm.c.
	(serve_client): Pass server_socket pointer to serve_omp.

	* src/ovas-mngr-comm.c (make_session, end_session): New functions, from
	src/openvasmd.c.
	(connect_to_server): Improve message slightly.

	* src/ovas-mngr-comm.h (make_session, end_session): New headers.

	* src/ompd.c (serve_omp): Take a pointer to the server socket instead
	of the server socket.  On receiving server BYE recreate the server
	socket and session.

	* src/ompd.h (serve_omp): Add arguments.

	* src/otp.c (process_otp_server_input): Read over whitespace at start of
	SERVER_INIT_SENT_VERSION.  In SERVER_BYE add success case and correct the
	"need more input" return value.

2009-03-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ompd.c (serve_omp): Revert bogus typo correction.

2009-03-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Free name in CLIENT_GET_REPORT
	case.

2009-03-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (send_reports): Use scandir's report_name directly, instead
	of wrapping it in a g_path_get_basename.

2009-03-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (delete_report): Add @return doc.

	* ChangeLog: Fixup pathnames for today's entries.

2009-03-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Reactivate BYE-initiated server socket shutdown.

	* src/otp.c (process_otp_server_input): Return a unique value on receiving
	BYE.

	* src/ompd.c (serve_omp): Shutdown server socket according to
	process_otp_server_input return.

2009-03-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ompd.c (serve_omp): Correct typo and formatting.

2009-03-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (stop_task, start_task): Correct conditions of running checks.

2009-03-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Ensure that delete_task also removes the symlinks to the directory of
	all the user's reports.

	* src/manage.h (delete_report): Add const to arg.

	* src/manage.c (delete_report): Add const to arg.
	(delete_reports): New function.
	(delete_task): Call delete_reports to delete reports.

2009-03-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Move report deleting into manage library.

	* src/manage.c (delete_report): New function.

	* src/manage.h (delete_report): New header.

	* src/omp.c (omp_xml_handle_end_element): Use new function delete_report.

2009-03-12  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP DELETE_REPORT.

	* src/otm.c (client_state_t): Add DELETE_REPORT states.
	(omp_xml_handle_start_element, omp_xml_handle_end_element,
	omp_xml_handle_text): Add DELETE_REPORT handling.

2009-03-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otp.c (save_report): Move the actual report into the task directory.

2009-03-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Add per-user reports directories.

	* src/otp.c (save_report): Save the report to the report directory of the
	user and link the report to the task directory, instead of saving to the
	task directory.

	* src/omp.c (omp_xml_handle_end_element): Get the report from the user
	report directory instead of the task directory.  Ensure the report name
	has the right format.  Free content_error.  Free current_task_task_id in
	the fail case.

2009-03-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (output_reports_xml): Rename to send_reports.
	(send_reports): Rename from output_reports_xml.  Add doc.

2009-03-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (client_state_t): Add GET_REPORT states.
	(omp_xml_handle_start_element, omp_xml_handle_end_element,
	omp_xml_handle_text): Add GET_REPORT handling.

2009-03-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.c (wait_for_task_end): New function.

	* src/tests/common.h (wait_for_task_end): New header.

2009-03-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (output_reports_xml): New function.
	(omp_xml_handle_end_element): Add reports to STATUS response
	in case where STATUS is given a task ID.

2009-03-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otp.c (process_otp_server_input): Add "done" task state.

	* src/omp.c (omp_xml_handle_end_element): Add "done" task state.

2009-03-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (delete_task): Correct error check.

2009-03-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Add "Requested" task running state.  Correct STATUS_RESPONSE tags and
	CLIENT_MODIFY_TASK variable usage.

	* src/otp.c (process_otp_server_input): Update task running state
	on receiving SCAN_START.

	* src/omp.c (omp_xml_handle_end_element): Add printing of new running
	state.  Rename TASK_STATUS entity in TASK in STATUS_RESPONSE to STATUS.
	Correct STATUS_RESPONSE closing tags.  In CLIENT_MODIFY_TASK case
	use local var instead of setting current_client_task.

	* src/manage.h (task_t): Note new running state.

2009-03-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.c: Turn off some tracing.
	(DO_CHILDREN, id_string, wait_for_task_start, delete_task): New functions.

	* src/tests/common.h (delete_task, wait_for_task_start): New headers.

	* src/tests/omp_abort_task_0.c, src/tests/omp_start_task_0.c,
	src/tests/omp_modify_task_0.c, src/tests/omp_modify_task_0.c: Wait for
	server with wait_for_task_start.  Delete task on exit.

2009-03-01  Matthew Mundell <matthew.mundell@greenbone.net>

	Reduce number of gotos.

	* src/ompd.c (read_from_server): Retry with while instead of goto.

	* src/omp.c (send_dependency): Move SEND_TO_CLIENT destination to end
	of function.
	(omp_xml_handle_end_element): Neaten indentation.

	* src/openvasmd.c (read_protocol): Retry with while instead of goto.

	* src/otp.c (parse_server_done, parse_server_preference_value,
	parse_server_rule, parse_server_plugin_dependency_dependency,
	parse_server_server, sync_buffer): New functions.
	(process_otp_server_input): Call new parsing and sync functions instead
	of jumping.  Return immediately instead of jumping to fail code.  Use
	g_strdup instead of strdup.  Drop make_message return checks.

	* src/manage.c (load_tasks, save_task): Move fail destinations to ends
	of functions.

2009-02-28  Matthew Mundell <matthew.mundell@greenbone.net>

	Add env_authenticate and use it in tests.

	* src/tests/common.c: Reorder functions.
	(env_authenticate): New function.

	* src/tests/common.h: Reorder headers.
	(env_authenticate): New header.

	* src/tests/omp_new_task_0.c, src/tests/omp_version_0.c,
	src/tests/omp_delete_task_0.c, src/tests/omp_abort_task_0.c,
	src/tests/omp_start_task_0.c, src/tests/omp_modify_task_0.c,
	src/tests/omp_status_0.c: Use env_authenticate instead of authenticate.

2009-02-28  Matthew Mundell <matthew.mundell@greenbone.net>

	Start separating the implementation into components.

	* src/openvasmd.c: Move most functions and variables out to new files.
	Improve implementation notes in @file.
	(free_g_ptr_array): Remove old function.
	(OMP): Remove old directive.
	(BUFFER_SIZE): Rename FROM_BUFFER_SIZE.
	(from_buffer_size): New variable.

	* src/logf.h, src/manage.c, src/manage.h, src/otp.c, src/otp.h, src/omp.c,
	src/omp.h, src/ompd.c, src/ompd.h, src/otpd.c, src/otpd.h: New files.

	* src/tracef.h (TRACE, TRACE_TEXT): New directive, previously in
	openvasmd.c.

	* src/file.c: Include unistd.h.

	* src/string.c (free_string_var, append_string): New functions, previously
	in openvasmd.c.

	* src/string.h (free_string_var, append_string): New headers.

	* src/ovas-mngr-comm.c (write_string_to_server, write_to_server_buffer):
	New functions, previously in openvasmd.c.
	(to_server_buffer_space): New function.
	(BUFFER_SIZE): Rename TO_SERVER_BUFFER_SIZE.

	* src/ovas-mngr-comm.h (write_string_to_server, write_to_server_buffer,
	to_server_buffer_space): New headers.

	* src/CMakeLists.txt: Build new libraries.

	* src/tests/CMakeLists.txt: Add GLIB path to strip_space LDFLAGS.

	* doc/CMakeLists.txt (.build-html): Add new files.

	* doc/Doxyfile (INPUT): Add new files.

2009-02-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Update commands to clear current_task_task_id after use.

	* src/openvasmd.c (free_string_var, append_string): New functions.
	(omp_xml_handle_start_element): Leave clearing of current_task_task_id
	to omp_xml_handle_end_element.
	(omp_xml_handle_end_element): Free current_task_task_id after use.
	(omp_xml_handle_text): Append to string variables with append_string.
	(serve_omp): Note exit behaviour.

2009-02-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Use shared functions for starting tasks.  Authenticate only once per
	session, for now.

	* src/tests/common.c (sendf_to_manager, start_task): New functions.

	* src/tests/common.h (sendf_to_manager, start_task): New headers.

	* src/tests/omp_abort_task_0.c: Use start_task.  Send actual task ID.
	Authenticate once per session.

	* src/tests/omp_delete_task_0.c: Improve task name.

	* src/tests/omp_start_task_0.c: Authenticate once.

	* src/tests/omp_modify_task_0.c: Improve task name.  Authenticate once.
	Send actual task ID.

	* src/tests/omp_status_0.c: Use start_task.  Authenticate once.

2009-02-22  Matthew Mundell <matthew.mundell@greenbone.net>

	Cleanup docs.  Neaten XML strings.  Rename XML_RESPOND to
	SEND_TO_CLIENT.  Update load_tasks to loop through dirs forwards
	instead of sorting dirs backwards.

	* src/openvasmd.c: Cleanup docs.  Neaten XML strings.
	(ahplasort): Remove.
	(load_tasks): Loop through dirs forwards instead of sorting backwards.
	(set_task_parameter): Add const to parameter argument.
	(XML_RESPOND): Remove, rename SEND_TO_CLIENT.
	(SEND_TO_CLIENT): New macro, previously XML_RESPOND.
	(omp_xml_handle_end_element): Move OMP_VERSION_RESPONSE attribute to
	entity.

	* src/ovas-mngr-comm.c: Correct doc typos.

	* src/tests/common.c: Cleanup docs.  Add @file doc.

	* src/tests/omp_version_0.c: Move expected attribute to entity.

	* doc/CMakeLists.txt: Run Doxygen in top-level dir to get relative paths.

	* doc/Doxyfile: Adjust paths for running in top-level dir.

2009-02-21  Matthew Mundell <matthew.mundell@greenbone.net>

	Add Base64 task file handling.  Add new library with function
	rmdir_recursively.  Add tests of rmdir_recursively.  Update DELETE_TASK
	to remove the task directory on disk.  Update tests to use shared
	functions for creating tasks.

	* src/file.h, src/file.c, src/tests/new_task_empty_rc,
	src/tests/new_task_medium_rc, src/tests/new_task_small_rc,
	src/tests/rmdir_recursively_0.c, src/tests/rmdir_recursively_1.c: New
	files.

	* src/openvasmd.c: Include new file library.
	(free_task): Reduce tracing.
	(save_tasks): Add a comment.
	(modify_task): Remove, was for old OMP spec.
	(set_task_parameter): Clarify doc.  Add base64 task file handling.
	(delete_task): Update to remove task directory.
	(omp_xml_handle_end_element): Add base64 task file handling.
	(serve_client): Enable cipher and mac.

	* src/CMakeLists.txt: Add file library.

	* src/tests/CMakeLists.txt: Add tests rmdir_recursively_0 and
	rmdir_recursively_1.

	* src/tests/common.c (create_task_from_rc_file, create_task): New
	functions.
	(add_entity): Clarify doc.
	(compare_entities): Add NULL checks.  Correct typo.

	* src/tests/common.h (create_task_from_rc_file, create_task): New headers.

	* src/tests/omp_start_task_0.c, src/tests/omp_status_0.c: Use
	create_task_from_rc_file.  Read task description from file instead of var.

	* src/tests/omp_modify_task_0.c: Use create_task.

	* src/tests/omp_new_task_0.c: Neaten XML string.  Get and use actual task
	ID.

	* src/tests/omp_delete_task_0.c: Use create_task_from_rc_file.

2009-02-20  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP AUTHENTICATE.  Remove handling of first OMP specification.

	* src/openvasmd.c (credentials, login, process_omp_old_client_input,
	RESPOND): Remove.
	(client_state_t): Add authentication states.
	(credentials_t): New type.
	(current_credentials): New variable.
	(append_to_credentials_password, append_to_credentials_username,
	authenticate, free_credentials): New functions.
	(tasks): Clarify doc.
	(load_tasks): Return if tasks already loaded.  Use username from
	current_credentials.  Free tasks on error.
	(save_tasks): Check if tasks are loaded.  Use username from
	current_credentials.
	(save_report): Use username from current_credentials.
	(omp_xml_handle_end_element, omp_xml_handle_start_element,
	omp_xml_handle_text): Add AUTHENTICATE handling.  Set error parameter on
	error.
	(omp_xml_handle_error): Remove abort call.
	(process_omp_client_input): Add some error trace messages.
	(serve_omp): Note behaviour on process_omp_client_input error.
	(serve_client): Neaten some formatting.
	(accept_and_maybe_fork): Remove task loading now done after authentication.
	(cleanup): Adjust credential freeing.

	* src/tests/common.c (authenticate): New function.
	(compare_entity_with_name, entity_child, entity_name, entity_text): Add doc.
	(read_entity): Check context_data.first has been set before accessing
	member.

	* src/tests/common.h (authenticate): New function.

	* src/tests/omp_new_task_0.c, src/tests/omp_version_0.c,
	src/tests/omp_abort_task_0.c, src/tests/omp_delete_task_0.c,
	src/tests/omp_start_task_0.c, src/tests/omp_modify_task_0.c,
	src/tests/omp_status_0.c: Add authentication.

2009-02-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Add saving of reports and tasks on disk.  Rename "reports" to
	"messages".  Move port code up to a dedicated page.  Check for alerts
	on TLS error.  Explicitly set all TLS priorities.

	* src/openvasmd.c (ahplasort, free_message, load_tasks, print_port,
	port_protocol_name, save_report, save_task, save_tasks, set_message_oid,
	task_id_string, write_message, write_messages, write_timestamp): New
	functions.
	(report_t): Rename message_t.
	(message_t): New type previously named report_t.
	(current_report): Rename current_message.
	(current_message): New var previously named current_report.
	(make_report, set_report_description, append_debug_report,
	append_hole_report, append_info_report, append_log_report,
	append_note_report): Rename with "message" instead of "report".
	(make_message, set_message_description, append_debug_message,
	append_hole_message, append_info_message, append_log_message,
	append_note_message): New functions previously named with "report".
	(message_data_t): New type.
	(task_t): Add report_count.
	(free_task): Free messages with free_message instead of free_rule.
	(make_task): Clarify return doc.  Init report count.
	(find_task): Correct while style.
	(set_task_parameter): Also set description_size when setting description.
	(append_to_task_comment, append_to_task_identifier, delete_task,
	grow_description, start_task, stop_task): Add direction to @params.
	(serve_otp, read_from_client, read_from_server, read_protocol): Check for
	alerts on TLS error.
	(omp_xml_handle_end_element): Output actual report count for STATUS.
	(process_omp_server_input): Set message OIDs with set_message_oid instead
	of set_message_description.  Save report to disk on receiving HOST_END.
	(serve_client): Explicitly set all TLS priorities instead of using
	gnutls_set_default_priority, in order to match the server's priorities.
	(accept_and_maybe_fork): Load tasks at start of child and save tasks at
	end of child.

	* Changelog: Replace some space offsets with tabs.

2009-02-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (client_state_t, omp_xml_handle_start_element,
	omp_xml_handle_end_element): Add dummy GET_NVT_FEED_ALL,
	GET_NVT_FEED_CHECKSUM and GET_NVT_FEED_DETAILS handling.

2009-02-06  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP GET_DEPENDENCIES and GET_RULES.  Correct OTP rule parsing.

	* src/openvasmd.c (free_g_slist, send_dependency, send_preference,
	send_requirement, send_rule): New functions.
	(client_state_t, omp_xml_handle_start_element,
	omp_xml_handle_end_element): Add GET_DEPENDENCIES and GET_RULES handling.
	(current_server_plugin_dependency_dependencies,
	make_server_plugins_dependencies, add_server_plugins_dependency,
	make_current_server_plugin_dependency,
	maybe_free_current_server_plugin_dependency,
	finish_current_server_plugin_dependency): Use a list for the requirements
	instead of an array.
	(server_t, maybe_free_server_rules, make_server_rules,
	add_server_rule): Track rules size.
	(print_preference): Rename to send_preference.
	(process_omp_server_input): In OTP rule parsing, check for end marker
	before searching for semicolon.

2009-02-06  Michael Wuegand <michael.wiegand@greenbone.net>

	* doc/CMakeLists.txt: Fixed syntax error which caused the build process
	to fail.

2009-02-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/CMakeLists.txt: Only install manpage if xmltoman is installed.

2009-02-05  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP GET_PREFERENCES.  Retry reading from server on error.

	* src/openvasmd.c (BUFFER_SIZE): Increase.
	(grow_description): Fix trace message.
	(client_state_t, omp_xml_handle_start_element,
	omp_xml_handle_end_element): Add GET_PREFERENCES handling.
	(print_preference): New function.
	(read_from_server): Retry the recv on error, up to 5 times.

2009-02-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_delete_task_0.c: New file.
	* src/tests/omp_delete_task_0: Remove.

2009-02-04  Matthew Mundell <matthew.mundell@greenbone.net>

	Add test of DELETE_TASK.

	* src/tests/CMakeLists.txt: Add omp_delete_task_0.

	* src/tests/omp_delete_task_0.c: New file.

2009-02-04  Matthew Mundell <matthew.mundell@greenbone.net>

	Add a few entity access functions.

	* src/tests/common.c (entity_text, entity_name, compare_entity_with_name,
	entity_child): New functions.

	* src/tests/common.h: Declare new functions.

2009-02-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (free_task, delete_task): New functions.
	(free_tasks): Move single task freeing to free_task.
	(make_task): Add a comment.
	(omp_xml_handle_start_element, omp_xml_handle_end_element,
	omp_xml_handle_text): Add DELETE_TASK handling.

	* ChangeLog: Correct function name on 2009-02-03 entry.

2009-02-03  Matthew Mundell <matthew.mundell@greenbone.net>

	Add test of ABORT_TASK.

	* src/tests/CMakeLists.txt: Add omp_abort_task_0.

	* src/tests/omp_abort_task_0.c: New file.

2009-02-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/omp_start_task_0.c: Correct comment.

2009-02-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (stop_task): New function.
	(omp_xml_handle_start_element, omp_xml_handle_end_element,
	omp_xml_handle_text): Add ABORT_TASK handling.

2009-02-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.h (close_manager_connection): New function.

	* src/tests/common.c (close_manager_connection): New function.
	(send_to_manager): Add a trace message.
	(print_entity): Flush stream afterwards.

	* src/tests/omp_modify_task_0.c, src/tests/omp_new_task_0.c,
	src/tests/omp_start_task_0.c, src/tests/omp_version_0.c:
	Use close_manager_connection.

	* src/tests/omp_status_0.c: Add expected problem counts.
	Use close_manager_connection.

2009-02-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OTP problem report handling (DEBUG, HOLE, INFO, NOTE).  Fix
	errors in append_task_open_port and omp_xml_handle_end_element.
	Update the OMP read loop to only try fill the read buffers once per
	select.

	* src/openvasmd.c (server_state_t): Add problem report states.
	(task_t): Add problem report members.
	(free_tasks): Free problem report arrays.
	(make_task): Initialise problem report arrays.
	(start_task): Add required client preferences.
	(add_task_description_line): Correct comment.
	(append_task_open_port): Increment open_ports_size instead of open_ports.
	(report_t): New type.
	(current_report): New variable.
	(make_report, set_report_description, append_debug_report,
	append_hole_report, append_info_report, append_log_report,
	append_note_report): New functions.
	(omp_xml_handle_end_element): Free modify_task_value instead of
	freeing modify_task_parameter twice.  Add problem report counts to status
	response.
	(process_omp_server_input): Add problem report handling.
	(serve_omp): Only try fill the read buffers once per select instead of
	reading and handling as much as possible before selecting again (as
	introduced on 2008-12-10).  This is to ensure that the client or server
	is read when the other party is writing alot.

2009-01-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c: (omp_xml_handle_end_element): Flush whitespace from
	task response XML.

2009-01-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Improve entity reading and comparison.

	* src/tests/common.h: (add_entity, free_entity, print_entity,
	print_entities, compare_entities): New functions.
	(entities_t, entity_t): New types.

	* src/tests/common.c: (add_entity, compare_entities, foreach_print_entity,
	free_entity, make_entity, print_entity, print_entities): New functions.
	(context_data_t): New type.
	(handle_start_element, handle_end_element handle_text, read_entity): Read
	the entire element.

	* src/tests/omp_modify_task_0.c, src/tests/omp_new_task_0.c,
	src/tests/omp_start_task_0.c, src/tests/omp_status_0.c,
	src/tests/omp_version_0.c: Use new entity reading and comparison.

2009-01-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/common.c: Match comments to style guide.

2009-01-20  Matthew Mundell <matthew.mundell@greenbone.net>

	Do server connection and initialisation lazily, when the first command
	is written to the server.  Start OMP STATUS TASK_ID handling.  Add OTP
	BYE handling.  Ensure that grow_description allocates enough memory.

	* src/ovas-mngr-comm.c: (connect_to_server): New function.

	* src/ovas-mngr-comm.h: Match style guide.
	(connect_to_server): New function.

	* src/openvasmd.c: (server_initialising): Remove.
	(client_state_t): Add CLIENT_STATUS_TASK_ID.
	(server_state_t): Add SERVER_BYE.
	(server_init_state_t): New type.
	(server_init_state, server_init_offset): New variables.
	(set_server_init_state, write_string_to_server): New functions.
	(start_task): Neaten formatting.
	(append_to_task_identifier): Correct doc return.
	(grow_description): Add minimum increment argument.
	(add_task_description_line): Pass grow_description minimum increment.
	(omp_xml_handle_start_element, omp_xml_handle_end_element,
	omp_xml_handle_text): Use NULL instead of 0.  Start XML STATUS TASK_ID
	handling.
	(omp_xml_handle_error): Describe error in message.
	(process_omp_server_input): Moving writing of server initialisation
	messages to write_to_server.  Add OTP BYE handling.
	(write_to_server): Add server connecting and sending of initialisation
	messages (moved here from process_omp_server_input and serve_client).
	(process_omp): Account for new initialisation mechanism.
	(serve_client): Move server connecting to write_to_server (via new
	function connect_to_server).

2009-01-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/Doxyfile (INPUT): Add string.c and tracef.h.

	* doc/CMakeLists.txt: Add string.c and tracef.h to .built-html rule dependencies.
	Drop dependencies from doc rule that are covered by .built-html.

2009-01-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ovas-mngr-comm.c: Add TRACE define.  Move @file comment to beginning.

2009-01-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/string.h: Add header comment.

	* src/string.c: Add header and @file comments.  Match comment docs to style guide.

	* src/tracef.h: Add header and @file comments.  Match comment docs to style guide.

2009-01-18  Matthew Mundell <matthew.mundell@greenbone.net>

	Add simple test of XML OMP STATUS.

	* src/tests/omp_status_0.c: New file.

	* src/tests/CMakeLists.txt: Add new test.

	* ChangeLog: Correct file name on previous entry.

2009-01-18  Matthew Mundell <matthew.mundell@greenbone.net>

	Add initial XML OMP STATUS and improve server initialisation.

	* src/openvasmd.c: (client_state_t): Add CLIENT_STATUS.
	(start_task): Add space before parenthesis.
	(process_omp_old_client_input): Fixup formatting.
	(omp_xml_handle_start_element, omp_xml_handle_end_element,
	omp_xml_handle_text): Add STATUS handling.  Let default case handle all
	0 assertions.
	(process_omp_server_input): In server init case check for enough input
	and process all available input.
	(read_from_client, read_from_server): Improve formatting and trace message.
	(serve_omp): Only read from client after server has initialised.

	* ChangeLog: Correct file name on previous entry.

2009-01-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/Doxyfile: Turn off JAVADOC_AUTOBRIEF.

2009-01-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c: Match comments to coding style.

	* src/ovas-mngr-comm.c: Match comments to coding style.

2009-01-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (server_context, xml_context, port_protocol_t,
	port_t): Add comments docs.
	(append_to_task_comment, append_to_task_identifier): Correct doc for
	length param.

2009-01-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/Doxyfile (INPUT): Add ovas-mngr-comm.c.

	* doc/CMakeLists.txt: Add ovas-mngr-comm.c to doc depends.

2009-01-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ovas-mngr-comm.c: Fix a few file doc typos.

2009-01-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ovas-mngr-comm.c (send_to_server): Add space after function name.

2009-01-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Add simple test of XML OMP START_TASK.

	* src/tests/omp_start_task_0.c: New file.

	* src/tests/CMakeLists.txt: Add new test.

2009-01-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Add initial XML OMP START_TASK.

	* src/openvasmd.c: (client_state_t): Add START_TASK states.
	(modify_task_task_id): Rename current_task_task_id.
	(omp_xml_handle_start_element, omp_xml_handle_end_element,
	omp_xml_handle_text): Add START_TASK handling.

2009-01-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c: Convert tabs to spaces.

	* ChangeLog: Correct previous entry.

2009-01-16  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Started to move communication with server to a module
	of its own.

	* src/ovas-mngr-comm.c: New. Contains functionality
	for communication with openvas-server factored out
	from openvasmd.c.

	* src/ovas-mngr-comm.h: New. Protos for respective API.

	* src/openvasmd.c (send_to_server, to_server, to_server_end):
	Removed. This is now
	part of the new module ovas-mngr-comm.

	* src/CMakeLists.txt: Added handling for module ovas-mngr-comm.

2009-01-15  Matthew Mundell <matthew.mundell@greenbone.net>

	Add simple tests of XML OMP OMP_VERSION, NEW_TASK and MODIFY_TASK.

	* src/tests/common.c, src/tests/common.h, src/tests/omp_modify_task_0.c,
	src/tests/omp_new_task_0.c, src/tests/omp_version_0.c: New files.

	* src/tests/CMakeLists.txt: Add config library and new tests.

2009-01-15  Matthew Mundell <matthew.mundell@greenbone.net>

	Add initial XML OMP NEW_TASK and MODIFY_TASK.  Document functions.

	* src/openvasmd.c (client_state_t): New type.
	(client_state, modify_task_parameter, modify_task_task_id,
	modify_task_variable): New variables.
	(append_to_task_comment, append_to_task_identifier, set_client_state,
	set_task_parameter): New functions.
	(add_task_description_line): Add const qualifer to parameter.
	(omp_xml_handle_start_element, omp_xml_handle_end_element,
	omp_xml_handle_text): Add comment docs.  Add NEW_TASK and
	MODIFY_TASK.
	(omp_xml_handle_error): Add comment doc.

2009-01-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/tests/strip_space_0.c, src/tests/strip_space_1.c,
	src/tests/strip_space_2.c, src/tests/strip_space_2.c: Add file header
	comments.

2009-01-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* INSTALL: Correct Cmake command.

2009-01-15  Matthew Mundell <matthew.mundell@greenbone.net>

	Start XML OMP handling.

	* src/openvasmd.c (xml_context): New variable.
	(process_omp_old_client_input): New function with old
	process_omp_client_input code.
	(process_omp_client_input): Start XML parsing.
	(XML_RESPOND, omp_xml_handle_start_element,
	omp_xml_handle_end_element, omp_xml_handle_text,
	omp_xml_handle_error): New functions.
	(serve_omp): Add XML parser and context initialisation.

2009-01-09  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Turned TO_SERVER into a method and changed all calls.

	* src/openvasmd.c (TO_SERVER): Transformed this macro into
	method send_to_server.
	(send_to_server): New. Functionlity of TO_SERVER, but returns 1
	for error instead of goto statement.
	(start_task, process_omp_server_input): Changed calls from
	TO_SERVER macro to send_to_server method and did according cleanups.

2008-12-23  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/Makefile: Removed. It is overwritten by cmake anyway.

2008-12-23  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* INSTALL: Added information about the prefix setting for cmake.

2008-12-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* CMakeLists.txt: Enable testing.

	* src/CMakeLists.txt: Add string library and a tests subdirectory.

	* src/string.h, src/string.c, src/tracef.h, tests/, tests/CMakeLists.txt,
	tests/strip_space_0.c, tests/strip_space_1.c, tests/strip_space_2.c,
	tests/strip_space_3.c: New.

	* src/openvasmd.c (tracef): Move to tracef.h.
	(strip_space): Rework.  Move to string.c.
	(process_omp_server_input): Correct from_start and input updating in
	<|> field loop.  Correct and update call to strip_space.

2008-12-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (process_omp_server_input): Improve open port number
	parsing.

2008-12-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (serve_otp): Use a flag instead of a goto when
	writing to the fd.

2008-12-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Add server PORT command handling.

	* src/openvasmd.c (append_task_open_port): New function.
	(free_tasks): Free open_ports.
	(make_task, start_task): Init open_ports.
	(port_protocol_t, port_t): New types.
	(process_omp_server_input): Add PORT handling.

2008-12-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c: Convert tabs to spaces.

2008-12-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (write_to_client, write_to_server): New functions.
	(serve_omp): Describe and simplify the select loop.  Move writing code
	out to new functions write_to_client and write_to_server.

2008-12-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c: Drop the OVAS_SSL directive in favour of always
	compiling secure transmission.

2008-12-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c: (strip_space): Correct terminating check.
	(make_task, serve_client): Replace goto loops with structured loops.
	(process_omp_client_input, process_omp_server_input): Format signatures
	like rest of file.
	(process_omp_server_input): Finish TIME HOST_END handling.  Move the
	out of memory destination to be a fail case.

2008-12-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c: (set_server_state): New function.
	(process_omp_server_input): Always set the server state via
	set_server_state, to reduce the amount of tracing code.

2008-12-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c: Replace \return with @return in comment docs.

2008-12-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (current_server_task): New variable.
	(set_task_ports): New function.
	(process_omp_client_input): Turn off messages tracing.  Separate some
	of the response codes.  Use a local variable for the task in the
	START_TASK case.
	(process_omp_server_input): Turn off messages tracing.  Add TIME and
	STATUS message handling.

2008-12-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (read_from_client, read_from_server
	read_protocol): Improve function docs.

2008-12-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c: Bring code documentation up to date.

2008-12-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (process_omp_client_input): Replace use of asprintf
	with g_strdup_printf.

2008-12-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* CMakeLists.txt: Prefix paths in variables with CMAKE_INSTALL_PREFIX.

	* src/CMakeLists.txt: Drop hard coded include paths.

2008-12-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* openvasmd.c: Convert tabs to spaces.

2008-12-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* openvasmd.c (OPENVASMD_ADDRESS): Remove.
	(main): Bind to INADDR_ANY by default.

2008-12-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* openvasmd.c (serve_otp, read_protocol, serve_client):
	Drop EAGAIN and EINTR checks from OVAL_SSL cases.

2008-12-10  Matthew Mundell <matthew.mundell@greenbone.net>

	After selecting, ensure that all input is read before the fd is
	selected again.  Start handling server input: preferences, plugins
	dependencies and rules.  Improve server input field parsing.

	* openvasmd.c: Prefix tracing messages with 3 spaces.  Improve a few
	comments.
	(strip_space): Only strip spaces.
	(TO_SERVER, start_task): Update fail destination.
	(serve_otp, read_protocol): Compare GNUTLS_E_REHANDSHAKE to count
	instead of errno.
	(RESPOND): Update to revert parsing on fail.  Update fail destination.
	(process_omp_client_input): Update to revert parsing on start_task and
	RESPOND failure.  Update RESPOND fail destination.
	(process_omp_server_input): Only update from_server_start after
	TO_SERVER, in case TO_SERVER fails.  On successful exit, reset the
	from_server buffer.  In the SERVER_DONE handling only strip spaces,
	exit if there are too few characters in the message and move messages
	along on success.  Add preference, rule and plugins dependencies
	handling.  Improve the check for <|>.
	(serve_omp): Compare count to GNUTLS_E_REHANDSHAKE instead of errno.
	Move reading out to new functions read_from_client and
	read_from_server.  After selecting, ensure that all input is read
	before the fd is selected again, including the cases where processing
	of the input must wait for space in one of the output buffers
	to_server and to_client.  Drop the EAGAIN and EINTR check from
	the OVAL_SSL cases.
	(current_server_preference, current_server_plugin_dependency_name,
	current_server_plugin_dependency_dependencies): New variables.
	(free_g_ptr_array, maybe_free_server_preferences,
	make_server_preferences, add_server_preference,
	maybe_free_server_plugins_dependencies,
	make_server_plugins_dependencies, add_server_plugins_dependency,
	make_current_server_plugin_dependency,
	append_to_current_server_plugin_dependency,
	maybe_free_current_server_plugin_dependency,
	finish_current_server_plugin_dependency, free_rule,
	maybe_free_server_rules, make_server_rules, add_server_rule,
	read_from_client, read_from_server): New functions.

2008-12-03  Matthew Mundell <matthew.mundell@greenbone.net>

	Add more OMP commands, start adding server communication.

	* openvasmd.c: Add server records.  Add some task allocation tracing.
	(free_tasks, make_task): Correct looping.
	(current_task): Rename current_client_task;
	(tracef, logf): Flush trailing semicolons.
	(CLIENT_READ, CLIENT_WRITE): Rename FD_CLIENT_*.
	(SERVER_READ, SERVER_WRITE): Rename FD_SERVER_*.
	(find_task, modify_task, start_task, strip_space): New functions.
	(process_omp_input): Rename to process_omp_client_input.
	(process_omp_client_input): Rename from process_omp_input. Add
	beginnings of MODIFY_TASK, START_TASK and STATUS.
	(process_omp_server_input): New function.
	(TO_SERVER): New macro.
	(serve_omp): Add server init and process_omp_server_input call.
	Improve formatting.
	(accept_and_maybe_fork): Add client socket shutdowns.  Move client socket
	close out of OVAS_SSL case.

2008-11-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP commands OTP_VERSION, LOGIN and NEW_TASK.

	* openvasmd.c (task_t, grow_tasks, free_tasks, make_task): New.
	(grow_description, add_task_description_line): New.
	(RESPOND, process_omp_input): New.
	(serve_omp): Handle OTP_VERSION, LOGIN and NEW_TASK.
	Convert tabs to spaces.

2008-11-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Add choosing of protocol based on first message.

	* openvasmd.c (OMP, serve_otp, serve_client): New.
	(read_protocol, serve_client): New.
	(accept_and_maybe_fork): Call serve_client instead
	of serve_omp.
	(serve_omp): Move OTP code to serve_otp.

2008-11-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* README: Update for new build system.

2008-11-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/CMakeLists.txt: Ensure html/ exists.

	* doc/Doxyfile: Correct paths.

	* doc/openvasmd.8.xml: Add header comment.

2008-11-21  Matthew Mundell <matthew.mundell@greenbone.net>

	Add cmake build support and a manpage.

	* Makefile: Removed.

	* footer.html, Doxyfile: Removed (moved to doc/).

	* CMakeLists.txt, doc/, doc/CMakeLists.txt, INSTALL,
	src/CMakeLists.txt, doc/openvasmd.8.xml: New.

	* doc/footer.html, doc/Doxyfile: New (moved from ..).

2008-11-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c: Flesh out \mainpage.  Add parameters to function
	docs.  Clean up docs a little.
	(OVM_OS_NAME): rename OPENVAS_OS_NAME.

2008-11-20  Michael Wiegand <michael.wiegand@greenbone.net>

	* README: Fixed typo.

2008-11-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmc.c: Add Doxygen documentation.

	* Doxyfile, footer.html: New.

2008-11-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c: Drop the *_PORT_OVERRIDE directives.  Turn off
	tracing.
	(main): Add option processing.
	(handle_signal): Add SIGINT handling.

	* src/Makefile: Add flags for glib.

2008-11-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c: Rename directives for consistency.

2008-11-11  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Starting module "openvas-manager".

	* COPYING, ChangeLog, README, src/Makefile, src/openvasmd.c: New.
