2016-08-30  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 6.0.9 release.

	* CHANGES: Updated.

2016-08-24  Matthew Mundell <matthew.mundell at greenbone.net>

	Backport r24792.

	* src/manage_sql.c (scanner_task_iterator_readable): Correct offset.

	* src/omp.c (handle_get_scanners): Use correct accessor function.

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

	Backport r25978.

	* src/manage.c (slave_setup): Remove stray "if" from last commit.

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

	Backport r25975.

	* src/manage.c (slave_setup): If the connection succeeds for
	CREATE_TARGET but the command fails then put the task in Internal
	Error and giveup.  This prevents the master task from hanging in
	Requested when the slave allows fewer targets than the master.

2016-07-28  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r25856.

	* src/openvasmd.c (handle_sigsegv): Remove cleanup so that core is dumped.

2016-07-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r25846.

	* src/report_formats/Anonymous_XML/Anonymous_XML.xsl: Also skip name in
	SCAN/TASK/SLAVE.

2016-07-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r25844.

	* src/report_formats/Anonymous_XML/Anonymous_XML.xsl: Also skip name in
	REPORT/REPORT/TASK.

2016-07-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r25842.

	* src/omp.c (handle_get_reports): Skip task name for Anonymous XML.

	* src/report_formats/Anonymous_XML/Anonymous_XML.xsl: Skip certificate
	host details and result owner.

2016-07-21  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r25810.

	* src/schema_formats/XML/OMP.xml.in (modify_agent, modify_slave)
	(modify_user): Correct attribute names.

	* doc/omp.html, doc/omp.rnc: Update from source.

2016-07-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r25786.

	* src/manage_sql.c (escalate_1): Add sorting by severity to filter.

2016-07-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r25774.

	* src/manage_sqlite3.c (backup_db): Use SQLite's backup interface instead
	of mv.  Turn off WAL on the backup db to ensure that the db is a single
	file.

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

	Backport r25748.

	* src/omp.c (handle_get_configs, handle_get_scanners)
	(omp_xml_handle_end_element): In the GET commands, do not send
	dependents if the user may not read the dependent.

2016-07-05  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r25741.

	* src/manage_sql.c (copy_target): Copy alive_test too.

2016-06-29  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r25646.

	* src/omp.c (omp_xml_handle_end_element): In case CLIENT_MODIFY_TASK,
	add missing break statements in set_task_preferences switch case block.

2016-06-07  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r25165.

	* src/manage.c (slave_connect, slave_setup, run_slave_task)
	(fork_osp_scan_handler, run_task): Add a warning everywhere a task is
	set to Internal Error.

	* src/manage.c (manage_cleanup_process_error): Add a warning everywhere
	a task is set to Internal Error.

2016-06-03  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r25449.

	* src/manage.c (slave_setup): Use init_target_iterator_one, because
	the target may belong to someone else.

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

	* src/manage.h: Add header accordingly.

2016-06-01  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r25445.

	* src/manage.c (run_task): Send credential preferences with empty value
	instead of "(null)" value when they are null in the credential.

2016-05-30  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r25414.

	* src/manage_sql.c (init_task_user_iterator): Make the user selection
	distinct so users are only shown once in the observers list.

2016-05-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r25386.

	* src/manage.c (run_slave_task): Add an error result to the report
	if authentication fails with the slave.  Free hosts earlier.
	(run_task): Include new "authentication failure" case when checking
	run_slave_task return.

2016-05-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r25379.

	* src/manage_sql.c (create_config): Correct check for NVT selector
	insertion.  config_type can be NULL.

2016-05-24  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r25358.

	* src/manage.c (run_task): Set the scheduled flag of the report every
	time, so that this flag is also set when a scheduled task uses the
	report from a previous stopped scan that was started manual.

	* src/manage_sql.c (set_report_scheduled): Export.

	* src/manage_sql.h: Add header accordingly.

2016-05-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r25352.

	* src/manage.c (manage_schedule): Try to resume before trying to start,
	otherwise the task always starts from the beginning.

2016-05-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r25343.

	* src/manage.c (fork_osp_scan_handler): Adjust proctitle formatting and
	wording, so it lines up and matches other cases.
	(run_task): Change proctitle of OTP scan handlers.

2016-05-18  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r25320.

	Where possible, always include the resource name in event log messages.

	* src/manage.h (resource_name): Export.

	* src/manage_sql.c (resource_name): Ensure that name is always
	initialised when the return is 0.

	* src/omp.c (log_event_internal): New function.  From log_event.  Get
	name when ID is given.
	(log_event, log_event_fail): Use log_event_internal.

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

	Backport r25263.

	* src/manage_sql.c (escalate_2): Add data "snmp_message" for method
	SNMP, with variable expansion like the email subject.

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

	Backport r25274.

	Add alert script forgotten with SNMP alert commit.

	* src/alert_methods/SNMP, src/alert_methods/SNMP/alert: New files.

	* CMakeLists.txt: Install alert script.

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

	Backport r25207.

	Add alert method SNMP.

	* src/manage.c (alert_method_name, alert_method_from_name): Add SNMP.

	* src/manage.h (alert_method_t): Add SNMP.

	* src/manage_sql.c (snmp_to_host): New function.
	(escalate_2): Add SNMP.

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

	Backport r25167.

	* src/manage.c (PERMISSION_ITERATOR_FILTER_COLUMNS): Add orphan.
	(PERMISSION_ITERATOR_COLUMNS): Name the orphan column.

2016-05-04  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r24794.

	* src/omp.c (handle_get_scanners)
	(omp_xml_handle_end_element): In the GET commands, do not send
	dependents of globals if the user may not read the dependent.
	For example, do not send a task owned by user A in the TASKS of
	target Localhost when user B does a GET_TARGETS.

2016-05-04  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r24795.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_TARGETS use the
	correct accessor function.

	* src/manage.h: Add header accordingly.

2016-04-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r25091.

	* src/manage.h (alert_method_t): Move SCP after Send, because SEND was
	introduced first, and the enumeration values are used in the db.  This
	might break alerts created since r24727, but will repair Send alerts
	created before r24747.

2016-04-07  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r24881.

	* INSTALL: Add alert prerequisites.

2016-04-07  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r24863.  (Missed file.)

	* src/alert_methods/SCP/alert: Quote args.

2016-04-07  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport a little of r24131.

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

2016-04-07  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r24863.

	* src/manage_sql.c (scp_alert_path_print): New function.
	(escalate_2): Improve log message.  Allow $n for task name to SCP path.

	* src/alert_methods/SCP/alert: Quote args.

2016-04-07  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r24760.

	* src/alert_methods/SCP/alert: Pass password with -f, otherwise it is
	visible in the process list.  Remove temp files afterwards.

2016-03-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r24759.

	* src/omp.c (omp_xml_handle_end_element): In GET_ALERTS skip SCP
	password.

2016-04-06  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r24749.

	* CMakeLists.txt: Install SCP alert.

2016-03-22  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r24747.

	Add new alert method 'SCP'.

	* src/manage.c (alert_method_name, alert_method_from_name): Add SCP.

	* src/manage.h (alert_method_t): Add SCP.

	* src/manage_sql.c (validate_scp_data): New function.
	(create_alert, modify_alert): Check SCP method data.
	(run_alert_script): Put outputs on same line, so they're easy to change.
	(scp_to_host): New function.
	(escalate_2): Add SCP case.

	* src/omp.c (omp_xml_handle_end_element): Handle new returns.

	* src/alert_methods/SCP: New directory.

	* src/alert_methods/SCP/alert: New file.

2016-03-17  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r24696.

	* src/manage_sql.c (run_alert_script): New function.
	(send_to_host): Use run_alert_script.

2016-04-05  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r24872.

	* src/manage_sql.c (copy_report_format): If the report format is
	predefined, make sure that the cloned report format is trusted.

2016-03-25  Hani Benhabiles <hani.benhabiles@greenbone.net>

	Backport r24789.

	Dynamically allocate and reallocate from_scanner buffer so it adjusts to
	larger inputs from scanner instead of silently exiting.

	* src/scanner.c (from_scanner): Define as pointer instead of array.
	(from_scanner_size, from_scanner_size_max): New variables.
	(openvas_scanner_read, openvas_scanner_full): Use new variables.
	(openvas_scanner_realloc): New function.
	(openvas_scanner_close): Free from_scanner buffer.
	(openvas_scanner_init): Allocate from_scanner buffer.

	* src/scanner.h: Add new function prototype.

	* src/otp.c: Adjust from_scanner declaration.
	(sync_buffer): Reallocate scanner buffer when it is full.

	* src/ompd.h: Adjust from_scanner declaration.

2016-03-22  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r24727.

	* src/manage_sql.c (manage_optimize): Add version of query with
	stricter type handling for PostgreSQL to cleanup-result-severities
	case.

2016-03-22  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r24354.

	* INSTALL, README, src/openvasmd.c (main): Add new --optimize option
	cleanup-result-severities.

	* src/manage_sql.c (manage_optimize): Add cleanup-result-severities
	case, filling in missing severity scores, e.g. in older OSP reports.

2016-03-22  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r23021.

	* src/manage_sql.c (check_db_settings, credentials_setup): Add new
	setting "Default Severity".
	(make_osp_result): If no severity is given, fall back to value of
	Default Severity if none is found in SecInfo database and do not
	accept non-CVE results without severity.
	(setting_default_severity_dbl): New function.
	(modify_setting): Add new setting "Default Severity".

	* src/manage.h (setting_default_severity_dbl): New function prototype.

2016-03-16  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r24670.

	* src/manage_sql.c (print_report_xml): Apply ignore_pagination option
	for "assets" and "prognostic" type reports.

2016-03-09  Hani Benhabiles <hani.benhabiles@greenbone.net>

	Backport r24632.

	* src/manage.c (get_osp_scan_report): Fix memory and file descriptors
	leak, which caused long osp scans to abort.

2016-03-07  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport applicable part of r24607.

	* src/manage_sql.c (filtered_host_count): Add missing closing
	parenthesis in sql_int query in case with search phrase and no levels.

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

	Backport some of r24577.

	* src/manage_sql.c (port_order): New function.
	(result_cmp): Combine the ascending and descending cases.  Add a case
	for sorting by NVT name ("Vulnerability" column in GSA).  Compare ports
	with port_order because OpenVAS-8 orders ports as numbers.
	(print_report_xml): Restrict the sort columns accepted for delta
	reports, because the comparison depends on the sorting.

2016-03-01  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r24558.

	* src/schema_formats/XML/OMP.xml.in: Change the type of attribute
	"filter" from "uuid" to "text".

	* doc/omp.rnc, doc/omp.html: Update from source.

2016-02-26  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version to 6.0.9.

2016-02-26  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 6.0.8 release.

	* CHANGES: Updated.

2016-02-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r24455.

	* src/manage_sql.c (count2): Put parens around clause, because it may
	be made up of multiple terms.

2016-02-22  Hani Benhabiles <hani.benhabiles@greenbone.net>

	Backport r23464.

	* src/manage.c (handle_osp_scan): Add error result for erroneous scan
	progress value.
	(fork_osp_scan_handler): Fix return value check.

2016-02-17  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r24371.

	* src/manage_sql.c (auto_delete_reports): Use SQL lib to generate LIMIT
	term.

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

	* src/manage_sql.c (auto_delete_reports): Use a custom iterator, instead
	of doing lots of SQL to get the preference values in the loop.

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

	Backport r24365.

	Add task preference for auto deleting reports.

	* src/manage_sql.c (auto_delete_reports): New function.
	(set_task_preferences): Add Auto Delete validation.

	* src/manage.h: Adjust header accordingly.

	* src/manage_sql.h: Add header accordingly.

	* src/manage.c (manage_schedule): Delete reports.

	* src/omp.c (omp_xml_handle_end_element): Include Auto Delete prefs in
	GET_TASKS.  Handle new set_task_preferences return in CREATE_TASK and
	MODIFY_TASK.

2016-02-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r24375.

	Pass report with task when running an alert, instead of assuming that
	the alert applies to the most recent "Done" report.

	* src/manage_sql.c (escalate_1): Add report arg.
	(manage_alert): Add escalate_1 arg.
	(condition_met): Add report arg.
	(event): Add report arg.  Pass to condition_met and escalate_1.
	(set_task_run_status): Pass report to event.
	(make_task_complete, check_for_new_nvts, check_for_new_secinfo)
	(check_for_updated_nvts, check_for_updated_secinfo): Pass 0 report to
	event.

2016-02-09  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r24338.

	* src/schema_formats/XML/OMP.xml.in (get_reports): Clarify what filter
	attributes are for.  Add report_filter and report_filt_id attributes.

	* doc/omp.rnc, doc/omp.html: Update from source.

2016-01-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r24225.

	* src/omp.c (omp_parser_new): Copy the disabled command array, because
	they will be freed by omp_parser_free, and this may happen multiple
	times in a process that is forked to handle OMP for the schedular.

2016-01-15  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r24149.

	* src/manage_sql.c (WHERE_OWNER): New define.
	(manage_empty_trashcan): Only remove resources owned by current user.

2016-01-05  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r24037.

	* src/report_formats/Verinice_ISM/Verinice_ISM.xsl (info-control): Use
	new 'ISM Control Description' param.

2016-01-05  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r24036.

	Add "ISM Control Description" parameter to "Verinice ISM" report format.

	* src/manage_sql.c (VERINICE_ISM_CONTROL_DESCRIPTION): New define.
	(check_db_report_formats): Add parameter to Verinice ISM report format.

2015-12-21  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version to 6.0.8.

2015-12-21  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 6.0.7 release.

	* CHANGES: Updated.

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

	Backport r23774.

	* src/manage_sql.c (delete_filter): Check if the filter is in use by an
	alert condition.
	(init_filter_alert_iterator): Include alerts that use the filter in a
	condition.

2015-11-10  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23771.

	Validate filter condition data for CREATE_ALERT and MODIFY_ALERT.

	* src/manage_sql.c (validate_alert_condition_data): Add filter cases.
	(create_alert): Handle new validation returns.

	* src/omp.c (omp_xml_handle_end_element): Handle new validation returns.
	Correct commands in log calls.

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

	Backport r23764.

	Add new alert conditions "Filter count at least" and "Filter count
	changed".

	* src/manage.h (alert_condition_t): Add filter conditions.

	* src/manage.c (alert_condition_name, alert_condition_description)
	(alert_condition_from_name, alert_condition_t): Add filter conditions.

	* src/manage_sql.c (init_alert_data_iterator): Align arg.
	(condition_met): Add filter cases.

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

	Backport r23955.

	* src/manage_sql.c (create_tables): Add index
	results_by_task_qod_severity.  This speeds up the count of all a task's
	results for GET_TASKS.

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

	Backport r23952.

	* src/manage_sql.c (TASK_ITERATOR_COLUMNS_INNER): Remove columns only
	used for filtering.
	(TASK_ITERATOR_WHERE_COLUMNS_INNER): Add those columns.
	(task_iterator_run_status_name, task_iterator_last_report)
	(task_iterator_finished_reports, task_iterator_hosts_ordering)
	(task_iterator_scanner): Adjust offset.

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

	Backport r23937.

	* src/manage_sql.c (REPORT_ITERATOR_WHERE_COLUMNS): Add numeric types,
	to speed up filtering when the term is known to not be numberic.

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

	Backport r23924.

	Leave the threat, trend and status clauses out of the SQL filtering
	clause if they don't make sense for the filter term.

	* src/manage_sql.c (keyword_applies_to_column): New function.  Only
	checks threat, trend and status so far.
	(filter_clause): Check if it's possible for the keyword to actually
	match the column, before adding the clause for the column.

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

	Backport r23920.

	* src/manage_sql.c (filter_clause): Remove "not" from NOT case, added
	in last commit.

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

	Backport r23919.

	When generating SQL filter clauses, skip the SQL WHERE clause for
	numeric columns when the filter term is known to not be numeric.
	This helps reduce the number of clauses for GET_TASKS, especially
	removing the expensive columns like severity, when the filter contains
	a term that does not have many matches.

	* src/manage.h (keyword_type_t): Add KEYWORD_TYPE_UNKNOWN.

	* src/manage_sql.c (column_t): Add type.
	(columns_select_column_single): Add type arg.  Skip numeric columns when
	the type is not numeric (except when type is unknown).
	(columns_select_column): Prevent type check.
	(columns_select_column_with_type, keyword_type_from_string): New
	functions.
	(filter_clause): For terms that may match any column, skip the clause if
	the term is not numeric and the column type is numeric, because they can
	never match.
	(TASK_ITERATOR_COLUMNS_INNER, TASK_ITERATOR_WHERE_COLUMNS_INNER): Add
	types for integer columns.

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

	* ChangeLog: Remove stray entry.

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

	Backport r23902.

	* src/omp.c (omp_xml_handle_end_element): Pass min_qod to
	task_result_count.

	* src/manage_sql.c (task_result_count): Add arg min_qod.

	* src/manage.h: Update header accordingly.

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

	Backport r23900.

	* src/omp.c (omp_xml_handle_end_element): Add RESULT_COUNT to GET_TASKS.

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

	* src/manage.h: Add header accordingly.

	* src/schema_formats/XML/OMP.xml.in (get_tasks): Add RESULT_COUNT.

	* doc/omp.rnc, doc/omp.html: Update from source.

2015-11-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23872.

	* src/manage_sql.c (init_aggregate_iterator): Also consider WHERE
	columns when finding the SELECT expressions for columns.

2015-11-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23871.

	* src/manage_sql.c (init_aggregate_iterator): Pass where columns to
	filter_clause, because the select columns may be for reports or tasks.
	(type_where_columns): New function.

2015-11-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23870.

	Add second versions of the GET iterator and count functions, that allow
	the caller to specify columns that may appear in the WHERE clause for
	filtering, but that must not appear in the SELECT columns.

	Specify such columns for the task and report iterators.

	* src/manage_sql.c (columns_select_column_single): New function.  Body
	from columns_select_column.
	(columns_select_column): Call through to columns_select_column_single.
	(filter_clause): Add arg where_columns.  Pass through to
	columns_select_column.
	(init_get_iterator2, count2): New function.  Body from existing version,
	with where column args.
	(init_get_iterator, count): Call through to "2" version.
	(TASK_ITERATOR_COLUMNS, REPORT_ITERATOR_COLUMNS): Reduce to columns that
	are required as SELECT columns, that is, columns used by the accessor
	functions.
	(TASK_ITERATOR_WHERE_COLUMNS, REPORT_ITERATOR_WHERE_COLUMNS): New
	defines.  Rest of columns from TASK_ITERATOR_COLUMNS, the "WHERE
	columns".
	(init_task_iterator, init_report_iterator): Use WHERE columns in
	iterator.
	(init_aggregate_iterator, setting_count, init_setting_iterator)
	(total_info_count, init_all_info_iterator): Add NULL arg for WHERE
	columns.

2015-11-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23873.

	* src/manage_sql.c (check_db_settings): Escape % in format string.

2015-11-24  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23854.

	Improve the speed of the GET iterator by doing a "pre-SELECT" with
	only the ID as a column.

	* src/manage_sql.c (init_get_iterator): Add inner SELECT when getting
	multiple rows without DISTINCT.

2015-11-24  Michael Wiegand <michael.wiegand@greenbone.net>

	Backport part of r23850.

	* src/report_formats/Verinice_ISM/Verinice_ISM.xsl
	(extract_organization): Use 'Verinice Source ID' tag if available.

2015-11-20  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23823.

	* src/manage_sql.c (check_db_report_formats): Ensure "Verinice ISM"
	report format has the "Attach HTML report" param.

2015-11-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23814.

	* src/manage.c (get_tasks_last_report): New function.
	(slave_setup): If the task is running or complete on the slave, then use
	the existing report from the slave's task, instead of starting the task
	from the beginning again.

2015-11-18  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23813.

	* src/manage.c (slave_setup): Add TYPE to CREATE_CONFIG command, because
	this is now required.

2015-11-16  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r23803.

	* src/manage.c (slave_setup): Test if credentials on slave are NULL
	before trying to delete them at the end of a scan.

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

	Backport r23777.

	Forgotten part of last commit.

	* CMakeLists.txt: Install Send alert file.

	* src/alert_methods/Send/, src/alert_methods/Send/alert: New directory
	and file.

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

	Backport r23775.

	Add alert method "Send", for sending the report to a TCP listener.

	* src/manage_sql.c (validate_send_data): New function.
	(create_alert, modify_alert): Validate data for Send method.
	(send_to_host): New function.
	(escalate_2): Add Send method.

	* src/manage.h (alert_method_t): Add Send.

	* src/manage.c (alert_method_name, alert_method_from_name): Add Send.

	* src/omp.c (omp_xml_handle_end_element): Handle new returns from
	create_alert and modify_alert.

2015-11-05  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23750.

	* src/openvasmd.c (update_or_rebuild_nvt_cache)
	(rebuild_nvt_cache_retry): Add arg skip_create_tables.
	(fork_update_nvt_cache): Prevent table creation for SIGHUP rebuild.
	(main): Request table creation for --rebuild.

2015-11-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23737.

	* src/html/XML/OMP.xml (create_report): Correct example.

	* doc/omp.html: Update from source.

2015-10-29  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23723.

	Keep the task's "schedule periods" value whenever possible, so that the
	"Once" checkbox stays active even when the schedule is cleared.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_TASK set the
	schedule periods even if the schedule is not given.  In
	CLIENT_MODIFY_TASK use the given periods value even when the schedule
	is "0".

	* src/manage.c (manage_schedule): At the end of the task leave schedule
	periods on 1 if it was 1.

	* src/manage_sql.c (set_task_schedule_periods_id): New function.
	(clear_duration_schedules, update_duration_schedule_periods): Leave
	schedule periods on 1.  It's enough that the schedule is cleared.
	(copy_task): Copy schedule period too, so that once flag is copied.

	* src/manage_sql.h (set_task_schedule_periods): Move to manage.h.

	* src/manage.h: Update headers accordingly.

2015-10-28  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23713.

	* src/html/XML/OMP.xml: Add compatiblity change about risk factor.
	(note, override, get_reports, get_results): Remove risk factor.

	* doc/omp.rnc, doc/omp.html: Update from source.

2015-10-28  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23598.

	Remove some leaks found by valgrind.

	* src/manage.c (send_ifaces_preferences): Free ifaces.
	(send_hosts_access_preferences): Free hosts.

	* src/manage_acl.c (where_owned_user): Also free clause in report
	and result cases.

	* src/manage_sql.c (filter_clause): Free order when order_return was not
	given.
	(count): Free owner_filter.
	(escalate_2): Free initial g_log args.  Don't set alert_subject to NULL,
	so that it is freed.  Free extension and type.
	(task_observers): Free GString part of observers.
	(task_schedule_next_time_tz): Init get.id later, and free it after use.
	(task_preference_value): Always free quoted_name.  Remove redundant
	value check.
	(init_task_schedule_iterator): Free permissions after first use too.

	* src/omp.c (init_get): Free user_filter when it was empty.
	(send_get_end): Store filter_term_value in variable, and free it after.
	(omp_xml_handle_end_element): Free pw_warning, current_report_id and
	source_iface.
	(init_omp_process): Free xml_context with g_markup_parse_context_parse
	intead of g_free, so that it's freed properly.

2015-10-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23700.

	* src/sql_sqlite3.c (sql_prepare_internal, sql_exec_internal): Use
	sqlite3_prepare_v2 instead of sqlite3_prepare, as it handles schema
	changes better.

2015-10-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23694.

	Avoid SQLITE_SCHEMA errors that happen when a rebuild runs, by
	preventing the views from being dropped.  This only addresses SIGHUP
	initiated rebuilds, --rebuild will still result in any active database
	connections getting the SQLITE_SCHEMA return.

	* src/openvasmd.c (update_or_rebuild_nvt_cache): Pass flag to init_ompd
	to prevent create_tables from running.
	(main): Update init_ompd call.

	* src/manage_sql.c (init_manage_internal): Add arg skip_db_check, which
	controls whether DB check and cleanup are done.  Update callers.
	(init_manage): Add arg skip_db_check.

	* src/omp.c (init_omp): Add arg skip_db_check.

	* src/ompd.c (init_ompd): Add arg skip_db_check.

	* src/ompd.h, src/omp.h, src/manage.h: Update headers accordingly.

2015-10-22  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23680.

	* src/manage_sql.c (manage_complete_nvt_cache_update): Check config
	families.  This updates the NVT selectors when the family of an NVT
	changes in the feed.
	(nvt_selector_set_family, config_update_nvt_family, update_nvt_family)
	(check_config_families): New functions.

2015-10-20  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23639.

	* src/sql.c (sqlv, sql_quiet): Compare directly to 1 in the
	sql_exec_internal "while", because sql_exec_internal will return 2
	on SQLITE_SCHEMA and we need to return in this case (otherwise the
	process will hang repeating the SQLITE_SCHEMA).

2015-10-16  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r23601.

	* src/manage_sql.c (delete_lsc_credential): Check if a trash target
	uses the credential for ESXi when deleting it from trashcan.

2015-10-07  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23550.

	* src/manage_sqlite3.c (create_tables): Lock the db completely around
	the drop-create view steps, so that other processes do not try to access
	the views when they have been removed.

2015-10-08  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23534, but reuse an existing column in reports instead of
	adding a new column in a migrator.

	Record in each report in the db whether the task was started by the
	scheduler.  Use this info to prevent the scheduler from stopping
	manually started tasks.

	* src/manage_sql.c (set_report_scheduled, report_scheduled): New
	functions.
	(create_current_report): Record whether the report was for a scheduled
	task.
	(task_schedule_iterator_stop_due): If the task was started manually,
	then simply return FALSE.

2015-10-07  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r23529.

	* src/manage_sql.c (config_insert_preferences): Correct NULL check
	before quoting the default value.

2015-10-06  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23511.

	* src/report_formats/CSV_Results/CSV_Results.xsl (result): Use
	"severity" instead of "nvt" for CVSS, because "severity" has the
	overridden value.

	* src/report_formats/CSV_Hosts/CSV_Hosts.xsl (openvas:max-cvss): Use
	"severity" instead of "nvt" for CVSS, because "severity" has the
	overridden value.

2015-10-05  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r23507.

	Make it possible to import OSP scan configs.

	* src/manage_sql.c (config_insert_preferences, create_config): Add
	config_type parameter and handle OSP configs and parameters.

	* src/manage.h (preference_t): Add default_value field.
	(create_config): Add parameter.

	* src/omp.c (preference_new): Add default_value parameter.
	(import_config_data_t, create_config_data_reset): Add fields
	preference_default and type.
	(client_state_t, omp_xml_handle_start_element)
	(omp_xml_handle_end_element, omp_xml_handle_text): Handle preference
	default and type elements when importing a config.

2015-10-05  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22979.

	* src/manage_sql.c (task_severity): Remove extra FROM clause.

2015-10-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23498.

	* src/manage_pg.c (manage_session_init): Skip INSERT if uuid is NULL.

	* src/manage_sqlite3.c (manage_session_init): Skip INSERT if uuid is
	NULL.

	* src/manage_sql.c (reports_build_count_cache): Init session for user
	change.

2015-09-29  Hani Benhabiles <hani.benhabiles@greenbone.net>

	Backport r23438.

	* src/manage_sql.c (create_config_from_scanner): Adjust handling of osp
	selection parameter type.

2015-09-28  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23456.

	* src/omp.c (print_report_prognostic_xml): Add the scan and host start
	and end elements, at least because the NBE report requires them.

2015-09-28  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version to 6.0.7.

2015-09-28  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 6.0.6 release.

	* CHANGES: Updated.

	* CMakeLists.txt: Raise required openvas-libraries version to 8.0.5.

	* INSTALL: Update required openvas-libraries version.

2015-09-24  Hani Benhabiles <hani.benhabiles@greenbone.net>

	Backport r23037.

	* src/manage.c (get_osp_scan_report): New function.
	(handle_osp_scan): Adjust to use new function. Only get detailed scan
	report when scan is finished.

2015-09-22  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r23421.

	* src/omp.c (omp_xml_handle_end_element): In case CLIENT_CREATE_CONFIG
	make message for failure to get scanner params more verbose.

2015-09-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23374.

	* CMakeLists.txt: Make the OPENVAS_SQLITE_SLEEP_MAX default 0, because
	this showed much much better responsiveness (compared to 5000000) on a
	heavily loaded machine.

2015-09-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport missing case from r23306.

	* src/sql_sqlite3.c (sql_prepare_internal): Use
	OPENVAS_SQLITE_SLEEP_MAX.

2015-09-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23357.

	* CMakeLists.txt, src/CMakeLists.txt: Use DEFINED for
	OPENVAS_SQLITE_SLEEP_MAX because 0 is a valid value but it is considered
	to be FALSE.

	* src/sql_sqlite3.c (sql_open): Add debug log that include sleep time.
	(sql_prepare_internal, sql_exec_internal, sql_bind_blob, sql_bind_int64)
	(sql_bind_double, sql_bind_text, sql_reset): If OPENVAS_SQLITE_SLEEP_MAX
	is 0 skip the openvas_usleep call entirely.

2015-09-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23325.

	* src/manage_sql.c (print_report_xml): Add USER_TAGS to TASK.

	* src/schema_formats/XML/OMP.xml.in (report): Add missing TASK elements.

	* doc/omp.rnc, doc/omp.html: Update from source.

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

	Backport r23306.

	* CMakeLists.txt, src/CMakeLists.txt: Set OPENVAS_SQLITE_SLEEP_MAX.

	* src/sql_sqlite3.c (sql_prepare_internal, sql_exec_internal)
	(sql_bind_blob, sql_bind_int64, sql_bind_double, sql_bind_text)
	(sql_reset): Use OPENVAS_SQLITE_SLEEP_MAX.

2015-08-28  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23199.

	* src/otp.c (process_otp_scanner_input): Check the transaction while
	parsing, to prevent locking the db for too long.

2015-08-27  Michael Wiegand <michael.wiegand@greenbone.net>

	* CHANGES: Updated in preparation for the upcoming 6.0.6 release.

2015-08-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23170.

	* src/manage_sql.c (check_db_configs): Adjust Discovery NVT selector for
	moved and removed Service Detection NVTs.

	* src/manage_config_discovery.c (make_config_discovery): Remove NVTs
	from "Service detection" that were moved to "Product detection" or
	removed from scanner.

2015-08-26  Hani Benhabiles <hani.benhabiles@greenbone.net>

	Backport r23133 and r23164.

	* src/omp.c (omp_xml_handle_end_element): Log authentication failure.

	* src/openvasmd.c (accept_and_maybe_fork): Set global variable
	client_address.

2015-08-25  Matthew Mundell <matthew.mundell@greenbone.net>

	Commit files missed in last commit.

2015-08-25  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23151.

	Give up when doing the nvti cache update check and the database is busy,
	because this is done in the main omp service loop, so it could delay the
	service of OMP clients.

	* src/manage.c (manage_schedule): Handle new giveup return.

	* src/manage_sql.c (manage_update_nvti_cache): Wrap in a transaction,
	in order to giveup if the database is busy.

	* src/manage_sql.h: Adjust header accordingly.

	* src/sql_pg.c (sql_begin_immediate_giveup): New function.

	* src/sql_sqlite3.c (sql_begin_immediate_giveup): New function.

	* src/sql.h: Add header accordingly.

2015-08-24  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23138.

	For slave tasks, add the host details of finished hosts, even if the
	task is still running.

	* src/manage.c (update_end_times): Remove add_host_details arg.
	Only add host details when setting end time.  Only set end time when
	the end time was not set before.
	(slave_setup): Remove arg from add_host_details, so that the details
	are added when the task is running too.

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

	* src/manage.h: Add header accordingly.

2015-08-21  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23117.

	* src/manage_sql.c (struct result_buffer, result_buffer_t)
	(result_buffer_new, result_buffer_new, result_buffer_free): Move up in
	file.
	(compare_port_severity): Rename variable back, was host after all.  Use
	struct instead of messing around with memory.
	(print_report_port_xml): Remove notes.  Host is considered in
	compare_port_severity.

2015-04-21  Matthew Mundell <matthew.mundell at greenbone.net>

	Backport r23110.

	* src/manage_sql.c (struct result_buffer, result_buffer_new): Add
	severity_double.
	(print_report_port_xml): When buffering results include the severity in
	the duplicate check, otherwise higher-severity results may be removed
	when the results are sorted by increasing severity (which happens for
	alerts that do not have filters).

2015-08-20  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r23102.

	* src/manage_sql.c (manage_report_filter_controls): Mark field.
	(compare_port_severity): Rename variable.
	(report_filter_term): Mark field.
	(struct result_buffer, result_buffer_t): New type.
	(result_buffer_new, result_buffer_free): New functions.
	(print_report_port_xml): Use a struct instead of messing about with
	memory directly.

2015-04-21  Matthew Mundell <matthew.mundell at greenbone.net>

	Backport r22176.

	* src/manage.c (fork_osp_scan_handler): Init manage session, in case the
	OSP handling ever uses the current_credentials table.

2015-08-20  Michael Wiegand <michael.wiegand@greenbone.net>

	Backport r23096.

	* src/report_formats/Verinice_ISM/Verinice_ISM.xsl: Ignore results
	marked as "False Positive" for the verinice export.

2015-08-06  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22981.

	* src/manage.c (run_task, manage_schedule): Init manage session after
	reinit_manage_process, so that the current_credentials table is created
	with SQLite.

2015-08-14  Michael Wiegand <michael.wiegand@greenbone.net>

	Backport r23050.

	* src/manage_sql.c (send_to_sourcefire, send_to_verinice)
	(manage_report, manage_send_report): Check effective user ID instead
	of user ID when deciding if privileges need to be dropped.

2015-08-14  Michael Wiegand <michael.wiegand@greenbone.net>

	Port r20857 from openvas-manager-5.0 branch.

	* tools/greenbone-scapdata-sync.in, tools/greenbone-certdata-sync.in:
	Check if the current user is indeed the owner of the database and
	abort before doing any write operations if not.

2015-08-13  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (make_osp_result): Remove a line accidentally left
	in the backport of r22496 (r22924).

2015-08-07  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r22993.

	* src/omp.c (handle_get_scanners): Add names of OSP params to response.

2015-08-07  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22986.

	* src/manage_pg.c (manage_create_sql_functions): Add current_severity.
	(create_tables): Use current_severity to get dynamic severity in
	views, so that special case severities like -3.0 are checked.  Use
	current_severity for functions too, to reduce duplication.

	* src/manage_sqlite3.c (create_tables): In result_new_severities add
	check for special case severities to dynamic severity retrieval.

2015-08-06  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22982.

	* src/manage_sql.c (init_port_range_iterator): Use
	acl_user_has_access_uuid for permission check for single port list
	case, so that Super check is done.

2015-08-03  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version to 6.0.6.

2015-08-03  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 6.0.5 release.

	* CHANGES: Updated.

2015-08-03  Michael Wiegand <michael.wiegand@greenbone.net>

	Backport r22358 by Hani Benhabiles.

	* src/report_formats/Anonymous_XML/generate,
	src/report_formats/ARF/generate,
	src/report_formats/CPE/generate, src/report_formats/CSV_Hosts/generate,
	src/report_formats/CSV_Results/generate,
	src/report_formats/HTML/generate, src/report_formats/ITG/generate,
	src/report_formats/LaTeX/generate, src/report_formats/NBE/generate,
	src/report_formats/PDF/generate, src/report_formats/TXT/generate,
	src/report_formats/Topology/generate,
	src/report_formats/Verinice_ISM/generate,
	src/report_formats/Verinice_ITG/generate,
	src/report_formats/XML/generate, src/schema_formats/HTML/generate,
	src/schema_formats/RNC/generate, src/schema_formats/XML-brief/generate,
	src/alert_methods/Sourcefire/alert, src/alert_methods/verinice/alert,
	src/schema_formats/XML/generate: Add WORLD_EXECUTE permission.

2015-07-29  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (make_osp_result): Fix sql statement columns change
	from last commit.

2015-07-29  Hani Benhabiles <hani.benhabiles@greenbone.net>

	Backport r22496.

	* src/manage.c (parse_osp_report, fork_osp_scan_handler): Adjust
	make_osp_result() call. Get result port from OSP scan report.
	(make_osp_result): Insert result port in DB.

2015-07-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22901.

	Use an email alert "message" for the defaults when attaching or
	including a report.  Add $i and $t to the message.

	* src/manage_sql.c (REPORT_NOTICE_FORMAT, REPORT_ATTACH_FORMAT): Remove.
	(alert_message_print): Add $i to include the report, and $t to include
	a note when the report is truncated.
	(escalate_2): When including or attaching in an email, and there is no
	message, use a default message instead of printing the default email by
	hand.  Also remove handling of the notes and included report, because
	these are now available with $i and $t in the message.

	* src/manage.h  (ALERT_MESSAGE_INCLUDE, ALERT_MESSAGE_ATTACH): New
	defines.  Default messages.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_ALERTS, when the
	method is email and a report is being attached/included and there is no
	message, send the default message.  This ensures old alerts get the
	default message.

2015-07-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22876.

	* src/manage_sql.c (escalate_2): Free term and report_zone.

2015-07-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22869.

	Add a simple host summary as $H for alert messages.

	* src/manage_sql.c (alert_message_print): Add Host Summary.
	(escalate_2): Get host summary from manage_report and pass to
	alert_message_print.
	(host_summary_append): New function.
	(print_report_xml, manage_report): Add host_summary arg.

	* src/manage.h: Update header accordingly.

2015-07-20  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22858.

	Add "subject" and "message" method data for email alerts, so that the
	user can set these fields.

	* src/manage_sql.c (create_alert, modify_alert): Check subject and
	message length.
	(email): Add a newline after the body, in case the user supplied message
	is missing a newline.
	(alert_subject_print, alert_message_print): New functions.
	(escalate_2): Use user's subject and message if given.
	(print_report_xml, manage_report): Add filter term and timezone return
	args.
	(manage_send_report): Add dummy args for print_report_xml.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): Handle new error returns from
	create_alert and modify_alert.

2015-07-24  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r22895.

	* src/manage.c (validate_username): Allow dot (.) in username.

2015-07-23  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r22871.

	* src/manage_sql.c (modify_setting): Save "Chinese" as "zh_CN".

2015-07-23  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r22887.

	* src/manage_sql.c (init_asset_iterator): Remove extra FROM clause.

2015-07-23  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r22885.

	* src/manage_sql.c (task_severity, init_asset_iterator)
	(report_scan_result_count, report_severity_data, filtered_host_count):
	If NVT cannot be found for dynamic severity without overrides, use
	static severity instead.

2015-07-23  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r22883.

	* src/manage_sqlite3.c (create_tables): Drop and recreate views for
	consistency with PostgreSQL version and to avoid migrators for changes
	that do not affect the column schema.

2015-07-23  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r22877.

	* src/manage_sql.c (report_severity_data): Get severity values from
	result_new_severities view.

2015-07-23  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r22797 by Matthew Mundell.

	* src/manage_pg.c (manage_create_sql_functions, create_tables): When
	getting the severity of a result dynamically from the nvts table, fall back
	to the static result severity when the nvts table value is NULL, because
	results of OSP scans do not have an associated NVT in the nvts table.

	* src/manage_sqlite3.c (create_tables): As above.

2015-07-20  Hani Benhabiles <hani.benhabiles@greenbone.net>

	Backport r22861.

	* src/omp.c (check_scanner_cert): Check certificate activation and
	expiration times.

2015-07-13  Hani Benhabiles <hani.benhabiles@greenbone.net>

	Backport r22801.

	* src/manage_sql.c (init_report_errors_iterator): Simplify query to not
	duplicate values in certain cases.

2015-07-13  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r22796.

	* src/manage.c (manage_schedule): Add a sigset_t* parameter to
	the parameter fork_connection and pass sigmask_current to
	fork_connection.

	* src/manage.h (manage_schedule): Add a sigset_t* parameter to
	the first parameter (fork_connection).

	* src/openvasmd.c (fork_connection_for_schedular): Add parameter
	sigmask_current and used it to restore the sigmask in the child of the
	first fork.

2015-07-10  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22772.

	Adjust iterator call so that credentials are found when a user runs a
	task that uses someone else's credentials.

	* src/manage_sql.c (init_user_lsc_credential_iterator): Remove.
	(init_lsc_credential_iterator_one): New function.

	* src/manage.h: Add header accordingly.

	* src/manage.c (slave_setup, get_osp_task_options, run_task): Use
	init_lsc_credential_iterator_one to get credential details, so that
	permission checks are done.

2015-07-09  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version to 6.0.5.

2015-07-09  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 6.0.4 release.

	* CHANGES: Updated.

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

	Backport r22192. Original patch by Matthew Mundell.

	* src/manage_sql.c (trash_config_readable_uuid): Init found.

2015-07-06  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r22695.

	* src/manage_sql.c (modify_setting): Also accept colon-separated lists
	of ISO language or language and country codes for the setting
	"User Interface Language". Convert old names other than
	"Browser language" to codes.

2015-07-06  Michael Wiegand <michael.wiegand@greenbone.net>

	Backport r22665. Original patch by Timo Pollmeier.

	* src/manage_sql.c (event): Use GArray functions for alerts_triggered
	instead of GPointerArray / array_t ones as pointers can be a different
	size than alert_t on some systems.

2015-07-06  Michael Wiegand <michael.wiegand@greenbone.net>

	Backport r22691.

	* src/manage.c: Define _GNU_SOURCE so pthread_sigmask () is correctly
	declared with glibc < 2.19.

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

	Backport r22683.

	* src/manage_sql.c (qod_from_type): Add case for "general_note".

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

	Backport r22681.

	Ensure that each task is added only once to the starts and stops list
	of the scheduling, preferring the owner of the task or schedule as the
	user starting or stopping the task.

	* src/manage_sql.c (init_task_schedule_iterator): Sort by Task ID and
	by whether the user matches the task or schedule owner.

	* src/manage.c (manage_schedule): Add each task only once to the starts
	and stops lists.

2015-06-17  Hani Benhabiles <hani.benhabiles@greenbone.net>

	Backport r22650.

	* src/manage_sql.c (init_report_erors_iterator): Don't limit query to
	results with empty nvt value.

2015-06-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22642.

	* src/manage_sql.c (event): Run the alerts outside the iterator, to
	prevent them from blocking update commands.

2015-06-15  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22637.

	* src/manage.c (manage_schedule): Add sigmask_current arg.  Restore this
	sigmask in forked child, so that it has sensible signal handling.

	* src/manage.h: Update header accordingly.

	* src/openvasmd.c (serve_and_schedule): Pass sigmask_current to
	manage_schedule.

2015-06-09  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r22599.

	* src/manage_sql.c (report_counts_match): Look for search_phrase
	in the name and the last tag of the NVT.  Use strcasestr to compare
	port, host, NVT OID and description to search_phrase when
	search_phrase_exact is 0.

2015-06-04  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r22580.

	* src/manage_pg.c (manage_create_sql_functions): Add "log" cases to
	severity_in_level function and also count severity scores between 0.0
	and 4.0 if severity_class is pci-dss.

2015-06-04  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r22577.

	* src/omp.c (omp_xml_handle_start_element): In case
	CLIENT_CREATE_REPORT_RR_RESULTS_RESULT add branch for DESCRIPTION
	element.

2015-06-03  Hani Benhabiles <hani.benhabiles@greenbone.net>

	Backport r22535.

	* src/manage_sql.c (check_db_tasks, make_osp_result): Set result owner
	and date.

2015-06-03  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22522.  Original patch by Benot Allard.

	* src/manage_sql.c (modify permission): Fix parameter in function call.

2015-06-03  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22556.

	* src/manage_sql.c (RESULT_ITERATOR_COLUMNS)
	(RESULT_ITERATOR_FILTER_COLUMNS): Add NVT cve as "cve".

2015-06-03  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22550.

	* src/manage_sql.c (RESULT_ITERATOR_COLUMNS)
	(RESULT_ITERATOR_FILTER_COLUMNS): Add task_id.

2015-06-01  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22519.

	* src/manage_sql.c (permission_is_predefined): Add resource clause,
	because it's possible to create permissions on roles now, as long as
	they have resources.
	(modify_permission): Similarly, add resource check.

2015-05-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22480.

	Deal with issues found by Clang's ccc-analyzer.

	* src/manage.c (slave_setup): Store done status in a variable, to make
	it easier for Clang to see that "report" is always initialised before
	use.
	(manage_run_wizard): Remove init of ret, as it is initialised later.

	* src/manage_sql.c (email, send_to_sourcefire, send_to_verinice)
	(manage_report, manage_send_report, manage_schema): Check system return,
	now that the /bin/sh call is gone.
	(print_report_xml): Explicitly check "type", to make
	it possible for Clang to see that result_count is always initialised
	before use.
	(modify_permission): Check correct variable.

	* src/schema_formats/XML/generate: Ensure that exit code is 0.

	* src/lsc_crypt.c (lsc_crypt_decrypt): Get the address of nl->name via
	pointer arithmetic, to help Clang figure out that there's enough room
	there.

	* src/omp.c (send_get_common): Remove setting of "writable", as it is
	not used after that.

2015-05-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22472.

	* src/manage_sql.c (report_counts_match): String and SQL quote
	min_cvss_base for CAST.

2015-05-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22458.

	* src/manage_sql.c (check_permission_args): Allow the user to give a
	predefined role permission on a resource, as long as the user owns the
	resource.

2015-05-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22457.

	* src/manage_sql.c (check_permission_args): Correct subject check.

2015-05-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_permission): Correct function name.

2015-05-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22207.

	Use the create_permission arg checks for modify_permission too.  This
	brings modify_permission up to date, including allowing the user to
	modify a resource permission if the user has GET access to the subject.

	* src/manage_sql.c (check_permission_args): New function.  From
	create_permission.
	(create_permission): Call check_permission_args to do arg checks.
	(permission_subject_id, permission_resource_type)
	(permission_resource_id): New functions.
	(modify_permission): Let check_permission_args do the arg checks.

2015-05-25  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22445, but do the check every time instead of in a migrator.

	* src/manage_sql.c (check_generate_scripts): New function.
	(check_db): Check generate scripts.

	* src/manage.h: Add header accordingly.

2015-05-25  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22443.

	* src/manage_sql.c (create_report_format): Create the "generate" script
	with execute permission, now that execute is required to run the script.

2015-05-24  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22440.

	* src/manage_acl.c (acl_where_owned_user): Correct comparison by using
	g_str_has_prefix.  Previous version was comparing the whole string
	instead of looking for a prefix.  This was causing the global resources
	to be excluded when a GET_XXX permission was requested.

2015-05-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22378.

	* src/omp.c (omp_xml_handle_end_element): Replace aborts in GET_TASKS
	with g_errors.

2015-05-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22181.

	* src/manage_sql.c (create_permission): Allow the user to create a
	resource permission if the user has GET access to the subject, as
	requiring MODIFY access to the subject is too strict.

2015-05-18  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r22381.

	* src/manage_sql.c (where_levels_auto, where_levels_type): Use the
	function severity_in_level for log level.

	* src/manage.c (severity_in_level): Add "log" as alias for "none"
	and also count results with non-zero severity as log for pci-dss.

2015-05-15  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22377.

	* src/omp.c (results_xml_append_nvt): Add CVE to NVT in "CVE-" case, so
	that the CVE appears in the References section on the GSA Result
	Details.

2015-05-15  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport a little of r22124 and r22165.

	* src/omp.c (results_xml_append_nvt): Add CVE case.  Move CVE info into
	NVT.

2015-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22372.

	* src/manage.c (severity_in_level): Update PCI-DSS min.

	* src/manage_pg.c (manage_create_sql_functions): Update PCI-DSS min.

	* src/manage_sql.c (severity_class_xml): Update PCI-DSS min.

	* src/manage_utils.c (level_min_severity): Update PCI-DSS min.

2015-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22186.  Original patch by Hani Benhabiles.

	* src/manage_sql.c (find_trash): Add check for function parameter.

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

	Backport r22359.  (And cve_cvss_base from r22124.)

	* src/manage_sql.c (make_osp_result): If the severity is not given and
	the NVT is a CVE, then get the severity from the SecInfo database.
	(cve_cvss_base): New function.

	* src/manage.h: Add header accordingly.

2015-05-12  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r22356.

	* src/manage_sql.c (init_asset_iterator, filtered_host_count): Filter
	out results with QoD less than MIN_QOD_DEFAULT in the levels check.

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

	Backport r22298.

	* src/manage_sql.c (trim_partial_report): Compare end_time to 0 because
	it's an integer now.

2015-05-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22347.

	* src/manage_sql.c (send_to_sourcefire, send_to_verinice, manage_report)
	(manage_send_report, manage_schema): Remove "/bin/sh" from commands, now
	that all scripts are installed as executable.

2015-05-11  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version to 6.0.4.

2015-05-11  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 6.0.3 release.

	* CHANGES: Updated.

2015-05-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22327.

	* CMakeLists.txt: Add back prefix removed in last patch.  Needed because
	OMP.xml is generated.

2015-05-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22325.

	* report_formats/IVIL/generate,
	report_formats/simple_bar_chart/generate,
	report_formats/simple_map_plot/generate,
	report_formats/simple_pie_chart/generate,
	report_formats/simple_topo_plot/generate,
	report_formats/sourcefire/generate, report_formats/tls-map/generate,
	src/alert_methods/Sourcefire/alert, src/alert_methods/verinice/alert,
	src/report_formats/ARF/generate,
	src/report_formats/Anonymous_XML/generate,
	src/report_formats/CPE/generate, src/report_formats/CSV_Hosts/generate,
	src/report_formats/CSV_Results/generate,
	src/report_formats/HTML/generate, src/report_formats/ITG/generate,
	src/report_formats/LaTeX/generate, src/report_formats/NBE/generate,
	src/report_formats/PDF/generate, src/report_formats/TXT/generate,
	src/report_formats/Topology/generate,
	src/report_formats/Verinice_ISM/generate,
	src/report_formats/Verinice_ITG/generate,
	src/report_formats/XML/generate, src/schema_formats/HTML/generate,
	src/schema_formats/RNC/generate, src/schema_formats/XML-brief/generate,
	src/schema_formats/XML/generate: Add execute permission.

	* CMakeLists.txt: Install generate and alert scripts with execute
	permissions.

2015-05-08  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r22205.

	Add min_qod filter keyword for get_results so the QoD filtering can be
	consistent with get_tasks and get_reports.

	* src/manage_sql.c (init_result_get_iterator, result_count): Add
	parameter min_qod.

	* src/manage.h (init_result_get_iterator, result_count): Add parameter.

	* src/omp.c (xml_handle_end_element): In case CLIENT_GET_RESULTS
	get min_qod filter keyword and pass it to init_result_get_iterator and
	result_count.

2015-05-08  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r22182.

	Add min_qod filtering for Task and Report lists.

	* src/manage_pg.c (manage_create_sql_functions): Add min_qod parameter
	to SQL functions task_trend, report_severity, report_severity_count,
	task_severity and task_threat_level.

	* src/manage_sql.c (init_aggregate_iterator): Add min_qod from filter
	as parameter to type_opts_table call.
	(condition_met): Add MIN_QOD_DEFAULT as parameter to calls of
	task_severity_double.
	(TASK_ITERATOR_COLUMNS): Add min_qod parameter for task_threat_level,
	task_trend and task_severity SQL functions.
	(task_iterator_opts_table): Add min_qod parameter and column.
	(init_user_task_iterator): Add MIN_QOD_DEFAULT as min_qod parameter
	for task_iterator_opts_table.
	(init_task_iterator, task_count): Add min_qod from filter as parameter
	for task_iterator_opts_table.
	(task_severity, task_severity_double): Add min_qod parameter.
	(REPORT_ITERATOR_COLUMNS): Add min_qod parameter for report_severity
	and report_severity_count SQL functions.
	(report_iterator_opts_table): Add min_qod parameter and column.
	(report_count): Add MIN_QOD_DEFAULT as min_qod parameter
	for task_iterator_opts_table.
	(init_report_iterator): Add min_qod from filter as parameter
	for report_iterator_opts_table.
	(report_counts, report_severity, task_trend, type_opts_table): Add
	min_qod parameter.

	* src/manage_sqlite3.c (sql_task_trend): Add min_qod parameter.
	(sql_severity_t, clear_cache): Add min_qod field.
	(cached_task_severity, sql_task_threat_level, sql_report_severity)
	(report_severity_count, sql_report_severity_count, sql_task_severity):
	Add min_qod parameter.
	(manage_create_sql_functions): Increase parameter counts to account for
	new min_qod parameter of task_trend, task_threat_level, report_severity
	report_severity_count and task_severity.

	* src/manage.h (task_trend, task_severity, task_severity_double)
	(report_severity, report_counts, type_opts_table): Add parameter.

	* src/omp.c (send_reports): Add min_qod parameter.
	(omp_xml_handle_end_element): In CLIENT_GET_REPORTS case, get min_qod
	from report_filter and add it to the new results filter.
	In CLIENT_GET_TASKS case use min_qod when getting counts of reports.

2015-05-08  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r22164.

	* src/manage_sql.c (init_get_iterator): Correct insertion order of
	"_trash" suffix and extra_tables into the SQL string.

2015-05-08  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r22156.

	* src/manage_sql.c (type_columns, type_select_columns)
	(type_filter_columns, type_trash_columns, type_opts_table)
	(type_table): Add documentation.

2015-05-08  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r22155.

	* src/manage_sql.c (result_iterator_opts_table): New function.
	(init_result_get_iterator, result_count): Use the new function to get
	extra_tables for consistency with Tasks and Reports.

2015-05-08  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r22154.

	Adapt Report iterators to use the new FROM clause options instead of
	macro parameters.

	* src/manage_sql.c (REPORT_ITERATOR_COLUMNS): Remove macro parameters
	and use extra columns added in FROM clause for the options instead.
	(report_iterator_opts_table): New function.
	(report_count, init_report_iterator): Adapt to new structure of
	REPORT_ITERATOR_COLUMNS.

2015-05-08  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r22153.

	Adapt Task and aggregate iterators to use the new FROM clause options
	instead of macro parameters.

	* src/manage_sql.c (init_aggregate_iterator): Get SQL for the opts
	table of the current type and add them to the FROM clause.
	(TASK_ITERATOR_COLUMNS): Remove macro parameters and use extra
	columns added in FROM clause for the options instead.
	(task_iterator_opts_table): New function.
	(init_user_task_iterator, init_task_iterator, task_count, type_columns)
	(type_select_columns, type_trash_columns): Adapt to new structure of
	TASK_ITERATOR_COLUMNS.
	(type_opts_table): New function.

	* src/manage.h (type_opts_table): New function prototype.

2015-05-08  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r22142.

	Allow setting options like autofp and overrides in iterator columns
	via an addition to the FROM clause, which is more flexible than
	macro parmeters. Use this in init_result_get_iterator.

	* src/manage_sql.c (init_get_iterator): Add extra_tables parameter for
	adding to the FROM clause.
	(init_alert_iterator, init_task_iterator, init_report_iterator): Add
	NULL extra_tables parameter to init_get_iterator calls.
	(RESULT_ITERATOR_COLUMNS): Remove macro parameters and use extra
	columns added in FROM clause for the options instead.
	(RESULT_ITERATOR_COLUMN_COUNT, RESULT_ITERATOR_COLUMNS_ARRAY): Remove.
	(init_result_get_iterator, result_count): Use RESULT_ITERATOR_COLUMNS
	and an addition to the FROM clause via extra_tables instead of the now
	removed RESULT_ITERATOR_COLUMNS_ARRAY.
	(init_target_iterator, init_config_iterator, init_nvt_info_iterator)
	(init_lsc_credential_iterator, init_agent_iterator, init_note_iterator)
	(init_override_iterator, init_scanner_iterator, init_schedule_iterator)
	(init_report_format_iterator, init_slave_iterator, init_group_iterator)
	(init_permission_iterator, init_port_list_iterator, init_role_iterator)
	(init_filter_iterator, init_cpe_info_iterator, init_cve_info_iterator)
	(init_ovaldef_info_iterator, init_cert_bund_adv_info_iterator)
	(init_dfn_cert_adv_info_iterator, init_user_iterator)
	(init_tag_iterator, init_tag_name_iterator): Add NULL extra_tables
	parameter to init_get_iterator calls.

2015-05-07  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22311.

	* src/manage_sql.c (TASK_ITERATOR_FILTER_COLUMNS)
	(TASK_ITERATOR_COLUMNS): Rename first and last to first_report and
	last_report.  Add first and last.  This is so that sorting by last
	sorts by date, to match the Last column on the GSA Tasks page.

2015-05-07  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22306.

	* src/manage.c (slave_sleep_connect): Also stop for
	TASK_STATUS_STOP_REQUESTED.
	(run_slave_task): Add stop check to initial connect loop.

2015-05-07  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22299.

	* src/openvasmd.c (accept_and_maybe_fork): Add sigmask_current arg.
	Restore this sigmask in the forked child so that it has sensible signal
	handling.
	(serve_and_schedule): Pass sigmask to restore to accept_and_maybe_fork.

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

	Backport r22288.

	* src/report_formats/Verinice_ITG/generate: Correct XSL file name.

2015-04-05  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22286.

	Make report format "Verinice ITG" predefined.

	* src/manage_sql.c (check_db_report_formats)
	(format_predefined): Add Verinice ITG.

	* CMakeLists.txt: Install Verinice ITG.

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

	Backport r22284.

	* src/report_formats/Verinice_ITG/create_report_import: Remove.

	* src/report_formats/Verinice_ITG/gsm_verinice_itg.xsl: Remove.  Now
	Verinice_ITG.xsl.

	* src/report_formats/Verinice_ITG/Verinice_ITG.xsl: New file.  Was
	gsm_verinice_itg.xsl.

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

	Backport r22283.

	* report_formats/verinice-itg: Remove.  Now in src/report_formats.

	* src/report_formats/Verinice_ITG: New directory.  Was
	report_formats/verinice-itg.

2015-05-04  Matthew Mundell <matthew.mundell@greenbone.net>

	Backport r22277.

	* src/manage_sql.c (move_report_format_dir): New function.  Works across
	devices.
	(delete_report_format, manage_restore): Use move_report_format_dir so
	that copying across devices works.

2015-04-30  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version to 6.0.3.

2015-04-30  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 6.0.2 release.

	* CHANGES: Updated.

2015-04-28  Hani Benhabiles <hani.benhabiles@greenbone.net>

	Backport r22241.

	* src/openvasmd.c (manager_listen): New function. Add support for IPv6
	addresses.
	(main): Call manager_listen() to create listener sockets, parse address
	and port values and bind sockets for both possible addresses.
	(manager_address, manager_address_2): Remove variables.

2015-04-28  Michael Wiegand <michael.wiegand@greenbone.net>

	Backport r22227.

	Ensure openvas-manager builds with GLib =< 2.32 by making sure the
	GLib thread API is initialised when using older GLib versions. Based
	on patch suggested by Miguel Angel Cabrera Moya.

	* src/openvasmd.c (main): Initialise old GLib thread API when
	necessary.

	* CMakeLists.txt: Check for presence of libgthread if necessary and
	gather flags.

	* src/CMakeLists.txt: Make sure LDFLAGS set when linking against
	libgthread is necessary are used in linking.

2015-04-20  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r22158.

	* src/manage_sql.c (where_search_phrase): Filter for search_phrase also
	using last NVT tag and NVT name.

2015-04-14  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r22109.

	Add new --optimize options rebuild-report-cache and
	update-report-cache.

	* INSTALL: Add description of new --optimize options.

	* src/manage_sql.c (report_severity_data): Add prototype and make
	static.
	(cache_report_counts): Add prototype and new make_transaction parameter
	to make the SQL transaction commands optional, so it can also be run
	inside another transaction.
	(reports_build_count_cache): New function.
	(report_counts_id_filt): Add make_transaction parameter to call of
	cache_report_counts.
	(manage_optimize): Add new options rebuild-report-cache and
	update-report-cache.

	* src/manage.h (reports_build_count_cache): New function prototype.

	* src/openvasmd.c (main): Add new --optimize options to help text.

2015-04-14  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r22076.

	* src/manage_sql.c (report_counts_match): Add missing quotes around oid
	value in search_phrase && search_phrase_exact case.

2015-04-10  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Backport r22101.

	* src/manage_sql.c (report_severity_data): Add QoD clause in case
	without overrides.

2015-04-10  Sven Haardiek <sven.haardiek@greenbone.net>

	* CMakeLists.txt: Fixed cmake error while compliling with postgresql
	support. This patch was developed by Ryan Schulze.

2015-04-01  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Post-release version bump.

	* CMakeLists.txt: Updated version number 6.0.2.

2015-04-01  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Preparing the openvas-manager 6.0.1 release.

	* CHANGES: Updated.

2015-03-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (modify_permission): Find subject with modify permission,
	as is done in create_permission.

2015-03-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (parse_tags): Add the cvss_base_vector tag and skip
	cvss_base, as was done in the past.

2015-03-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_report_format): Prefer the signature from
	the feed when verifying the report format for CREATE_REPORT_FORMAT,
	because this is what VERIFY_REPORT_FORMAT does.  This ensures the trust
	state will be right when importing report formats.

2015-03-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml.in (get_config, get_filters)
	(get_lsc_credentials, get_port_lists, get_report_formats, get_scanners)
	(get_schedules, get_slaves, get_tags, get_targets, get_tasks)
	(get_users): Add optional empty PERMISSIONS on dependent resources.
	(get_alerts): Add TASKS and empty PERMISSIONS.

	* doc/omp.rnc, doc/omp.html: Update from source.

2015-03-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (main): Handle all manage_delete_user returns.

2015-03-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml.in (timezone): New element.
	(report, authenticate, create_schedule, get_reports, get_schedules)
	(modify_schedule): Use timezone for timezones.

2015-03-30  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage.c (run_task): Don't send unused
	ntp_keep_communication_alive preference.

2015-03-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (where_owned_user): Only include the global resources
	when a GET permission is requested, instead of always including them.
	The global resources are read only, so including them when only modify
	permission is requested does not make sense.

2015-03-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_permission): Allow the user to create the
	permission if the user has "modify" access to the subject.  This allows
	users to create permissions on roles owned by other users, for example.

2015-03-26  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage.c (run_task): Don't send unused ntp_client_accepts_notes and
	ntp_opt_show_end preferences.

2015-03-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (set_task_config): Add space in SQL.

2015-03-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (modify_user): Do not remove the Super Admin role
	when setting roles, because giving the user this role is not allowed.
	This disables the ability to remove the Super Admin role from a user,
	but that's OK because there's no way to give a user the role either.

2015-03-25  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (task_alterable): Remove permission check.

2015-03-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (slave_port_list_uuid): New variable.
	(slave_setup, delete_slave_task): Delete port list on slave too.

2015-03-25  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (task_severity): Consider only results with a
	minimum QoD of MIN_QOD_DEFAULT.

2015-03-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (serve_and_schedule): Enable regular signals before
	raise, otherwise the termination signal will be blocked and pselect will
	run again with closed file descriptors.

2015-03-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (log_config_free): New function.
	(cleanup, update_or_rebuild_nvt_cache, main): Use log_config_free, to
	prevent log_config from being freed twice.

2015-03-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_task_schedule_iterator): Instead of getting
	tasks where the owner has permission on the schedule, get tasks where
	any user has permission on both the task and the schedule.

2015-03-24  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* tools/cert_bund_update_pg.xsl, tools/cert_bund_update.xsl: Also add
	or overwrite advisories if the date is equal to the refdate as it
	contains useful no time of day information, so they might otherwise
	be skipped if they were published or updated on the same day.

2015-03-24  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_acl.c (where_owned_user): Treat missing filter keywords
	owner and permission as if they had the value "any". The old default
	behavior can be reproduced by using the keywords with an empty value.

2015-03-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (report_severity_data): Add missing QOD field, which
	is used by report_counts_match.

2015-03-23  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/CMakeLists.txt: Make detection of thread library dynamic instead
	of using hardcoded linker flags.

2015-03-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (serve_and_schedule): Use pselect to block signals
	outside the select call, otherwise the select call will sit for
	SCHEDULE_PERIOD when a signal is received after the termination_signal
	check but before the select call.

	* src/CMakeLists.txt: Add -lphtread to openvasmd.

2015-03-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (run_task): Use correct permission name.  Reset task
	status on failure.

2015-03-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (set_report_format_param): Correct doc.

2015-03-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (copy_target, delete_lsc_credential)
	(lsc_credential_in_use, trash_lsc_credential_in_use)
	(init_lsc_credential_target_iterator): Add missing ESXI credential
	cases.

2015-03-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_migrators.c (migrate_145_to_146): Add IF EXISTS to DROPs,
	to avoid warning if db is old.

2015-03-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Always send trust as "yes" for
	predefined report formats.

2015-03-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (report_filter_term): Quote timezone in case it has
	multiple words, like "Coordinated Universal Time" does.

2015-03-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_result_iterator): Get severity according to
	current user, instead of according to result owner, because the two
	users may have different overrides.

2015-03-17  Benot Allard  <benoit.allard@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: 6.0.1

2015-03-17  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 6.0.0 release.

	* CHANGES: Updated.

	* CMakeLists.txt: Switch version scheme.

2015-03-17  Matthew Mundell <matthew.mundell@greenbone.net>

	Enable mixing of the current user's groups and users, with other
	people's groups and users, when permissions allow it.

	* src/manage_sql.c (init_user_group_iterator): Add column indicating
	whether the group is readable.
	(user_group_iterator_readable): New function.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): Send empty PERMISSIONS in
	GROUP in GET_USERS when group is not readable.

2015-03-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (create_tables): Correct reference in
	role_users_trash.

2015-03-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (find_resource_by_name_with_permission): Correct
	variable access.

2015-03-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_role, manage_restore)
	(manage_empty_trashcan): Delete role users, before roles, for Postgres
	integrity checks.

2015-03-17  Matthew Mundell <matthew.mundell@greenbone.net>

	Enable mixing of the current user's roles and users, with other
	people's roles and users, when permissions allow it.

	* src/manage_sql.c (add_users): Find with permission in case the user is
	owned by someone else.
	(init_user_role_iterator): Add column indicating whether the role is
	readable.
	(user_role_iterator_readable): New function.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): Send empty PERMISSIONS in
	ROLE in GET_USERS when role is not readable.

2015-03-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (send_get_common): Add a case for global
	users/roles/groups because full access to them has been kept for all
	admins.  Remove the special case for retrieving permissions of regular
	users/roles/groups, because they behave like other resource types these
	days.

2015-03-16  Matthew Mundell <matthew.mundell@greenbone.net>

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

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_end_element): Send empty PERMISSIONS in
	RESOURCE in GET_TAGS when resource is not readable.

2015-03-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (setting_value_int): Add missing grouping.

2015-03-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_resource_tag_iterator): Add owner clause,
	otherwise tags of other users are included.

2015-03-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Enable mixing of the current user's filters and alerts, with
	other people's filters and alerts, when permissions allow it.

	* src/manage_sql.c (create_alert, modify_alert): Find with permission in
	case the alert is owned by someone else.
	(alert_iterator_filter_readable): New function.
	(escalate_2): Check that the user may access the filter.
	(escalate_1, manage_alert, manage_send_alert): Add new return.
	(init_filter_alert_iterator): Add column indicating whether the alert is
	readable.
	(filter_alert_iterator_readable): New function.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): Send empty PERMISSIONS in
	FILTER in GET_REPORT_FORMATS when filter is not readable.  Same for
	ALERT in GET_FILTERS when alert is not readable.  Handle new returns
	from manage_send_report and manage_alert.

2015-03-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Enable mixing of the current user's report formats and alerts, with
	other people's report formats and alerts, when permissions allow it.

	* src/manage_sql.c (init_report_format_alert_iterator): Add column
	indicating whether the alert is readable.
	(report_format_alert_iterator_readable): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_end_element): Send empty PERMISSIONS in
	ALERT in GET_REPORT_FORMATS when alert is not readable.

2015-03-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Enable mixing of the current user's credentials and targets, with other
	people's credentials and targets, when permissions allow it.

	* src/manage.c (run_task): Check if user may access credentials.

	* src/manage_sql.c (modify_target): Find credentials with permission, in
	case they are owned by another user.
	(trash_lsc_credential_readable): New function.
	(init_lsc_credential_target_iterator): Add column indicating whether the
	target is readable.
	(lsc_credential_target_iterator_readable): New function.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): Send empty PERMISSIONS in
	TARGET in GET_CREDENTIALS when target is not readable.  Same for
	credentials in GET_TARGETS when credentials are not readable.  In
	CREATE_TARGET find credentials with permission in case someone else
	owns the credential.

2015-03-13  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/schema_formats/XML/OMP.xml.in (get_aggregates): Use Certificate
	instead of Public Key in scanner related commands, for accuracy.

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

	* src/manage_sql.c (create_target): Find port list with permission, in
	case it is owned by another user.

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

	Enable mixing of the current user's port lists and targets, with other
	people's port lists and targets, when permissions allow it.

	* src/manage.c (run_task): Check if user may access port list.

	* src/manage_sql.c (modify_target): Find port list with permission, in
	case it is owned by another user.
	(trash_port_list_readable_uuid): New function.
	(init_port_list_target_iterator): Add column indicating whether the port
	list is readable.  Remove owner constraint on target.  Remove unused
	"all" case.
	(port_list_target_iterator_readable): New function.

	* src/manage.h, src/manage_sql.h: Add headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): Send empty PERMISSIONS in
	TARGET in GET_PORT_LISTS when target is not readable.  Same for port
	list in GET_TARGETS when port list is not readable.

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

	* src/manage_sql.c (delete_permission): Correct permission name.

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

	* src/manage_sql.c (copy_resource_lock): Add missing "s" to command
	name.

2015-03-12  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (report_counts): Change permission parameter of
	find_report_with_permission to "get_reports" so it is a valid command.

2015-03-12  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/schema_formats/XML/OMP.xml.in (get_aggregates): Add an example.

	* doc/omp.rnc, doc/omp.html: Update from source.

2015-03-12  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/omp.c (xml_handle_end_element): In CLIENT_GET_AGGREGATES case,
	set the length parameter of g_markup_escape_text to -1.

2015-03-11  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/omp.c (handle_get_scanners, check_scanner_cert)
	(check_scanner_private, handle_create_scanner, handle_modify_scanner):
	Add functions documentation. Improve code style, and fix compiler
	warning.

2015-03-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.h: Add header.

	* src/manage_acl.c (user_has_access_uuid): Validate the name, otherwise
	any string that starts with "get_" will work.

	* src/manage.c (run_task): Correct command name.

2015-03-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (valid_type, type_pretty_name, type_db_name): Add
	"scanner".

	* src/manage_util.c (valid_db_resource_type): Add "scanner".

2015-03-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Enable mixing of the current user's scanners and tasks, with other
	people's scanners and tasks, when permissions allow it.

	* src/manage.c (run_task): Check if user may access scanner.

	* src/manage_sql.c (init_scanner_task_iterator): Add column indicating
	whether the scanner is readable.  Remove owner constraint on task.
	(scanner_task_iterator_readable): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (handle_get_scanners): Send empty PERMISSIONS in TASK when
	task is not readable
	(omp_xml_handle_end_element): Send empty PERMISSIONS in
	SCANNER in GET_TASKS when scanner is not readable  In CLIENT_CREATE_TASK
	and CLIENT_MODIFY_TASK find the scanner with permission, in case it is
	owned by another user.

2015-03-11  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (init_aggregator_iterator): Check group_column null
	pointer dereference.

2015-03-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Enable mixing of the current user's configs and tasks, with other
	people's configs and tasks, when permissions allow it.

	* src/manage.c (run_task): Check if user may access config.

	* src/manage_sql.c (trash_config_readable_uuid): New function.
	(init_config_task_iterator): Add column indicating whether the config is
	readable.  Remove owner constraint on task.
	(config_task_iterator_readable): New function.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): Send empty PERMISSIONS in
	TASK in GET_CONFIGS when task is not readable.  Same for config in
	GET_TASKS when config is not readable.  In CLIENT_CREATE_TASK and
	CLIENT_MODIFY_TASK find the config with permission, in case it is owned
	by another user.

2015-03-11  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/sql.c, src/sql.h, src/sql_pg.c, src/sql_sqlite3.c (sql_explain)
	(sql_explain_internal): Revert removal, as these are still used for
	debugging purposes.

2015-03-11  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage.c (slave_setup): Fix variable used befored initialization
	compiler warning.

	* src/manage_sql.c (find_target), src/sql.c (sql_x_quiet)
	(sql_string_quiet, sql_explain, src/sql_pg.c (sql_explain_internal),
	src/sql_sqlite3.c (sql_explain_internal): Remove unused function.

	* src/manage.h, src/sql.h: Remove unused prototypes.

	* src/omp.c (handle_create_scanner): Fix duplicate statement in
	comparison.

2015-03-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Enable mixing of the current user's targets and tasks, with other
	people's targets and tasks, when permissions allow it.

	* src/manage.c (run_osp_task, run_task): Check if user may access target.

	* src/manage_sql.c (trash_target_readable): New function.
	(init_target_task_iterator): Add column indicating whether the target is
	readable.  Remove owner constraint on task.
	(target_task_iterator_readable): New function.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): Send empty PERMISSIONS in
	TASK in GET_TARGETS when task is not readable.  Same for target in
	GET_TASKS when target is not readable.  In CLIENT_CREATE_TASK and
	CLIENT_MODIFY_TASK find the target with permission, in case it is owned
	by another user.

2015-03-10  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/omp.c (handle_modify_scanner): Don't check empty certificates and
	key values.

2015-03-10  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/omp.c (handle_modify_scanner): New function, check that provided
	certifications and private key values are valid.
	(omp_xml_handle_end_element): In CLIENT_MODIFY_SCANNER, use
	handle_modify_scanner() accordingly.

	* src/scanner.c, src/openvasmd.c, src/manage_sql.c: Update scanners
	related documentation.

2015-03-10  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/omp.c (send_find_error_to_client): Take omp parser as argument
	instead of client writer and client writer data.
	(handle_get_scanners, handle_create_scanner)
	(omp_xml_handle_end_element): Adjust calls to send_find_error_to_client.

2015-03-10  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/omp.c (check_scanner_cert, check_scanner_private): New functions.
	(handle_create_scanner): New function, check that provided certs and key
	are valid.
	(omp_xml_handle_end_element): Call handle_create_scanner, in
	CLIENT_CREATE_SCANNER case.

2015-03-10  Michael Wiegand <michael.wiegand@greenbone.net>

	Install xml_split by default since it has proved helpful for low
	memory environments.

	* CMakeLists.txt: Install tools/extra/xml_split into SCAP_RES_DIR.

	* INSTALL: Note that python is required for using xml_split.

	* tools/extra/README: Remove part about installing xml_split since it
	is now done automatically.

2015-03-10  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/omp.c (xml_handle_end_element): In CLIENT_GET_AGGREGATES case,
	escape the group column values.

2015-03-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (result_detection_reference): Clarify last SQL
	statement a little.

2015-03-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_override_iterator): Remove SQL that is now
	created by where_owned_for_get.

2015-03-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_acl.c (where_owned_for_get): Use "" when there are no
	current credentials.  Use correct value for owner check flag.

2015-03-09  Matthew Mundell <matthew.mundell@greenbone.net>

	Apply all overrides for Postgres too.

	* src/manage_migrators.c (migrate_145_to_146): Drop
	result_new_severities too, for Postgres dependencies.

	* src/manage_pg.c (manage_create_sql_functions): Create result_overrides
	with generated ownership clause that includes overrides owned by other
	users.

	* src/manage_sqlite3.c (create_tables): Remove note.

2015-03-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_result_iterator): Put close on the right line.

2015-03-09  Matthew Mundell <matthew.mundell@greenbone.net>

	Apply all overrides that a user may access when calculating severities.
	Hence increase database version to 146.  Add database migration from
	version 145 to 146.

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

	* src/manage_migrators.c (migrate_145_to_146): New function.
	(database_migrators): Add migrate_145_to_146.

	* src/manage_sqlite3.c (create_tables): Create result_overrides with
	generated ownership clause that includes overrides owned by other users.

	* src/manage_sql.c (task_severity, report_scan_result_count)
	(report_severity_data_prepare, report_severity_data_prepare_full): Get
	overrides with generated ownership clause that includes overrides owned
	by other users.

	* src/manage_acl.c (where_owned_for_get): New function.

	* src/manage_acl.h: Add header accordingly.

2015-03-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (buffer_result_overrides_xml): Include all overrides the
	user may access.

2015-03-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_report_host_add): Make the time values
	match their format specifier, otherwise the libc print functions may
	segfault on 32 bit.

2015-03-05  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/omp.c (SEND_GET_START, SEND_GET_COMMON, SEND_GET_END)
	(SEND_TO_CLIENT_OR_FAIL, SENDF_TO_CLIENT_OR_FAIL): Adjust macros to use
	omp_parser variable.
	(INIT_GET): Return, instead of break.
	(handle_get_scanners): New function, send scanner info for openvas type
	too.
	(omp_xml_handle_end_element): Use handle_get_scanners() in
	CLIENT_GET_SCANNERS case.

2015-03-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (buffer_result_notes_xml): Include all notes the user may
	access.

2015-03-04  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* tools/cert_bund_update.xsl (Advisory): Replace space in "Date"
	element text with "T" so conversions to UNIX time work correctly.

	* tools/cert_bund_update_pg.xsl (Advisory): Replace space in "Date"
	as above.

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

	* src/omp.c, src/manage_sql.c: Adjust includes.

2015-03-03  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/openvasmd.c (main): Improved --help output.

2015-03-02  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/manage_sql.c, src/manage.h (find_alert, find_schedule)
	(task_threat_level): Remove unused functions.

2015-03-02  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/report_formats/LaTeX/latex.xsl (results-overview): Add support
	for displaying host authentication results in report summary.

2015-03-02  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/report_formats/TXT/TXT.xsl (ref_cert_list): Do not expect CERT
	references to start with "DFN-CERT" now that other CERT references are
	supported as well.

2015-03-02  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/report_formats/NBE/NBE.xsl (ref_cert_list): Do not expect CERT
	references to start with "DFN-CERT" now that other CERT references are
	supported as well.

2015-03-02  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/report_formats/HTML/HTML.xsl (ref_cert_list): Do not expect CERT
	references to start with "DFN-CERT" now that other CERT references are
	supported as well.

2015-03-02  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/report_formats/CSV_Results/CSV_Results.xsl (result): Do not
	expect CERT references to start with "DFN-CERT" now that other CERT
	references are supported as well.

2015-03-02  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/report_formats/HTML/HTML.xsl (real-report): Add support for
	displaying host authentication results in report summary.

2015-02-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/Anonymous_XML/Anonymous_XML.xsl (host/ip): New
	template.  Convert HOST/IPs to fake values.

2015-02-26  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Limit results in report results counting and caching functions to
	a default minimum QoD of 70.

	* src/manage_pg.c (manage_create_sql_functions): Add QoD checks to
	report_severity_count.

	* src/manage_sqlite3.c (report_severity_count): Add QoD check.

	* src/manage_sql.c (report_cache_counts): Add min_qod parameter to
	report_counts_id calls.
	(report_add_result): Check QoD before counting result in cache.
	(where_qod): Return clause with default minimum QoD if min_qod is NULL
	or an empty string.
	(report_scan_result_count): Use cache if min_qod equals the default.
	(report_severity_data): Add QoD clause to query.
	(report_counts): Add min_qod parameter to report_counts_id call.
	(report_counts_id_filt): Use cache if min_qod equals the default.
	(report_counts_id): Add min_qod parameter.
	(report_severity, print_report_assets_xml, print_report_prognostic_xml)
	(print_report_xml, task_trend): Add min_qod parameter to
	report_counts_id calls.

	* src/manage.h (MIN_QOD_DEFAULT): New #define.
	(report_counts_id): Add parameter.

	* src/omp.c (omp_xml_handle_end_element): In case CLIENT_GET_TASKS
	handle min_qod filter keyword or use default min_qod when getting
	reports.

2015-02-26  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/openvasmd.c (main): Updated year to 2015.

2015-02-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/Anonymous_XML/Anonymous_XML.xsl (all-hostnames)
	(hostnames): Select using for-each, because the results may not be
	unique using a select attribute when there is whitespace in the host
	details XML.
	(openvas:hostname): Add node-set because $hostnames is now a result
	fragment due to the way it is selected.

2015-02-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_INFO reset the
	parser properly after find errors and improve the message of the NVT
	find error.

2015-02-25  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (where_levels_auto): Correct order in which the SQL
	fragments new_severity_sql and auto_type_sql are inserted into the
	false positive case.

2015-02-25  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Update OMP documentation of GET_NVTS.

	* src/schema_formats/XML/OMP.xml.in (get_nvts): Change "id" attribute
	in response to "oid".  Move "creation_time" and "modification_time"
	response elements to optional group.  Remove missing elements
	"permissions", "description and "risk_factor".  Add "alt" subelement to
	"preference" elements.  Add summary text to describe response elements.
	Update example.

	* doc/omp.html, doc/omp.rnc: Update from source.

2015-02-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Setup the filter before
	setting up the type specific functions, so that the filter is
	initialised for the NVT case.

2015-02-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/Anonymous_XML/Anonymous_XML.xsl (host/detail): Skip
	more elements.

2015-02-24  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Update OMP documentation of GET_REPORT and the report element.

	* src/schema_formats/XML/OMP.xml.in (report): Add choice "prognostic"
	to type attrib in both command and response.  Change description of
	"name" as it contains the creation time.  Move "sort", "filters",
	"severity_class" outside the optional group.  Make "hosts" non-optional
	and make it either attributes or a count element, adjust description.
	Add elements "closed_cves", "vulns", "os", "apps", "ssl_certs" and
	"errors".  Remove unused "show_closed_cves".  Add summary and
	subelements of target in task subelement.
	(get_reports): Add command attributes apply_overrides and
	result_hosts_only.  Change pattern in autofp to an alts type.  Update
	example response.

	* doc/omp.html, doc/omp.rnc: Update from source.

2015-02-24  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* ChangeLog: Add missing line for doc/omp.html, doc/omp.rnc in entry
	of previous change in OMP doc for notes / overrides (SVN r21701).

2015-02-24  Matthew Mundell <matthew.mundell@greenbone.net>

	Add GET_INFO support for the info_id attribute for NVTs.  When a single
	NVT is requested with GET_INFO then send the NVT preferences too.  These
	changes allow GSA to use GET_INFO for NVTs like it does for the other
	SecInfo types, instead of having to use GET_NVTS.

	* src/manage.c (get_nvti_xml): Add args for preferences flag and config.
	Append preferences if flag given.
	(manage_read_info): If name is NULL then find by ID.  Update
	get_nvti_xml call, in order to include preferences.

	* src/manage.h: Update header accordingly.

	* src/omp.c (send_nvt): Add args for preferences flag and config.  Send
	through to get_nvti_xml.
	(omp_xml_handle_end_element): In CLIENT_GET_INFO also skip the "all"
	case when an ID is given.  Let send_nvts send the preferences.

2015-02-24  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Move the definitions of notes and overrides in the OMP doc to
	new element types to make them more reusable and remove the types
	result_notes and result_overrides as notes and overrides on results
	are treated mostly the same as in get_notes / get_overrides.

	* src/schema_formats/XML/OMP.xml.in (result_notes, result_overrides):
	Remove.
	(note, override): New element types. Content from note/override
	elements in respective get_... commands.
	(result): Replace result_notes and result_overrides element types with
	an any number note/override elements using the new note/override types.
	(get_notes, get_overrides): Replace explicit definition of
	note/override elements with new element types.

	* doc/omp.html, doc/omp.rnc: Update from source.

2015-02-24  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/schema_formats/XML/OMP.xml.in (result): Add elements "name" and
	"scan_nvt_version". Remove element "risk_factor" that is not part of
	actual results. Add actual structure of "cert" subelements in "nvt" and
	of "result" subelements in "detection".
	(get_results): Use "result" type for the result response elements
	instead of duplicating the definition.

	* doc/omp.html, doc/omp.rnc: Update from source.

2015-02-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Add report format Anonymous XML.

	* CMakeLists.txt: Install predefined Anonymous XML.

	* src/manage_sql.c (check_db_report_formats): Ensure Anonymous XML
	exists.
	(report_format_predefined): Add Anonymous XML.

	* src/omp.c (omp_xml_handle_end_element): Add Anonymous XML to special
	cases.

	* src/report_formats/Anonymous_XML/,
	src/report_formats/Anonymous_XML/Anonymous_XML.xsl,
	src/report_formats/Anonymous_XML/generate: New directory and files.

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

	* src/manage.c (slave_setup): Set task preferences/options alterable,
	in_assets, source_iface and hosts_ordering. Initialize other fields
	of opts with NULL.

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

	Remove the requirement that a --rebuild/update must run successfully
	before the Manager will start.  If the database is not present simply
	do the Manager-side database init and start with an empty db.

	* src/manage_sql.c (check_db_versions): Warn and continue if the
	database needs a --rebuild, instead of returning.

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

	* src/manage_acl.c (where_owned_user): Add back owner filter selection
	accidentally removed in r21535.

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

	* tools/greenbone-scapdata-sync.in (VERSION): Increase to 20150218.
	(update_scap_db): Split the CPE dictionary like CVEs if the file is
	larger than SPLIT_PART_SIZE and splitting is enabled.

	* tools/openvas-scapdata-sync.in (update_sec_db): Split the CPE
	dictionary as above.

2015-02-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.h: Add missing args.

2015-02-17  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (report_scan_result_count): Use cached count
	if min_cvss_base and search_phrase are empty strings, not only if
	they are NULL. Also check min_qod before using cached count.

2015-02-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (accept_and_maybe_fork, handle_sigabrt)
	(handle_sigsegv, rebuild_nvt_cache_retry, serve_and_schedule, mail): Use
	setup_signal_handler instead of signal, for consistency.
	(setup_signal_handler): Move up in file.

2015-02-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (setup_signal_handler): New function.
	(update_or_rebuild_nvt_cache, main): Use setup_signal_handler to
	register handler.  Block all signal during SIGSEGV and SIGABRT handlers.

2015-02-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (handle_sigabrt, handle_sigsegv): Remove g_critical,
	do full cleanup, raise signal again so that exit value is correct.
	(serve_and_schedule): Do full cleanup in termination signal handling.

2015-02-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (serve_and_schedule): Move the signal flag checks out
	of the SCHEDULE_PERIOD check, because the signal flags must be checked
	when the select is interrupted by a signal (when it returns EINTR).

2015-02-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Reduce size of termination signal handlers.  Move logging out of SIGHUP
	handler.  Use volatile for global variable used in handler.

	* src/openvasmd.c (termination_signal): New variable.
	(sighup_update_nvt_cache): Add volatile, as the variable may change
	asynchronously.
	(handle_sigterm, handle_sighup): Remove.  No longer used.
	(handle_termination_signal): New function.
	(handle_sighup_update): Remove logging.
	(update_or_rebuild_nvt_cache, main): Use handle_termination_signal for
	termination signals.
	(serve_and_schedule): Check termination flag set by termination signals.
	Add logging removed from handle_sighup_update.

2015-02-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (parse_tags): Get CVSS base from cvss_base_vector instead
	of cvss_base.

2015-02-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (manage_schedule): Remove the check that ensures that a
	periodic task is started within a short interval at the scheduled start
	time.  This check was meant to prevent the task from starting long after
	the scheduled start time but I do not see a real problem with this
	happening, and the check could cause the run to be missed entirely when
	the machine is heavily loaded.

2015-02-13  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (report_add_result): Set end_time of report_counts
	entries with overrides to 0 instead of -1 if there are no active
	overrides that are active only for a limited time.

2015-02-13  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_pg.c (create_tables): Create new index
	report_counts_by_report_and_override.

	* src/manage_sqlite3.c (create_tables): Create new index
	report_counts_by_report_and_override.

2015-02-12  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (task_severity): Add plus sign to the subquery
	"SELECT id FROM reports ..." so SQLite can better optimize the final
	results query.

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

	* src/manage.c (update_end_times): Skip setting the times if the strings
	are empty or only contain space, otherwise the time parser logs a
	warning.

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

	* src/manage_sql.c (request_delete_task_uuid): Remove task last, because
	Postgres checks the references.

2015-02-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Also clear schedules when the scan ends, as this can be an earlier
	opportunity than the end of the duration.

	* src/manage.c (manage_schedule): Pass "all tasks" flag to duration
	functions.

	* src/manage_sql.c (clear_duration_schedules)
	(update_duration_schedule_periods): Add task arg.  Skip duration
	expiration check when task is given.

	* src/manage.c (process_otp_scanner_input): When the task exits clear
	the schedule if the task had a once off schedule or a limited periodic
	run, as well as a duration.

2015-02-11  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Add Solution type to report formats that include the Solution of
	results.

	* src/report_formats/CSV_Results/CSV_Results.xsl (result, /report): Add
	Solution type column.

	* src/report_formats/HTML/HTML.xsl (result [issue]): Add Solution type
	subsection to Solution section.

	* src/report_formats/LaTeX/latex.xsl (result-details-host-port-threat):
	Add Solution type subsection to Solution section.

	* src/report_formats/NBE/NBE.xsl (result): Add Solution type subsection
	to Solution section.

	* src/report_formats/TXT/TXT.xsl (result [issue]): Add Solution type
	subsection to Solution section.

	* src/report_formats/Verinice_ISM/Verinice_ISM.xsl
	(vulnerability_details): Add Solution type subsection to Solution
	section.

2015-02-11  Michael Wiegand <michael.wiegand@greenbone.net>

	Post-release version bump.

	* CMakeLists.txt: Updated version number.

2015-02-11  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 6.0+beta6 release.

	* CHANGES: Updated.

2015-02-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml.in (get_tasks, create_task)
	(modify_task): Add SCHEDULE_PERIODS.

	* doc/omp.html, doc/omp.rnc: Update from source.

	* doc/db_postgres.sql (tasks): Add schedule_periods.

	* doc/db.png: Update from source.

2015-02-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (create_task_data_t, create_task_data_reset)
	(client_state_t): Add schedule_periods entry.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add SCHEDULE_PERIODS to CREATE_TASK.

2015-02-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* CMakeLists.txt: Remove Jessie hack added in last commit.

2015-02-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Add the option to limit the number of times a task runs with a periodic
	schedule.  When the limit is reached the schedule is removed from the
	task.  Hence increase database version to 145.  Add database migration
	from version 144 to 145.

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

	* src/manage_migrators.c (migrate_144_to_145): New function.
	(database_migrators): Add migrate_144_to_145.

	* src/manage_pg.c, src/manage_sqlite3.c (create_tables): Add
	schedule_periods to tasks.

	* src/manage.c (manage_schedule): When starting a limited period task,
	decrement the scheduled periods if there are more runs and remove the
	period if this is the last run.  After stopping tasks update the
	scheduled period counts of tasks that have durations.

	* doc/db.png: Update for version change.

	* src/omp.c (modify_task_data_t, modify_task_data_reset)
	(client_state_t): Add schedule_periods entry.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add SCHEDULE_PERIODS to MODIFY_TASK and
	GET_TASKS.

	* src/manage_sql.c (set_task_schedule, set_task_schedule_uuid): Add
	periods arg.
	(set_task_schedule_periods, task_schedule_periods)
	(task_schedule_periods_uuid, set_task_schedule_next_time_uuid)
	(update_duration_schedule_periods): New functions.
	(clear_duration_schedules): Clear task schedule_periods too.

	* src/manage.h, src/manage_sql.h: Update headers accordingly.

2015-02-10  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage.c (slave_esxi_credential_uuid): New variable.
	(slave_setup): Add parameter target_esxi_credential. Copy ESXi
	credentials for the slave target and delete them once the scan has
	ended.
	(run_slave_task): Add parameter target_esxi_credential.
	(run_task): Pass ESXi credentials of target to run_slave_task.

2015-02-10  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage.c (slave_setup): Add options exclude_hosts, alive_test,
	reverse_lookup_only and reverse_lookup_unify when creating target.
	Rename fail_credential label to fail_smb_credential.

2015-02-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (qod_from_type): Neaten formatting.
	(where_qod): Neaten formatting.  Add length check on min_qod, otherwise
	Postgres complains about casting '' to INTEGER.

2015-02-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (slave_setup): Use _ext function to send credentials.

2015-02-09  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (filter_clause): Ensure various filter columns are
	sorted using their numeric values: cves, high, medium, low, log,
	false_positive, ips, total, tcp, udp.

2015-02-06  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Add columns qod and qod_type to NVTs and qod_type to Results.  Hence
	increase database version to 144.  Add database migration from version
	143 to 144.

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

	* src/manage_migrators.c (migrate_143_to_144): New function.
	(database_migrators): Add migrate_143_to_144.

	* doc/db_postgres.sql: Add column qod to table nvts and add column
	qod_type to tables nvts and results.

	* doc/db.png: Update for version change.

	* src/manage_pg.c (create_tables): Add column qod to table nvts and
	add column qod_type to tables nvts and results.

	* src/manage_sql.c (make_osp_result): Add empty qod_type to result.
	(qod_from_type): New function.
	(make_result): Try to get QoD and QoD type from the NVT tags and set
	them in the result. Map "qod_type" to a "qod" number using
	qod_from_type if there is no "qod" tag.
	(create_report): Copy qod_type from results.
	(RESULT_ITERATOR_FILTER_COLUMNS, RESULT_ITERATOR_COLUMNS): Add column
	"qod_type".
	(RESULT_ITERATOR_COLUMN_COUNT): Increase.
	(init_result_iterator): Add missing comma in query for result case.
	Add qod_type column.
	(result_iterator_qod_type): New function.
	(make_nvt_from_nvti): Try to get qod and qod_type from tags and add
	them to the table row, using the qod_from_type fallback if needed.
	(NVT_INFO_ITERATOR_FILTER_COLUMNS, NVT_ITERATOR_COLUMNS)
	(NVT_ITERATOR_COLUMNS_NVTS): Add columns "qod" and "qod_type".
	(nvt_iterator_qod, nvt_iterator_qod_type): New functions.
	(nvt_iterator_solution_type): Adjust/fix column index.

	* src/manage_sqlite3.c (create_tables): Add column qod to table nvts
	and add column qod_type to tables nvts and results.

	* src/manage.c (get_nvti_xml): Add "qod" element with subelements
	"value" and "type".

	* src/manage.h (qod_from_type): New function prototype.
	(create_report_result_t): Add qod_type field.
	(result_iterator_qod_type, nvt_iterator_qod, nvt_iterator_qod_type):
	New function prototypes.

	* src/omp.c (create_report_data_t): Add field result_qod_type.
	(create_report_data_reset): Free qod_type of results.
	(client_state_t): Add CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_QOD_TYPE
	and CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_QOD_VALUE.
	(omp_xml_handle_start_element): Add case
	CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_QOD to handle new TYPE and
	VALUE subelements of QOD in results.
	(buffer_results_xml): Move QoD percentage to a "value"
	subelement of "qod" and add "type" subelement for consistency with the
	"qod" element in NVTs.
	(omp_xml_handle_end_element): In case
	CLIENT_CREATE_REPORT_RR_RESULTS_RESULT copy result_qod_type to result.
	Add cases for CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_QOD_TYPE and
	CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_QOD_VALUE.
	(omp_xml_handle_text): Add case for
	CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_QOD_TYPE and change
	CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_QOD to
	CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_QOD_VALUE.

	* src/schema_formats/XML/OMP.xml.in (result): Add "qod" element to
	the "nvt" element. Add new value and type subelements to "qod" element
	and update summary.
	(get_notes): Add "qod" element to "result" in the response.
	(get_nvts): Add "qod" element to the "nvt" element in the response.
	(get_overrides, get_results): Add "qod" element to "result" in the
	response.

	* doc/omp.html, doc/omp.rnc: Update from source.

2015-02-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (slave_setup): Also specify the SSH port when creating the
	target.

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

	Remove once-off schedules from tasks after the tasks have been scheduled.

	* src/manage.c (manage_schedule): Remove schedules after START_TASK
	succeeds.  Remove expired duration schedules at the end.

	* src/manage_sql.c (set_task_schedule): Correct doc.
	(set_task_schedule_uuid, task_schedule_uuid, task_schedule_next_time)
	(clear_duration_schedules, schedule_period, schedule_duration): New
	functions.

	* src/manage_sql.h, src/manage.h: Add headers accordingly.

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

	* src/manage.c (manage_schedule): Use the correct case for parent and
	child, otherwise the parent aborts when it runs SQL because the
	fork_connection function closes the SQL connection for the child.

2015-02-05  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/lsc_user.c (create_ssh_key): New function.
	(ssh_privkey_create, ssh_pubkey_create): Remove functions.
	(lsc_user_keys_create): Remove useless public_key argument, adjust
	function to use create_ssh_key() accordingly to create a private key.

	* src/lsc_user.h: Adjust function header.

	* src/manage_sql.c (create_lsc_credential): Adjust
	lsc_user_keys_create() function call.
	(lsc_credential_iterator_rpm, lsc_credential_iterator_deb): Check
	openvas_ssh_public_from_private() return value.

2015-02-04  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Allow filtering results of GET_REPORTS using new filter keyword
	or command attribute "min_qod".

	* src/manage_sql.c (manage_report_filter_controls): Add new output
	parameter min_qod.
	(escalate_2): Add new parameter min_qod.
	(escalate_1): Add new min_qod parameter of escalate_2.
	(task_upload_progress): Add new parameter of report_scan_result_count.
	(where_qod): New function.
	(RESULT_ITERATOR_COLUMNS): Simplify qod column by getting it directly
	without extra checks.
	(init_result_iterator): Add new parameter min_qod and filter results
	according to it. Simplify qod SQL in report if case. Add qod column
	to result case.
	(report_scan_result_count, report_counts_match, report_severity_data)
	(report_counts_id_filt): Add new parameter min_qod.
	(report_counts_id): Add new parameter for report_counts_id_filt.
	(report_filter_term, print_report_port_xml): Add new parameter min_qod.
	(print_report_xml): Add parameter given_min_qod. Filter results by
	minimum QoD if min_qod filter keyword or parameter is given. Print
	min_qod to the filters element.
	(manage_report, manage_send_report): Add new parameter min_qod.

	* src/manage.h (report_scan_result_count, init_result_iterator)
	(manage_report, manage_send_report, manage_report_filter_controls): Add
	parameter.

	* src/omp.c (get_reports_data_t, get_reports_data_reset): Add new field
	min_qod.
	(omp_xml_handle_start_element): In GET_REPORTS case, get min_qod
	attribute.
	(buffer_notes_xml, buffer_overrides_xml): Add NULL value for min_qod
	parameter to init_result_iterator call.
	(omp_xml_handle_end_element): In GET_REPORTS case, add min_qod
	parameter to function calls.

	* src/schema_formats/XML/OMP.xml.in (report): Add min_qod element to
	filters subelement.
	(get_reports): Add min_qod command attribute.

	* doc/omp.html, doc/omp.rnc: Update from source.

2015-02-04  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Results with no QoD information are assigned a default value of 75,
	which is also applied to existing results.  Hence increase database
	version to 143.  Add database migration from version 142 to 143.
	Add support for more values of the qod_type NVT tag.

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

	* src/manage_migrators.c (migrate_142_to_143): New function.
	(database_migrators): Add migrate_142_to_143.

	* doc/db.png: Update for version change.

	* src/manage_sql.c (check_db_tasks, make_osp_result): Set qod of the
	result to the new default value.
	(make_result): Set qod of the result to the new default if the qod_type
	NVT tag is missing or its value cannot be interpreted. Recognize more
	values of the qod_type tag: exploit, remote_vul, remote_app, package,
	registry, remote_active, remote_banner, executable_version,
	remote_analysis, remote_probe and executable_version_unreliable.
	(create_report): Set qod of results if available or using new default.

	* src/manage.h (QOD_DEFAULT): New #define.
	(create_report_result_t): Add qod field.

	* src/omp.c (create_report_data_t): Add result_qod field.
	(create_report_data_reset): Free qod of results.
	(client_state_t): Add CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_QOD.
	(omp_xml_handle_start_element): Add case for QOD in
	CLIENT_CREATE_REPORT_RR_RESULTS_RESULT.
	(omp_xml_handle_end_element): Copy qod field to result in the case of
	CLIENT_CREATE_REPORT_RR_RESULTS_RESULT. Add case for
	CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_QOD.
	(omp_xml_handle_text): Get text of QOD element in case
	CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_QOD.

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

	* src/manage.c (slave_ssh_credential_uuid, slave_smb_credential_uuid)
	(slave_target_uuid, slave_config_uuid, slave_task_uuid)
	(slave_report_uuid, slave_session, slave_socket): New variables.
	(cleanup_slave): New function.
	(slave_setup): Use new variables.  Register cleanup_slave as atexit
	function, so that the slave task is stopped if Manager is terminated.

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

	* src/manage_sql.c (trim_partial_report): Remove report_hosts end_time
	'' checks, because end_time is now an integer.  For Postgres.

2015-02-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (copy_report_format): Build the source dir according
	to the report format owner, because the report format may not be owned
	by the current user.

2015-02-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (copy_resource_lock): Find with permission, to enable
	cloning of other users' resources.

2015-02-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_report_internal): Leave the task alterable
	when deleting the last report of an alterable task.

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

	* src/manage_sql.c (where_search_phrase): Warn about relation to
	report_counts_match.
	(report_counts_match): Use the same conditions that are used in the
	result iterator.  This was causing errors in the filtered counts in
	reports when certain filter terms were given.

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

	Fix or clarify documentation of various OMP commands, mostly
	GET_... ones.

	* src/schema_formats/XML/OMP.xml.in (create_target): Add element
	"exclude_hosts".
	(create_task): Add element "hosts_ordering".
	(get_configs): Remove unused attribute "export". Add summary of
	attributes "families" and "preferences". Add response elements "type"
	and "nvt_selectors". Add subelements "default" and "alt" to
	"preference" elements.
	(get_alerts): Add elements "filters", "sort", "alerts" and
	"alert_count" to response.
	(get_info): Make type-specific response elements like "cert_bund_adv",
	"cpe", etc. an "or" selection. Remove "deprecated_by" element of CPEs
	that is not actually in response. Mark cve elements in CPEs as "any"
	instead of optional. Add CVSS-related elements of CVEs to the pattern.
	Mark nvt element in CVEs as "any" instead of optional. Fix summary of
	"warning" element.
	(get_lsc_credentials): Make elements "public_key" and "package" an "or"
	selection.
	(get_notes): Add "id" attribute to note in response. Move element
	"permission" and make "owner", "creation_time", "modification_time",
	"writable", "in_use", "active" non-optional. Add summary of "excerpt"
	attribute in "text" element.
	(get_overrides): Add "id" attribute to override in response and add
	elements "permissions", "owner". Move element "active" outside optional
	group. Add summary of "excerpt" attribute in "text" element. Move nvt
	element.
	(get_permissions): Remove unused attribute "resource_id".
	(get_port_lists): Ungroup elements "port_ranges" and "targets".
	(get_preferences): Mark subelements "nvt" and "type" of "preference"
	as non-optional and add subelement "alt".
	(get_report_formats): Mark "alerts" as optional. Change group of "file"
	and "signature" as optional instead of "or". Ungroup elements "trust"
	and "active".
	(get_results): Add attribute "autofp".
	(get_schedules): Do not mark "tasks" as group.
	(get_system_reports): Make type of "format" subelement of "report"
	a selection between "png" and "txt".
	(get_tags): Move "owner" to the optional group and add "permissions"
	element.
	(get_targets): Add exlude_hosts.
	(get_tasks): Remove unused attribute "apply_overrides". Add "type"
	subelement to pattern of "scanner" response element. Add response
	element "hosts_ordering". Add subelement "scan_end" to "report" and
	the three "..._report" response subelements as well as "false_positive"
	to their "result_count".
	(get_users): Remove unused attribute "trash". Add response element
	"ifaces".
	(modify_target): Add hosts_ordering and exclude_hosts elements.

	* doc/omp.html, doc/omp.rnc: Update from source.

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

	* src/sql_pg.c (sql_column_int, sql_column_int64): Add condition so that
	booleans are always 1 or 0.

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

	* src/manage.c (make_osp_result): Don't set the result's QOD to 0.

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

	When scheduling only consider the schedule if the task owner has
	permission to access the schedule.

	* src/manage_acl.c (where_owned_user): New function.  Was where_owned.
	Add user args.
	(where_owned): Call through to where_owned_user.

	* src/manage_acl.h: Add header accordingly.

	* src/manage_sql.c (init_task_schedule_iterator): Add owned clause, so
	that schedules are only included if the user has permission to access
	them.

2015-01-30  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (filter_clause): Add cases for "qod" to sort by the
	numeric value of this column.
	(RESULT_ITERATOR_FILTER_COLUMNS, RESULT_ITERATOR_COLUMNS): Add "qod".
	(RESULT_ITERATOR_COLUMN_COUNT): Increase.
	(init_result_iterator): Add cases for "qod" to sort it by
	numeric value.
	(result_iterator_qod): New function.

	* src/manage.h (result_iterator_qod): New function prototype.

	* src/omp.c (buffer_results_xml): Add new qod element to results.

	* src/schema_formats/XML/OMP.xml.in (result): Add qod element.

	* doc/omp.html, doc/omp.rnc: Update from source.

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

	Enable mixing of the current users schedules and tasks, with other
	people's schedules and tasks, when permissions allow it.

	* src/manage_sql.c (trash_schedule_readable): New function.
	(init_task_schedule_iterator): Add TODO.
	(init_schedule_task_iterator): Add column indicating whether the
	schedule is readable.  Remove owner constraint on task.
	(schedule_task_iterator_readable): New function.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): Send empty PERMISSIONS in
	TASK in GET_SCHEDULES when task is not readable.  Same for schedule in
	GET_TASKS when schedule is not readable.  In CLIENT_CREATE_TASK and
	CLIENT_MODIFY_TASK find the schedule with permission, in case it is
	owned by another user.

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

	Enable mixing of the current users alerts and tasks, with other people's
	alerts and tasks, when permissions allow it.

	* src/manage_sql.c (init_task_alert_iterator): Get alerts owned by other
	users too.
	(init_alert_task_iterator): Add column indicating whether the alert is
	readable.  Remove owner constraint on task.
	(alert_task_iterator_readable): New function.
	(set_task_alerts, manage_send_report): Find with permissions, to
	include alerts owned by other users.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): Send empty PERMISSIONS in
	TASK in GET_ALERTS when task is not readable.  Same for alert in
	GET_TASKS when alert is not readable.  In CLIENT_CREATE_TASK find the
	alert with permission, in case it is owned by another user.

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

	* src/manage.c (launch_osp_task): Don't take options argument. Get the
	task options in function.
	(fork_osp_scan_handler): Move function down. Adjust for
	launch_osp_task() changes.
	(run_osp_task): Set task as requested. Adjust fork_osp_scan_handler()
	call.
	(run_task): adjust run_osp_task() call.

	* src/omp.c (omp_xml_handle_end_element): In START_TASK, fix use of
	uninitialized variable in OSP task case.

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

	* src/manage.c (handle_osp_scan, launch_osp_task): New functions.
	(run_osp_task): Adjust function to call launch_osp_task()  accordingly.
	(fork_osp_scan_handler): Adjust function to call handle_osp_scan().

2015-01-27  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* README: Add option --optimize to usage message.

	* INSTALL: Add new section "Optimizing the database".

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

	* src/manage.c (get_osp_task_options): New function.
	(run_osp_task): Refactor function to use get_osp_task_options().

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

	* src/manage_sql.c (osp_scanner_connect): New function.
	(get_scanner_params): Refactor code, call new function.

	* src/manage.h: Add function prototype.

	* src/manage.c (run_osp_task): Refactor code, call new function.

2015-01-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (resource_with_name_exists): Finish doc.  Neaten SQL.
	(resource_with_name_exists_global): New function.
	(create_user): Extend the check for existing users to users owned by
	anybody, now that users have owners.  This prevents two users from
	having the same name.

2015-01-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (escalate_1): Change Auto FP default to 0.

2015-01-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_asset_iterator): Remove unused new_severity
	columns.

2015-01-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): Remove stray SVN markers.

2015-01-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (modify_setting): Limit subqueries to one row, in
	case there are multiple entries for a global setting.

2015-01-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Allow --modify-scanner options to be omitted, using their existing
	values when they are.

	* src/manage_sql.c (manage_modify_scanner): Allow the path args to be
	NULL.
	(modify_scanner): If an argument is NULL then use the existing value.

2015-01-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Add --modify-scanner.

	* src/manage_sql.c (main): Add option.

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

	* src/manage.h: Add header accordingly.

2015-01-19  Michael Wiegand <michael.wiegand@greenbone.net>

	Simplify handling of library flags in CMakeLists.txt files, thereby
	removing the need for clumsy workarounds.

	* CMakeLists.txt: Simplify detection of PostgreSQL library and the
	associated flags. Use information retrieved by find_package directly
	instead of processing and casting to other variables. Change variable
	name for server include directory location for consistency. Make
	missing required libraries cause a SEND_ERROR instead of a FATAL_ERROR
	for consistency. Consequently, only gather flags if library is
	present. Remove redundant queries of library flags which were
	already retrieved by CMake. Remove unnecessary aggregation of flags.
	Remove check for libpcap as openvas-manager as it is not required.

	* src/CMakeLists.txt: Set include directories with include_directories
	instead of target properties. Remove quotes in target_link_libraries
	so that CMake lists get expanded correctly.

2015-01-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (nvt_selector_family_count): Use a single statement
	for the static case, so that the DISTINCT can apply across both
	selections.  This catches the case where the config contains NVT
	selectors that are made redundant by family selections, like in the
	Greenbone Web Application XML.

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

	* src/manage.c (slave_setup): Send Timeout prefs, as in GET_CONFIGS
	response.

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

	Handle Timeout NVT preferences when importing configs.

	* src/omp.c (config_insert_preferences): Add Timeout case.

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

	Include Timeout NVT preferences in GET_CONFIGS responses, but only if
	the timeout has been explicitly set by the user.

	* src/omp.c (omp_xml_handle_end_element): Send Timeout preferences in
	CLIENT_GET_CONFIGS.

	* src/manage_sql.c (init_config_timeout_iterator)
	(config_timeout_iterator_oid, config_timeout_iterator_nvt_name)
	(config_timeout_iterator_value): New functions.

	* src/manage.h: Add headers accordingly.

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

	* src/manage_sql.c (osp_get_details_from_iterator): Also get the scanner
	details.

	* src/manage.h: Adjust function prototype.

	* src/omp.c (omp_xml_handle_end_element): In GET_SCANNERS, send the osp
	scanner's parameters too.

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

	* src/manage_sql.c (create_report): Adjust function call parameter.
	(get_scanner_params, osp_get_details_from_iterator): Call
	osp_get_scanner_details().

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

	* src/manage.c (parse_osp_report): Adjust to add single hosts values
	from the report.

	* src/manage_sql.c (check_db_tasks, create_report)
	(set_scan_host_end_time, set_scan_host_end_time_otp)
	(set_scan_host_start_time, set_scan_host_start_time_otp): Refactor to
	call manage_report_host_add().
	(manage_report_host_add): Add the new report host only if it doesn't
	exist.

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

	* src/omp.c (send_get_end): Include report in apply_override check, so
	that the report list also gets a default apply_overrides term when one
	is not given.

2015-01-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_create_sql_functions): In resource_name rename
	variable "name" to "execute_name" otherwise it conflicts with column
	names, and add a special case for tasks because the task trash is in the
	regular table.

2015-01-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (setting_severity): Default to "nist" if the class is
	NULL, so that SQL functions in init_user_task_iterator work when called
	before authentication, like during --delete-user.

2015-01-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (find_resource_by_name_with_permission): Remove extra
	old style args from sql_string call.  This was affecting --delete-user
	and --modify-user.

2015-01-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_create_sql_functions): Add the super case to
	user_owns, using new SQL function user_has_super_on_resource.

2015-01-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_create_sql_functions): Use uuid instead of id
	of current_credentials, because id is the ID of the row, not the user.

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

	* src/manage.h: Add new function prototype.

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

	* src/omp.c (omp_xml_handle_end_element): Send the osp scanner
	description when appropriate, in GET_SCANNERS case.

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

	* src/manage_pg.c (create_tables): Add missing default_value column.

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

	* src/manage_pg.c (manage_create_sql_functions): Flesh out "user_owns".

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

	* src/manage.h: Add new function prototype.

	* src/manage_sql.c (osp_get_version_from_iterator): New function.
	(verify_scanner): Use new function.

	* src/omp.c (omp_xml_handle_end_element): Refactor code to use new
	function.

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

	* src/manage_sql.c (find_report_format, ovaldef_description, find_user):
	Remove unused functions.

	* src/manage.h: Delete removed functions prototypes.

2015-01-19  Michael Wiegand <michael.wiegand@greenbone.net>

	* CMakeLists.txt: Ensure that the generated OMP.xml schema format is
	ignored when collecting files for the source package.

2015-01-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_acl.c (manage_create_sql_functions): Add basic "user_owns".
	(create_tables): Remove contraints from esxi_lsc_credential columns,
	because they can be 0, like the other credentials columns can.

2015-01-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_acl.c (where_owned): Use "inside" instead of "inner" as
	alias, becuase "inner" is a keyword.

2015-01-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* tools/greenbone-scapdata-sync.in, tools/openvas-scapdata-sync.in
	(db_migrate_15): Correct index names and column.

	* tools/scap_db_init_pg.sql: Increment version to match SQLite.  Correct
	column.

2015-01-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (get_nvti_xml): Correct typo.

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

	* src/manage.h: Add function prototype.

	* src/omp.c (omp_xml_handle_end_element): In GET_SCANNERS case, send
	scanner version info when scanner type is OSP.

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

	* src/manage_sql.c (verify_scanner): Adjust function call.

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

	* src/manage.c (parse_osp_report): Parse the result's test_id and handle
	values accordingly.

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

	When the report format for an alert is not found in TEST_ALERT and
	GET_REPORTS, respond with a dedicated error message, instead of just
	with Internal Error.

	* src/manage_sql.c (escalate_2): Add new return for when report format
	is not found.
	(escalate_1, manage_alert): Doc new return.
	(manage_send_report): Separate alert errors.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_REPORTS and
	CLIENT_TEST_ALERT handle new alert return values.

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

	* src/manage_sql.c (copy_role): Revert final clause in permissions
	INSERT to use "resource".  r21041 changed the clause to use "owner", but
	the clause is about limiting the statement to command permissions, not
	about limiting the statement to global permissions.

2015-01-13  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Fix or clarify documentation of various OMP commands.

	* src/schema_formats/XML/OMP.xml.in (authenticate): Add "Super Admin"
	as option for role.
	(create_group, create_role): Mark "users" element as optional. Add
	response.
	(create_slave): Mark "password" element as optional.
	(create_target): Mark elements "ssh_lsc_credential" and "port",
	"smb_lsc_credential", "esxi_lsc_credential", "alive_tests",
	"reverse_lookup_only" and "reverse_lookup_unify" as optional.
	(create_user): Add optional "ifaces" element. Add summary for "allow"
	attribute of "hosts" element.
	(delete_port_range, delete_user): Remove attribute "ultimate" as it is
	not used for any actual trashcan functionality.
	(help): Add attribute "type" to command. Add attributes "format",
	"extension" and "content_type" to "schema" element in response.
	(modify_group, modify_role): Add response.
	(modify_schedule): Note that missing subelements of "first_time" will
	default to system time and that a missing "timezone" implies using
	the user's timezone.
	(modify_user): Mark "new_name" as optional. Add optional "ifaces"
	element. Add summary for "allow" attribute of "hosts" element.
	(resume_task, start_task): Add report_id element and update example.

	* doc/omp.html, doc/omp.rnc: Update from source.

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

	* src/manage.c (parse_osp_report): Adjust to handle host detail results.

	* src/manage.h: Add insert_report_host_detail prototype.

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

	* src/manage_sql.c (escalate_2): Find report format with permissions, as
	it may be owned by someone else.

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

	* src/manage_sql.c (insert_report_host_detail): New function.
	(create_report, manage_report_host_details): Refactor code to use
	insert_report_host_detail().

2015-01-12  Michael Wiegand <michael.wiegand@greenbone.net>

	Post-release version bump.

	* CMakeLists.txt: Updated version number.

2015-01-12  Michael Wiegand <michael.wiegand@greenbone.net>

	* CHANGES: Fix typo.

2015-01-12  Benot Allard  <benoit.allard@greenbone.net>

	* CHANGES: Prepare release of openvas-manager 6.0+beta5.

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

	* src/sql.c (openvas_sleep): Add conversion to seconds.

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

	Use unsigned ints for retry variables, to avoid passing negatives to the
	sleep function.

	* src/sql.c (openvas_usleep, openvas_sleep): Switch arg to unsigned.

	* src/sql.h: Update headers accordingly.

	* src/sql_sqlite3.c (sql_prepare_internal, sql_exec_internal)
	(sql_bind_blob, sql_bind_int64, sql_bind_double, sql_bind_text)
	(sql_reset): Use unsigned for retries.

2015-01-09  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (manage_optimize): Rename cleanup-open-ports to
	remove-open-port-results.

	* src/openvasmd.c (main): Update optimize choices in option_entries.

2015-01-09  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (manage_optimize): Log success text in addition to
	writing it to stdout.

	* src/openvasmd.c (main): Change logging of "Optimizing ..." message
	from info to message level and also output it in non-verbose mode.

2015-01-09  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (manage_optimize): Add cleanup-port-names to convert
	ports from the old name format and to remove IANA port names from
	imported reports.

	* src/manage_sqlite3.c (sql_strpos): New function.
	(manage_create_sql_functions): Add new SQL function strpos which
	behaves the same as the function in PostgreSQL with the same name.

	* src/openvasmd.c (option_entries): Update list of optimize choices.

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

	* src/manage_sql.c (manage_restore): Fix sql statements.

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

	Sleep via wrapper functions that handle interrupts.

	* src/sql.c (openvas_usleep, openvas_sleep): New functions.  Sleep with
	nanosleep.

	* src/sql.h: Add headers accordingly.

	* src/manage.c (slave_sleep_connect, slave_setup, run_slave_task)
	(fork_osp_scan_handler): Use openvas_sleep instead of sleep.

	* src/openvasmd.c (fork_connection_for_schedular, rebuild_nvt_cache): Use
	openvas_sleep.

	* src/scanner.c (openvas_scanner_is_loading): Use openvas_usleep.

	* src/sql_sqlite.c (sql_prepare_internal, sql_exec_internal)
	(sql_bind_blob, sql_bind_int64, sql_bind_double, sql_bind_text)
	(sql_reset): Use openvas_usleep.

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

	* src/sql_sqlite3.c (sql_prepare_internal, sql_bind_blob, sql_bind_int64)
	(sql_bind_double, sql_bind_text, sql_reset): Sleep before retry, as in
	sql_exec_internal.

2015-01-08  Michael Wiegand <michael.wiegand@greenbone.net>

	* doc/db.png: Set SVN mime-type property correctly.

2015-01-08  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (manage_optimize): Rename cleanup_config_prefs and
	cleanup_open_ports to cleanup-config-prefs and cleanup-open-ports.

	* src/openvasmd.c (option_entries): Update list of optimize choices.

2015-01-08  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (manage_optimize): Add cleanup of duplicate config
	preferences (cleanup_config_prefs) and removal of superfluous open port
	results (cleanup_open_ports).

	* src/openvasmd.c (option_entries): Update list of optimize choices.

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

	* src/manage_sql.c (make_osp_result): Quote the result's name before
	insertion.

2015-01-08  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/sql.c (sqlv, sql_x_internal): Use a copy of the args va_list for
	the sql_prepare_internal call so the args can be used again in case of
	a retry. Add comment about va_list not being reusable.

2015-01-06  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/report_formats/HTML/HTML.xsl (note, override): Hide inactive
	notes / overrides. Use end_time instead of modification_time in
	"Active until:" part.

	* src/report_formats/LaTeX/latex.xsl (notes, overrides): Hide inactive
	notes / overrides.

	* src/report_formats/TXT/TXT.xsl (note, override): Hide inactive
	notes / overrides.

2015-01-06  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In case CLIENT_GET_REPORTS
	add short task and report format info to outer report element.

	* src/manage_sql.c (escalate_2): Use task and report format name when
	creating file name for email attachments.

	* src/schema_formats/XML/OMP.xml.in (report): Add new elements task
	and report_format.

	* doc/omp.html, doc/omp.rnc: Update from source.

2015-01-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (valid_omp_command): Remove special case now that
	"resume_task" contains two words like the other commands.

2015-01-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (manage_run_wizard): Correct indent.

2015-01-06  Matthew Mundell <matthew.mundell@greenbone.net>

	OMP RESUME_OR_START_TASK was removed.  Hence increase database version
	to 136.  Add database migration from version 135 to 136.

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

	* src/manage_migrators.c (migrate_135_to_136): New function.
	(database_migrators): Add migrate_135_to_136.

	* doc/db.png: Update for version change.

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

	* src/manage_sql.c (init_asset_iterator): Fix sql statements by using
	WHERE instead correctly.

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

	* src/manage.c (fork_osp_scan_handler): Handle and set received progress
	value accordingly.

	* src/manage_sql.c (report_progress): Adjust to handle OSP scan report
	case.

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

	* src/manage.c (parse_osp_report): Use host attribute from results
	instead of the target string when inserting results.

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

	* src/manage_sql.c (modify_task_check_config_target): Remove function.

	* src/manage.h: Remove prototype.

	* src/omp.c (omp_xml_handle_end_element): Don't limit OSP tasks to
	single-host targets when creating or modifying them.

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

	* src/manage_sql.c (init_report_errors_iterator): Use UNION ALL for
	UNION as it doesn't remove dpulicates and provides better performance.

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

	* src/manage_sql.c (modify_user): Prevent users from modifying their own
	names.

2014-12-19  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (NOTE_ITERATOR_FILTER_COLUMNS): Add column "active".
	(NOTE_ITERATOR_COLUMNS, NOTE_ITERATOR_TRASH_COLUMNS): Add filter column
	names id, uuid, text, hosts, port, results, active and severity.
	(OVERRIDE_ITERATOR_COLUMNS, OVERRIDE_ITERATOR_TRASH_COLUMNS): Add
	filter column names id and uuid.

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

	* src/manage_sql.c (modify_user): Exclude user being modified from name
	check.

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

	Add NEW_NAME to OMP MODIFY_USER, to allow changing of user names.

	* src/manage_sql.c (modify_user): Add new_name argument.  Change name if
	given.

	* src/manage.h: Update header accordingly.

	* src/omp.c (modify_user_data_t, modify_user_data_reset)
	(client_state_t): Add new field.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add NEW_NAME to MODIFY_USER.

	* src/schema_formats/XML/OMP.xml.in (modify_user): Add id and NEW_NAME.

	* doc/omp.html, doc/omp.rnc: Update from source.

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

	* src/manage_sql.c (filtered_host_count): Use user_owns for ownership,
	so that Super checks are done.

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

	Account for Super permissions in asset reports.

	* src/manage_acl.c (SUPER_CLAUSE): Add format arg for value SQL.
	(SUPER_CLAUSE_ARGS): Add missing doc.
	(user_has_super_on): Add SUPER_CLAUSE format.
	(user_has_super_on_resource): New function.
	(user_owns_name): New function.  Was user_owns.
	(user_owns): Convert to a version of user_owns_uuid that takes the
	resource instead of the UUID.

	* src/manage_acl.h: Update headers accordingly.

	* src/manage_sql.c (init_asset_iterator, host_nthlast_report_host): Use
	user_owns for ownership, so that Super checks are done.
	(lookup_report_format): Update for name change.

	* src/manage_sqlite3.c (sql_user_owns): New function.
	(manage_create_sql_functions): Add user_owns.

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

	* src/manage_acl.c (where_owned): Correct trash condition.

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

	* src/manage_acl.h (USER_MAY): Add missing subject_location test.

	* src/manage_acl.c (where_owned): Add subject_location tests for the
	permission part of the query too.

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

	* src/manage_sql.c (delete_user): Make users/groups/roles global if they
	are owned by the user being deleted.  Also make permissions global if
	they are related to these users/groups/roles.

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

	* src/manage_acl.c (user_owns_uuid, user_owns_trash_uuid)
	(user_has_access_uuid, where_owned): Quote args for SQL.

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

	* src/manage_acl.c (user_has_super_on): Quote value for SQL.

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

	* src/manage_acl.c (user_has_super_on): New function.
	(user_owns, user_owns_uuid, user_owns_trash_uuid): Call
	user_has_super_on instead of using macros.

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

	* src/manage_sql.c (create_permission): Enable creation of permissions
	on users, roles and groups.

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

	* src/manage_acl.c (where_owned): Skip permissions that apply to user
	when getting trash permissions.

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

	* src/manage_acl.c (role_can_super_everyone, user_can_super_everyone)
	(user_can_everything, user_has_super, user_is_user)
	(user_has_access_uuid, where_owned): Add missing subject_location tests.
	Without these tests, permissions in the trashcan can randomly affect the
	rights that are assiged to users.

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

	* src/manage_sql.c (omp_command_takes_resource): Exclude DESCRIBE
	commands too.
	(create_permission): If a resource ID is given but the resource type
	is NULL then return with "failed to find resource" instead of making a
	command level permission.

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

	* src/manage_sql.c (modify_permission): Remove call that cleared owner.
	Permissions have owners now.

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

	* src/manage_acl.c (user_can_super_everyone, user_can_everything)
	(user_has_super): Quote SQL args.

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

	* src/manage_sql.c (copy_user): Use fuller Super Admin check.

	* src/omp.c (copy_user): Use fuller Super Admin check.

	* src/manage.h: Add header accordingly.

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

	* src/manage_sql.c (copy_role): Refuse to copy roles that have Super
	Admin capability.

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

	* src/manage_sql.c (copy_permission): Refuse to copy the permission that
	gives Super Admin capability.
	(permission_name): New function.

	* src/manage.h: Add header accordingly.

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

	Add default_value column to config_preferences table, hence increase
	database version to 141.

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

	* src/manage_migrators.c (migrate_140_to_141): New.
	(database_migrators): Add migrate_140_to_141.

	* src/manage.h: Add function prototype.

	* src/manage_sql.c (create_config_from_scanner): In preference of type
	selection, insert the first value of the list as the current value for
	the preference.
	(copy_config, delete_config, init_preference_iterator, manage_restore):
	Adjust to handle new default_value column properly.
	(preference_iterator_default): New function

	* src/manage_sqlite3.c (create_tables): Add default_value column to
	config_preferences and config_preferences_trash tables.

	* src/omp.c (omp_xml_handle_end_element): Remove work-around for osp
	config preferences and get the default value correctly.

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

	* src/manage_sql.c (add_role_permission): Correct doc.

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

	Prevent assignment of roles that have Super Admin capability.

	* src/manage.h: Remove header now in manage_acl.h.

	* src/manage_acl.c (role_can_super_everyone): New function.

	* src/manage_acl.h: Add headers accordingly.

	* src/manage_sql.c (create_user): Check role for effective Super Admin
	too.
	(modify_user): Refuse to give user roles that have Super Admin.

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

	Introduce ownership of permissions.

	* src/manage_acl.c (user_has_access_uuid): Remove permission super
	check, as this is covered by the user_owns_uuid call at the top.

	* src/manage_sql.c (create_permission): Always set the owner to the
	current user.
	(copy_permission): Remove call that cleared owner.
	(copy_role): Set owner of permissions to current user.

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

	* src/manage_sql.c (modify_user): Use "user_can" function to include the
	case of a Super Admin created via permission instead of role.

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

	* src/manage_acl.c (user_owns, user_owns_trash_uuid): Clarify doc.
	(user_has_access_uuid): Note where super check is done.

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

	* src/manage_acl.c (SUPER_CLAUSE): Add trash table specifier.
	(SUPER_CLAUSE_ARGS): Add trash args.
	(user_owns, user_owns_uuid): Pass trash arg.
	(user_owns_trash_uuid): Rename "resource" arg to "type".  Add super
	check.  This enables users with Super to delete the resources of other
	users from the trashcan.

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

	* src/manage_acl.c (user_owns): Check for SecInfo types first, because
	the check is valid for users with Super too.
	(user_owns_result): Remove.
	(user_owns_uuid): Check for SecInfo types first, because the check is
	valid for users with Super too.  Inline user_owns_result because this is
	the only place it is called.

	* src/manage_acl.h: Remove header accordingly.

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

	* src/manage_acl.c (SUPER_CLAUSE): New define.
	(SUPER_CLAUSE_ARGS): New macro.
	(user_owns): Rename "resource" arg to "type".  Add Super check.  Add
	check for SecInfo types.
	(user_owns_uuid): Use define for super clause.

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

	* src/omp.c (omp_xml_handle_end_element): Correct command name in find
	slave permissions.

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

	* src/manage_acl.c (user_owns, user_owns_trash_uuid): New functions.
	From manage_sql.c.

	* src/manage_acl.h: Add header accordingly.

	* src/manage_sql.c (user_owns, user_owns_trash_uuid): Remove.  Now in
	manage_acl.c.

2014-12-15  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Remove support for the RESUME_OR_START_TASK OMP command.

	* src/omp.c (resume_or_start_task_data_t,
	resume_or_start_task_data_reset, resume_or_start_task_data): Removed.
	(command_data_t): Remove resume_or_start_task.
	(omp_xml_handle_start_element): Drop handling of RESUME_OR_START_TASK
	and CLIENT_RESUME_OR_START_TASK.
	(client_state_t): Removed CLIENT_RESUME_OR_START_TASK.

	* src/manage.c (resume_or_start_task): Removed.
	(manage_schedule): Instead of calling omp_resume_or_start_task,
	first try omp_start_task_report and if this fails try
	omp_resume_task_report.

	* src/manage.h: Remove proto accordingly.

	* src/manage_sql.c: Update documentation.
	(omp_command_type): Don't consider the command "resume_or_start_task"
	any more.
	(omp_commands): Remove RESUME_OR_START_TASK.

	* src/schema_formats/XML/OMP.xml.in: Remove RESUME_OR_START_TASK
	and document this as a protocol change.

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

	Introduce ownership of users, roles and groups.

	* src/manage_acl.c (user_can_super_everyone, user_is_owner): New
	functions.

	* src/manage.h, src/manage_acl.h: Add headers accordingly.

	* src/manage_sql.c (GET_ITERATOR_COLUMNS_PREFIX): Use alias for nested
	users query.
	(find_resource_by_name_with_permission, find_group_with_permission)
	(find_role_with_permission, find_user_with_permission)
	(find_user_by_name_with_permission): New functions.
	(copy_resource_lock): Remove special case for admin types.
	(create_group, create_user): Set owner.
	(delete_group, modify_group, delete_role, modify_role)
	(modify_user): Check permissions, now that there are owners.
	(create_permission): Only allow creation of super permissions when the
	user is the direct owner of the resource.  This limits users to giving
	super permission on users/roles/groups that they created.
	(delete_user): Check permissions, now that there are owners.  Make
	children users shared by everyone, for now.

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

	Rename the OMP command RESUME_STOPPED_TASK to RESUME_TASK
	as the first consolidation step to have only a single
	RESUME function.
	This includes the name of the permission, hence increase
	database version to 140 and adjust permissions in the migrator.

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

	* src/manage_migrators.c (migrate_139_to_140): New.
	(database_migrators): Add migrate_139_to_140.

	* src/manage_sql.c (omp_commands): Rename RESUME_STOPPED_TASK
	to RESUME_TASK.
	(omp_command_type): Adjust string accordingly.

	* src/omp.c (resume_stopped_task_data_t): Renamed to resume_task_data_t.
	(client_state_t): Renamed CLIENT_RESUME_STOPPED_TASK to CLIENT_RESUME_TASK.
	(resume_stopped_task_data_reset): Renamed to resumt_task_data_reset.
	(command_data_t): Adjusted according to renaming.
	(resume_stopped_task_data): Renamed to resumt_task_data.
	(omp_xml_handle_start_element): Adjust according to renaming.

	* src/manage.c (slave_setup): Adjust for renamed functions in
	omp module.
	(resume_stopped_task): Rename to resume_task and adjusted names.

	* src/manage.h: Adjust proto accordingly.

	* src/schema_formats/XML/OMP.xml.in: Renamed RESUME_STOP_TASK
	to RESUME_TASK and document this as a protocol change.

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

	* src/schema_formats/XML/OMP.xml.in: Replaced any "Get all" by
	the more precise and less confusing phrase "Get one or many".

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

	* src/omp.c (omp_xml_handle_end_element): Don't adjust type for
	definitions_file parameter as it is now separated from normal files.

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

	Make --role apply to --get-users too.

	* src/manage_sql.c (manage_get_users): Add role_name arg.

	* src/manage.h: Update header accordingly.

	* src/openvasmd.c (main): Pass role to manage_get_users too.

2014-12-11  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/report_formats/Verinice_ISM/Verinice_ISM.xsl: Include CVSS score
	as severity for vulnerabilities as well.

2014-12-10  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (RESULT_ITERATOR_FILTER_COLUMNS)
	(RESULT_ITERATOR_COLUMNS): Add solution_type column.
	(RESULT_ITERATOR_COLUMN_COUNT): Increase to 28.
	(init_result_iterator): Add columns report_id and solution_type
	and case for sorting by solution_type.

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

	* src/manage_acl.c (where_owned): Apply task trash case on top of the
	case for the regular tasks, so that permissions are consulted when
	getting the trash.

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

	* src/manage_acl.c (where_owned): Move general trash table case into the
	cases for the regular tables, so that permissions are consulted when
	getting the trash.

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

	* src/manage_acl.c (type_is_shared): Remove.  Always 0.
	(where_owned): Remove "type is shared" cases, which are no longer used.

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

	* src/manage_acl.c (where_owned): In permissions case, add Super clause.

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

	* src/manage_acl.c (where_owned): In permissions case, add comments and
	use table name directly.

2014-12-10 Timo Pollmeier <timo.pollmeier@greenbone.net>

	Add indices for NVTs, CVEs and CPEs and change init_aggregate_iterator
	to use them. Remove unused features from init_aggregate_iterator for
	simplicity.

	* CMakeLists.txt (OPENVASMD_SCAP_DATABASE_VERSION): Increase to 15.

	* src/manage_pg.c (create_tables): Add indices
	nvts_by_modification_time, nvts_by_cvss_base, nvts_by_solution_type.

	* src/manage_sqlite3.c (create_tables): Add indices
	nvts_by_creation_time, nvts_by_modification_time, nvts_by_cvss_base,
	nvts_by_solution_type.

	* src/manage_sql.c (init_aggregate_iterator): Restructure query so
	indices can be used. Remove ignore_pagination parameter and always
	ignore the filter keywords "first" and "rows". Remove unused cases for
	trash and single resources.

	* src/manage.h (init_aggregate_iterator): Remove ignore_pagination
	parameter.

	* tools/greenbone-scapdata-sync.in: Increase version.
	(db_migrate_15): New function.
	(check_db_version): Add migration to version 15.

	* tools/openvas-scapdata-sync.in (db_migrate_15): New function.
	(check_db_version): Add migration to version 15.

	* tools/scap_db_init.sql, tools/scap_db_init_pg.sql: Add indices
	cpes_by_creation_time, cpes_by_modification_time, cpes_by_max_cvss,
	cves_by_creation_time, cves_by_modification_time, cpes_by_cvss.

	* src/schema_formats/XML/OMP.xml.in (get_aggregates): Add note about
	the command ignoring the filter keywords "first" and "rows" and not
	supporting the trash and id attributes.

	* doc/omp.html: Update from source.

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

	* src/manage_acl.c (user_has_access_uuid): Remove Super note, as this is
	now done in user_owns_uuid.
	(type_has_permissions): Remove.  Always 1.
	(where_owned): Correct doc.  Just do the "type has permission" cases,
	because all types have permissions now.

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

	* src/manage.c (run_task): Correct indenting.

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

	* src/manage_sql.c (create_permission): Check for Super on everything
	after finding the resource, to prevent this permission from being
	created by passing in a fake or deleted resource ID.

2014-12-09  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/schema_formats/XML/OMP.xml.in (get_aggregates): Add missing
	attributes filter and filt_id to the command.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-12-08  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sqlite3.c (cached_task_severity): In overrides case return
	overrides_severity of cache struct after updating it instead of
	returning the severity component without overrides.

2014-12-05  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (manage_optimize): Make vacuum work for SQLite,
	which does not allow it inside a transaction. Show file size reduction
	in messsage after vacuuming.

2014-12-05  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (init_aggregate_iterator): Round time columns down
	to the beginning of the day to reduce the amount of columns returned.

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

	* src/manage_sql.c (manage_set_config_families): When modifying a family
	to include all NVTs, and the family does not grow, recalculate the value
	of the nvts_growing cache column.  Using the previous value gives the
	wrong value when the family being modified was previously the only
	growing family.

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

	* src/manage_sql.c (manage_set_config_families): When modifying a family
	to include all NVTs, and the family does not grow, then use the previous
	value of the nvts_growing cache column.  Using 0 is correct for the
	family being modified, but there may be existing families that grow.

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

	Handle SQLITE_SCHEMA properly, instead of aborting.

	* src/manage_sql.c (report_severity_data, create_agent): Handle new
	sql_exec return.

	* src/sql.c (sqlv, sql_quiet, sql_x_internal, next): Handle new
	sql_exec_internal return.
	(sql_exec): Update doc.

	* src/sql_sqlite3.c (sql_exec_internal): Return if SQLITE_SCHEMA occurs,
	so that caller can prepare and run the statement again.  This can happen
	after a VACUUM, because the VACUUM may change the schema internally.

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

	* src/omp.c (manage_optimize): Lock database around VACUUM, to minimize
	chance of SQLITE_SCHEMA in statements that run afterwards.

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

	Add option --optimize, with arguments "analyze" and "vacuum".

	* src/omp.c (manage_optimize): New function.

	* src/manage.h: Add header accordingly.

	* src/openvasmd.c (main): Add --optimize.

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

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_TASK find the
	task with permission, in case the owner has given the user read access.

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

	Enable mixing of the current user's slaves and tasks, with other
	people's slaves and tasks, when permissions allow it.

	* src/manage_sql.c (init_slave_task_iterator): Get all tasks that use
	the slave.  Add a column to indicate whether the user has read access to
	the slave.
	(slave_task_iterator_readable, trash_slave_readable): New functions.

	* src/manage.c (run_task): Before forking, if task has slave and user is
	denied access to the slave, then return 99.

	* src/manage.h: Add headers accordingly.

	* src/manage_acl.c (where_owned): Add const to owner_filter arg.

	* src/manage_acl.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): Send empty PERMISSIONS in
	TASK in GET_SLAVES when task is not readable.  Same for SLAVE in
	GET_TASKS when slave is not readable.  In CLIENT_MODIFY_TASK find the
	task with permission, in case the owner has given the user read access.
	And find slave with permission, for same reason.

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

	* src/manage_sql.c (modify_task_check_slave_scanner): Correctly account
	for the case where slave ID is 0 (caller will clear slave from task).
	Try make implementation more obvious at the same time.  Also free
	scanner_uuid return.

2014-12-03  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/sql_sqlite3.c (sql_exec_internal): Retry after resetting the
	statement in SQLITE_ERROR case, like it is done in SQLITE_BUSY case.

2014-12-03  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Add solution_type column to NVTs.  Hence increase database version
	to 139.  Add database migration from version 138 to 139.

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

	* src/manage_migrators.c (migrate_138_to_139): New function.
	(database_migrators): Add migrate_138_to_139.

	* doc/db_postgres.sql (nvts): Add solution_type column.

	* doc/db.png: Update for version change.

	* src/manage_pg.c (create_tables): Add solution_type column to the
	nvts table.

	* src/manage_sqlite3.c (create_tables): Add solution_type column to the
	nvts table.

	* src/manage_sql.c (make_nvt_from_nvti): Add solution_type tag.
	(NVT_INFO_ITERATOR_FILTER_COLUMNS, NVT_ITERATOR_COLUMNS)
	(NVT_ITERATOR_COLUMNS_NVTS): Add solution_type column.
	(nvt_iterator_solution_type): New function.

	* src/manage_sql.h (tag_value): New prototype to make the function
	available in manage_migrators.c.

	* src/manage.h (nvt_iterator_solution_type): New function prototype.

2014-12-01  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (credentials_setup): Get "Severity Class" and
	"Dynamic Severity" settings here for consistency with timezone setting.
	(authenticate): Remove queries for "Severity Class" and "Dynamic
	Severity" which are now sent by credentials_setup.

2014-12-01  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Cache "Severity Class" and "Dynamic Severity" settings in the
	current_credentials struct to reduce the amount of SQL queries by OMP
	commands like GET_REPORTS that frequently use these settings.

	* src/manage_sql.c (authenticate): Get "Severity Class" and
	"Dynamic Severity" setting for the credentials struct.
	(report_counts_id_filt, print_report_xml): Add const qualifier to
	local variables for Dynamic Severity setting and remove free / g_free.
	(setting_severity): Add const qualifier and get value from
	current_credentials.
	(setting_dynamic_severity_int): Get value from current_credentials.
	(modify_setting): Update current_credentials when setting Severity
	Class or Dynamic Severity.

	* src/manage.c (severity_in_level): Add const qualifier to variable
	"class" and remove g_free calls.

	* src/manage.h (severity_in_level): Add const qualifier.

	* src/omp.c (omp_xml_handle_end_element): In case CLIENT_AUTHENTICATE
	add const qualifier to variable "severity" and remove g_free calls.

2014-11-28  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (create_schedule): Quote the timezone string for
	insert.

2014-11-28  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/report_formats/LaTeX/latex.xsl: Partially revert r20989 as NVT
	names may indeed contain characters which LaTeX considers special.

2014-11-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (task_writable, trash_task_writable): Remove access
	check to match other such functions.  The permissions name was missing
	the type, causing the WRITABLE element to be wrong.  Access is sent to
	the client in the PERMISSIONS element anyway.

2014-11-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_user): Include Super permissions in delete.

2014-11-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Account for Super in global permission checks.

	* src/manage_acl.c (where_owned): Check permission owner instead of
	permission resource, to see if the permission is global, because Super
	permissions are global but can have resources.

	* src/manage_sql.c (create_permission): Set the owner to NULL for Super
	permissions, because they are global.
	(copy_role): Use permission owner instead of resource in global check.

2014-11-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_group, delete_role): Delete permissions
	according to resource_type too, for Super permissions.  When moving item
	to trash, update the resource locations, because groups and roles can
	have these with Super.

2014-11-27  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (NOTE_ITERATOR_COLUMNS, NOTE_ITERATOR_TRASH_COLUMNS)
	(OVERRIDE_ITERATOR_COLUMNS, OVERRIDE_ITERATOR_TRASH_COLUMNS)
	(ALL_INFO_ITERATOR_COLUMNS): Add missing owner column.

2014-11-27  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Allow severity to be null in CERT-Bund and DFN-CERT Advisories, CPEs
	and OVAL definitions if no severity is available from CVEs.

	* tools/greenbone-certdata-sync.in (update_cvss)
	tools/openvas-certdata-sync.in (update_cvss): Remove coalesce to
	allow null severity values in CERT-Bund and DFN-CERT Advisories.

	* tools/openvas-scapdata-sync.in (update_cvss)
	tools/greenbone-scapdata-sync.in (update_cvss): Remove coalesce to
	allow null severity values in CPEs and OVAL Definitions.

2014-11-26  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/wizards/quick_first_scan.xml: Support optional params for
	Port List and Credentials in Target creation as well as Alert, Config,
	Scanner and Slave in Task creation. Add check for hosts parameter.
	Add new "init" mode to get settings.

	* src/wizards/quick_task.xml: Support new optional params for Port List
	and ESXi Credentials in Target creation, as well as Scanner in Task
	creation.

2014-11-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Add RESOURCE/TYPE to MODIFY_PERMISSION, so that editing of Super
	permissions works.

	* src/manage_sql.c (create_permission): Add resource_type_arg arg.  Add
	checks for Super.

	* src/manage.h: Update header accordingly.

	* src/omp.c (modify_permission_data_t, modify_permission_data_reset)
	(client_state_t): Add RESOURCE/TYPE entry.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add RESOURCE/TYPE to MODIFY_PERMISSION.

	* src/schema_formats/XML/OMP.xml.in (modify_permission): Add
	RESOURCE/TYPE.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-11-26  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (CVE_INFO_ITERATOR_FILTER_COLUMNS): Use the macro
	GET_ITERATOR_FILTER_COLUMNS for consistency.
	(CVE_INFO_ITERATOR_COLUMNS): Use the macro GET_ITERATOR_COLUMNS_PREFIX
	for consistency and add missing dummy "owner" column.

2014-11-26  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (email): New parameter attachment_name which
	sets the base name of the attachment.
	(escalate_2): Generate file name for report attachment.

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

	* src/manage_sql.c (task_preference_iterator_name)
	(task_preference_iterator_value, slave_iterator_password)
	(resource_tag_iterator_active): Remove unused functions.
	(SLAVE_ITERATOR_COLUMNS, SLAVE_ITERATOR_TRASH_COLUMNS): Remove password
	column.
	(init_resource_tag_iterator): Remove active column from iterator.

	* src/manage.h: Remove functions prototypes.

2014-11-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Add RESOURCE/TYPE to CREATE_PERMISSION, so that Super permissions can be
	created on Roles, Groups and Users.

	* src/manage_sql.c (create_permission): Add resource_type_arg arg.  Add
	checks for Super.

	* src/manage.h: Update header accordingly.

	* src/omp.c (create_permission_data_t, create_permission_data_reset)
	(client_state_t): Add RESOURCE/TYPE entry.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add RESOURCE/TYPE to CREATE_PERMISSION.

	* src/schema_formats/XML/OMP.xml.in (create_permission): Add
	RESOURCE/TYPE.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-11-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_acl.c (user_has_super, user_owns_uuid, where_owned): Extend
	Super permission to apply to groups and roles.

2014-11-25  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/wizards/quick_task.xml: Use regex from Modify Task wizard for
	parameter "start_timezone" and use it in the schedule creation.

2014-11-25  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/wizards/modify_task.xml: Use parameter name "start_timezone" to
	set timezone of schedule. Remove now unused parameter "timezone".

2014-11-25  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Add new "Modify Task" wizard.

	* CMakeLists.txt: Install new file src/wizards/modify_task.xml.

	* src/wizards/modify_task.xml: New file.

2014-11-25  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* src/lsc_crypt.c (lsc_crypt_encrypt): Set the name variable correctly
	when looping over the variable arguments list.

2014-11-25  Michael Wiegand <michael.wiegand@greenbone.net>

	* tools/greenbone-certdata-sync.in, tools/greenbone-scapdata-sync.in:
	Remove redundant directories from last commit.

2014-11-25  Michael Wiegand <michael.wiegand@greenbone.net>

	* tools/greenbone-certdata-sync.in, tools/greenbone-scapdata-sync.in,
	tools/openvas-migrate-to-postgres.in: Use existing CMake variables
	directly instead of attempting to derive them from
	CMAKE_INSTALL_PREFIX.

2014-11-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (credentials_setup): New function.
	(authenticate): Also do the credentials setup for authentications from
	task scheduling.

2014-11-25  Matthew Mundell <matthew.mundell@greenbone.net>

	Retry starting of scheduled tasks when the start OMP fails.

	* src/manage.c (reschedule_task): New function.
	(manage_schedule): Do an extra fork and use the extra process to check
	if the child doing the OMP succeeded, when starting the tasks.   If it
	failed to run the OMP, then reschedule the task.  The idea is that the
	OMP commands may fail due to low memory or socket timeouts when another
	process is at 100%.  So we retry them if they fail, instead of just
	leaving them, otherwise the task may skip a scheduled run.

	* src/openvasmd.c (fork_connection_for_schedular): Swap parent and child
	so that the caller gets the direct child of itself.

2014-11-24  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/report_formats/LaTeX/latex.xsl (result-details-host-port-threat):
	Fix formatting of result section "Product Detection Result".

2014-11-24  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/report_formats/LaTeX/latex.xsl (result-details-host-port-threat):
	Drop empty lines at the end of the several sections of the result.

2014-11-24  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/report_formats/LaTeX/latex.xsl (result-details-host-port-threat):
	Replaced use of text-to-escaped-row by direct application of the text
	for NVT names and OIDs which do not contain any characters that
	need escaping or multi-line formatting.

2014-11-24  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/report_formats/LaTeX/latex.xsl (structured-text): New. A simple
	approach to format the structured text adequately of LaTeX. Copied
	from the omp.xsl of GSA.
	(result-details-host-port-threat): Use structured-text instead of
	text-to-escaped-row for those elements where it is assured no
	overlong words or strange characters do appear. This makes
	the formatting nicer and also reduces size of the document.

2014-11-24  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/report_formats/LaTeX/latex.xsl (result-details-host-port-threat):
	Drop line with "OID" in the section "Summary" of results. It is a
	redundant information because the OID appears also in the section
	"Log Method"/"Vulnerability Detection Method". This reduces the size
	of the report.

2014-11-24  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/report_formats/LaTeX/latex.xsl (result-details-host-port-threat):
	Removed an empty line before and an empty line after the "OID" line
	in the section "Summary" of a result. This reduces size of documents
	by several pages.

2014-11-24  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Add settings for default resource selections on the "New Task" and
	"New Target" pages in GSA and get settings in Advanced Task Wizard.

	* src/manage_sql.c (modify_setting): Add default resource settings.

	* src/wizards/quick_task.xml (init): Get settings.

2014-11-21  Michael Wiegand <michael.wiegand@greenbone.net>

	Post-release version bump.

	* CMakeLists.txt: Updated version number.

2014-11-21  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 6.0+beta4 release.

	* CHANGES: Updated.

2014-11-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.h: Export user_is_super_admin.

	* src/omp.c (send_get_common): Add special case for listing permissions
	when the resource is a Super Admin user.

2014-11-21  Matthew Mundell <matthew.mundell@greenbone.net>

	Prevent deletion of users with Super Admin role via OMP.  Prevent
	modification of Super Admin users by everyone except the user themself.

	* src/manage_sql.c (manage_delete_user): Update delete_user call.
	(delete_user): Add forbid_super_admin arg.
	(modify_user): Prevent edit of Super Admin user by other users.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): Update delete_user call.

2014-11-21  Hani Benhabiles <hani.benhabiles@greenbone.net>

	* CMakeLists.txt (GPGME_LDFLAGS, GPGME_CFLAGS): New variables.

	* src/CMakeLists.txt: Properly link against libgpgme.

2014-11-21  Matthew Mundell <matthew.mundell@greenbone.net>

	Prevent creation of users with Super Admin role via OMP.

	* src/manage_sql.c (manage_create_user): Update create_user call.
	(create_user): Add forbid_super_admin arg.
	(copy_user): Prevent cloning users who have the Super Admin role.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): Update create_user call.

2014-11-20  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_pg.c (create_tables), src/manage_sqlite3.c (create_tables):
	Remove attack_state column from report_hosts table.

	* src/manage_sql.c (init_host_iterator): Don't iterate over attack_state
	column.
	(host_iterator_attack_state, set_scan_attack_state): Remove function.
	(host_iterator_current_port, host_iterator_max_port)
	(host_iterator_report, host_iterator_report_uuid): Adjust column order.

	* src/otp.c (scanner_state_t): Remove SCANNER_STATUS_ATTACK_STATE and
	SCANNER_STATUS_PORTS scanner states.
	(process_otp_scanner_input): In SCANNER_STATUS_HOST case, go next to
	SCANNER_STATUS_PROGRESS. Don't handle removed scanner states.

	* doc/db_postgres.sql (report_hosts): Remove attack_state column.

	* src/manage.h: Remove functions prototypes

2014-11-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (REPORT_FORMAT_ITERATOR_COLUMNS)
	(REPORT_FORMAT_ITERATOR_TRASH_COLUMNS): Add owner column, recently added
	to GET iterators.

2014-11-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (RESULT_ITERATOR_COLUMNS, init_result_iterator): Add
	owner column, recently added to GET iterators.
	(RESULT_ITERATOR_COLUMN_COUNT): Increment for new column.

2014-11-20  Matthew Mundell <matthew.mundell@greenbone.net>

	Add permission type "Super" and predefined role "Super Admin".

	* src/manage_acl.c (user_has_super, user_is_super_admin): New functions.
	(user_owns_uuid, where_owned): Add Super checks.

	* src/manage_acl.h: Add headers accordingly.

	* src/manage_sql.c (GET_ITERATOR_COLUMNS): Add owner.
	(GET_ITERATOR_COLUMN_COUNT): Increment.
	(check_db_permissions): Add Super Admin permissions.
	(check_db_role): Add Super Admin.
	(authenticate): Add Super Admin to possible roles in response.
	(NVT_ITERATOR_COLUMNS, NVT_ITERATOR_COLUMNS_NVTS): Add dummy owner.
	(get_iterator_owner): New function.
	(permission_is_predefined): Check for Super.
	(role_is_predefined, role_is_predefined_id): Check for Super Admin.
	(CPE_INFO_ITERATOR_COLUMNS, OVALDEF_INFO_ITERATOR_COLUMNS)
	(CERT_BUND_ADV_INFO_ITERATOR_COLUMNS)
	(DFN_CERT_ADV_INFO_ITERATOR_COLUMNS): Add dummy owner.

	* src/manage.h: Add headers accordingly.

	* src/manage_sql.h (PERMISSION_UUID_SUPER_ADMIN_EVERYTHING)
	(ROLE_UUID_SUPER_ADMIN): New defines.

	* src/omp.c (send_get_common): Send Everything in permissions if user
	has Super on the owner.

2014-11-19  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (modify_setting): Use "else if" instead of "if"
	when selecting setting_name for chart settings.

2014-11-18  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (print_report_xml): Add the element "omp" to the
	report, containing the OMP version in a subelement.

	* src/schema_formats/XML/OMP.xml.in (report): Add the "omp" element and
	the version subelement.
	(get_reports): Update XML example response accordingly.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-11-18  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Make the OMP version a macro defined centrally in the CMake files
	like the database and daemon versions.

	* CMakeLists.txt: New OMP_VERSION variable. Configure the file
	src/schema_formats/XML/OMP.xml.in to insert value of OMP_VERSION here.
	Install generate src/schema_formats/XML/OMP.xml from binary directory.

	* doc/CMakeLists.txt: Use OMP.xml generated in binary directory.

	* src/CMakeLists.txt: New add_definitions to add OMP_VERSION macro.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_VERSION and
	CLIENT_GET_VERSION_AUTHENTIC cases use OMP_VERSION as version number.

	* src/schema_formats/XML/OMP.xml: Remove. Renamed to OMP.xml.in.

	* src/schema_formats/XML/OMP.xml.in: New. Renamed OMP.xml. Use the
	@OMP_VERSION@ placeholder.

2014-11-17  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (omp_command_type): Handle resume_or_start_task
	and resume_stopped_task separately to give correct type.

2014-11-17  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* CMakeLists.txt: Check for and link against libopenvas_omp,
	libopenvas_misc, libopenvas_base libraries instead of the whole
	libopenvas package.

2014-11-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/html/XML/OMP.xml (report): Add TIMEZONE and TIMEZONE_ABBREV.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-11-13  Matthew Mundell <matthew.mundell@greenbone.net>

	In report formats use abbreviation instead of ISO style for timezone.

	* src/manage_sql.c (print_report_xml): Add TIMEZONE and TIMEZONE_ABBREV.
	(setting_timezone): New function.

	* src/manage.h: Add header accordingly.

	* src/report_formats/HTML/HTML.xsl (openvas:timezone-abbrev): New
	function.
	(date): Use abbreviation instead of ISO style timezone.
	(real-report): Note report timezone.

	* src/report_formats/LaTeX/latex.xsl (openvas:timezone-abbrev): New
	function.
	(format-date, scan_end): Use abbreviation instead of ISO style timezone.
	(abstract): Note report timezone.  Also correct end time of second scan
	in delta case.

	* src/report_formats/TXT/TXT.xsl (openvas:timezone-abbrev): New
	function.
	(date): Use abbreviation instead of ISO style timezone.
	(real-report): Note report timezone.

2014-11-13  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (init_aggregate_iterator): Free strings on errors.
	Also free columns and trash_columns on normal return.

2014-11-11  Michael Meyer  <michael.meyer@greenbone.net>

	* tools/openvas-certdata-sync.in(chk_system_tools()):
	  Don't check for wget/curl as both are not used by this
	  script.

2014-11-11  Benot Allard  <benoit.allard@greenbone.net>

	* CMakeLists.txt: Remove trailing hash.

2014-11-11  Benot Allard  <benoit.allard@greenbone.net>

	* CMakeLists.txt: Define _DEFAULT_SOURCE to silent a warning with glibc
	  >= 2.20. See
	  https://sourceware.org/glibc/wiki/Release/2.20#Packaging_Changes

2014-11-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (task_schedule_iterator_start_due): Check whether
	the "next due time" is 0 before adjusting it for the initial timezone.

2014-11-07  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (send_to_sourcefire, send_to_verinice, manage_report)
	(manage_send_report): Call setgroups() before setgid(). Adjusted patch
	from Michal Ambroz.

2014-11-06  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Add get_aggregates permission to all predefined roles except Monitor.
	Hence increase database version to 138.  Add database migration from
	version 137 to 138.

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

	* src/manage_migrators.c (migrate_137_to_138): New function.
	(database_migrators): Add migrate_137_to_138.

	* src/manage_sql.c (omp_commands): Add get_aggregates.
	(check_db_permissions): Explicitly add get_aggregates permission for
	roles Guest and Info.

	* doc/db.png: Update for version change.

2014-11-06  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Delete permissions for User and Observer roles so that they are
	recreated along with new ones.  Hence increase database version to
	137.  Add database migration from version 136 to 137.

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

	* src/manage_migrators.c (migrate_136_to_137): New function.
	(database_migrators): Add migrate_136_to_137.

	* doc/db.png: Update for version change.

2014-11-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/sql_sqlite3.c (sql_exec_internal): Use MIN because an upper limit
	is required.  MAX gives a lower limit.

2014-11-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (main): Add version to log message.

2014-11-06  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (check_db_settings, modify_setting): Add new
	settings "Details Export File Name", "List Export File Name" and
	"Report Export File Name".

2014-11-05  Michael Wiegand <michael.wiegand@greenbone.net>

	* tools/database-statistics-sqlite: New. Shell script to gather
	information about potentially superfluous data from an OpenVAS Manager
	SQLite3 database.

2014-11-05  Michael Wiegand <michael.wiegand@greenbone.net>

	* report_formats/verinice-itg/create_report_import: Bump version.

2014-11-05  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c (manage_result_type_threat, task_run_status_name): Remove
	unused functions.

	* src/manage.h: Delete removed functions headers.

2014-11-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* tools/openvas-migrate-to-postgres.in: New file.  Missed in last
	commit.

2014-11-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* tools/openvas-migrate-to-postgres: Remove.

	* tools/openvas-migrate-to-postgres.in: New file.  Copies of the removed
	script, which sets PREFIX automatically.

	* CMakeLists.txt: Generate openvas-migrate-to-postgres.

2014-11-04  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Add filter name to "filters" elements in OMP get_... responses and
	add a "filters" element to the get_aggregates command response.

	* src/omp.c (buffer_get_filter_xml): New function.
	(send_get_end): Move output of "filters" element to new function
	buffer_get_filter_xml.
	(omp_xml_handle_end_element): Add "filters" element.

	* src/schema_formats/XML/OMP.xml: Add new "name" subelement of
	"filters" element in get command responses. Add "filters" element
	to "get_aggregates" response.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-11-03  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* doc/postgres-HOWTO: Added section about migration.

2014-11-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* tools/greenbone-certdata-sync.in, tools/greenbone-scapdata-sync.in,
	tools/openvas-scapdata-sync.in, tools/greenbone-certdata-sync.in: Supply
	default db to psql_setup.

2014-11-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* tools/openvas-migrate-to-postgres (migrate_rest): Remove stray report
	host details.

2014-11-03  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/sql_pg.c (sql_explain_internal): Remove unnecessary semicolon.
	Correct indentation of while block.

	* src/sql_sqlite3.c (sql_explain_internal): Remove unnecessary
	semicolon. Correct indentation of while block.

2014-11-02  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/manage.c (run_task): Drop setting "ntp_short_status" as this is
	not supported by OTP anymore.

2014-10-31  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Add new functions to write the query plan of SQL queries to the log.

	* src/sql.c (sql_explain_internal): New function prototype.
	(sql_explain): New function.

	* src/sql_pg.c (sql_explain_internal): New function.

	* src/sql_sqlite3.c (sql_explain_internal): New function.

2014-10-31  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (RESULT_ITERATOR_COLUMNS): Change column alias
	"report" to "report_id" so it matches RESULT_ITERATOR_FILTER_COLUMNS.

2014-10-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* tools/openvas-migrate-to-postgres (migrate): Add migration to 136.

2014-10-30  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* tools/openvas-scapdata-sync.in (sec_db_exists): Correct variable name
	for SQLite database path.

2014-10-30  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Set timestamps of placeholder CPEs created from CVEs to creation date
	of oldest CVE.

	* tools/greenbone-scapdata-sync.in (update_placeholders): New function.
	(update_scap_db): Add call to update_placeholders.

	* tools/openvas-scapdata-sync.in (update_placeholders): New function.
	(update_sec_db): Add call to update_placeholders.

2014-10-29  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (NVT_INFO_ITERATOR_FILTER_COLUMNS)
	(NVT_ITERATOR_COLUMNS, NVT_ITERATOR_COLUMNS_NVTS): Add "script_tags"
	column, which corresponds to the "tag" column in the database.

2014-10-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/sql_sqlite3.c (sql_exec_internal): Add upper limit to retry sleep.

2014-10-28  Matthew Mundell <matthew.mundell@greenbone.net>

	Move retries after SQLITE_ERROR up a level, so that the statement is
	prepared again before the retry.

	* src/sql_sqlite3.c (sql_exec_internal): Remove retry after
	sqlite3_reset, because sqlite3_step should not be called after
	SQLITE_ERROR, according to the manual.

	* src/sql.c (sqlv): Clarify 1 return.  Add assert.
	(sql, sql_error): Retry if sqlv returns 1.
	(sql_quiet, sql_x_internal): Retry if sql_exec_internal returns -2.
	(next): Rerun sql_x_internal if it returns -2.
	(sql_exec): Add new return.

	* src/manage_sql.c (report_severity_data_prepare)
	(report_severity_data_prepare_full): New functions.
	(report_severity_data): Prepare statements via new functions.  Retry
	when sql_exec returns -2.
	(create_agent): Retry when sql_exec returns -2.

2014-10-28  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c (openvas_sync_feed, openvas_migrate_secinfo),
	src/manage_sql.c (send_to_sourcefire, send_to_verinice, escalate_2)
	(manage_report, manage_send_report), src/pg_sql.c (sqli): Remove
	break/return/exit/abort duplications.

2014-10-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/sql_sqlite3.c (sql_exec_internal): After a certain number of
	retries, start to sleep between retries.  Sleep for longer as more
	retries happen.  Hopefully this reduces load from retries when a single
	long-running statement is blocking many statements.

2014-10-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Make sure that the delta_states value in reports generated by alerts
	that are triggered by hand matches the given value.  This is purely
	cosmetic because delta reports cannot be generated by alerts.

	* src/manage_sql.c (escalate_2): Add delta_states arg.
	(escalate_1): Add dummy delta_states arg.
	(manage_report): Add delta_states arg.
	(manage_send_report): Pass delta_states arg on to escalate_2, so that
	the same value is used in the filter string of the generated report.

	* src/manage.h: Update header accordingly.

2014-10-27  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (make_result): Check that nvt param is not an empty
	string before trying to find the NVT.

2014-10-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_report_format): Add log messages for more
	internal error cases.

2014-10-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otp.c (process_otp_scanner_input): Set the report and task end
	times before setting the task run status, so that reports generated in
	the associated alerts have the end times.

2014-10-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_result_iterator): Remove severity_to_type from
	auto_type_sql arg, because auto_type_sql evaluates to a severity these
	days.  Similarly, remove the enclosing order_message_type.

2014-10-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_result_iterator): Convert negative values of
	first_result to 0 for OFFSET, for Postgres.

2014-10-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* tools/openvas-migrate-to-postgres (migrate_rest): Remove
	scan_run_status constraint from end_time SQL, because the task end_time
	will be set in all cases, like when the scan is stopped.

2014-10-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Ensure task end_times are correct.  Hence increase database version to
	136.  Add database migration from version 135 to 136.

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

	* src/manage_migrators.c (migrate_135_to_136): New function.
	(database_migrators): Add migrate_135_to_136.

	* doc/db.png: Update for version change.

2014-10-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (buffer_results_xml): Print severity as double with
	precision limiter, otherwise it includes the small fraction from the
	approximation in floating point.

	* src/manage.h: Add header now used in omp.c.

2014-10-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* tools/openvas-migrate-to-postgres: Add 135 migration.

2014-10-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Remove table report_results, which is no longer used.  Hence increase
	database version to 135.  Add database migration from version 134 to
	135.

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

	* src/manage_migrators.c (migrate_134_to_135): New function.
	(database_migrators): Add migrate_134_to_135.

	* src/manage_pg.c (create_tables): Remove report_results.

	* src/manage_sqlite3.c (create_tables): Remove report_results,
	report_results_by_report and report_results_by_result.

	* src/manage_sql.c (report_add_result, delete_report_internal)
	(trim_report, trim_partial_report, delete_user): Remove SQL that
	inserted and deleted report_results.

	* doc/db_postgres.sql (report_results): Remove.

	* doc/db.png: Update from source.

2014-10-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Remove last uses of table report_results.

	* src/manage_acl.c (user_owns_result): Link results and reports
	directly.

	* src/manage_sql.c (init_result_iterator): Link results and reports
	directly.

2014-10-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* tools/greenbone-certdata-sync.in,
	tools/greenbone-scapdata-sync.in: Add --database option, to match
	Manager --database option.

2014-10-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* tools/openvas-certdata-sync.in, tools/openvas-scapdata-sync.in: Add
	--database option, to match Manager --database option.

2014-10-22  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* tools/greenbone-certdata-sync.in, tools/greenbone-scapdata-sync.in:
	Set prefix automatically, using CMAKE_INSTALL_PREFIX.

2014-10-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* tools/openvas-migrate-to-postgres (migrate_rest): Wrap the reset SQL
	in a SELECT with a WHERE clause, to prevent the reset counts from going
	to stdout.  Remove empty lines from the output of the reset SQL too.

2014-10-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* tools/openvas-migrate-to-postgres (migrate_rest): Indent reset SQL.

2014-10-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (handle_sigabrt_simple): New function.
	(update_or_rebuild_nvt_cache, rebuild_nvt_cache_retry): Add info
	messages for clarity.
	(main): Init simple sigabrt handler before doing any SQL.  This ensures
	that when the process aborts it has an error exit code, otherwise it may
	appear to have succeeded.  This was happening, for example, when
	aborting due to SQL error in table init, during a --rebuild.

2014-10-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sqlite3.c (sql_threat_level): Remove.  Now
	sql_task_threat_level, which matches the naming convention.
	(sql_task_threat_level): New function.
	(sql_severity_to_level): Remove single argument case.  This is always
	called with two arguments.
	(manage_create_sql_functions): Update task_threat_level call.

2014-10-22  Matthew Mundell <matthew.mundell@greenbone.net>

	Add Postgres handling of --database.

	* src/manage_pg.c (manage_db_empty, manage_create_sql_functions)
	(manage_cert_loaded, manage_scap_loaded): Use current db name, instead
	of assuming 'tasks'.

	* src/manage_sql.c (manage_encrypt_all_credentials, init_manage_process)
	(manage_create_scanner, manage_delete_scanner, manage_verify_scanner)
	(manage_create_user, manage_delete_user, manage_get_users)
	(manage_get_scanners, manage_set_password): Use function to get default
	database file/name.

	* src/manage_sqlite3.c (manage_backup_db): Use sql_default_database.

	* src/sql_sqlite3.c (sql_database, sql_default_database): New functions.

	* src/sql_pg.c, src/sql_sqlite3.c (sql_database)
	(sql_default_database): New functions.
	(sql_open): Get default database name with function, instead of assuming
	'tasks'.

	* src/sql.h: Add headers accordingly.

	* src/openvasmd.c (main): Adjust help message for Postgres.

2014-10-22  Matthew Mundell <matthew.mundell@greenbone.net>

	Add Postgres handling of --backup.

	* src/manage_sql.c (backup_db): Remove.  Now in manage_sqlite.c.
	(manage_backup_db): Remove.  Now in backend files.

	* src/sql_sqlite3.c (backup_db, manage_backup_db): New functions.

	* src/sql_pg.c (manage_backup_db): New function.

2014-10-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/sql_pg.c, src/sql_sqlite3.c (sql_last_insert_rowid): Remove.  Now
	sql_last_insert_id.  Update call.
	(sql_last_insert_id): New function.

	* src/manage_config_host_discovery.c,
	src/manage_config_system_discovery.c, src/manage_migrators.c,
	src/manage_sql.c: Update sql_last_insert_rowid calls.

	* src/sql.h: Update headers accordingly.

2014-10-21  Henri Doreau <henri.doreau@gmail.com>

	* src/otp.c (process_otp_scanner_input): In SCANNER_TIME_SCAN_END, stop
	the transaction before calling set_scan_end_time_otp, because it also
	runs a transaction.

2014-10-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_report_format): Delete trash report formats
	after their params, otherwise Postgres sees the referential error.
	(manage_empty_trashcan): Delete report format params and their options
	too.

2014-10-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* tools/openvas-migrate-to-postgres (PREFIX): Clear.

2014-10-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* tools/openvas-migrate-to-postgres (does_pg_db_exist): Use column
	instead of *, to avoid escaping issue.
	(is_db_broken): Drop and replace report_hosts_by_host, to remove
	reference to old collation function.

2014-10-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (create_tables): Disable report_hosts_details index,
	because one of the columns can go out of bounds.  Add alternative with
	fewer columns.

2014-10-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (prognosis_order_by): Get host manually, because
	Postgres refuses to accept aliases that are expressions in ORDER BY.

2014-10-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (make_nvt_from_nvti): Add NVT OID to error messages.

2014-10-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (create_tables): Remove SecInfo indexes that belong in
	tools scripts.

	* tools/cert_db_init_pg.sql, tools/scap_db_init_pg.sql: Add indexes from
	create_tables.

2014-10-20  Matthew Mundell <matthew.mundell@greenbone.net>

	Add SQLite to Postgres handling for db version 134.

	* tools/openvas-migrate-to-postgres (migrate_133): Remove.  Now
	migrate_rest.
	(migrate_rest): New function.  Was migrate_133.
	(migrate): Add 134 case.

2014-10-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/postgres-HOWTO: In script section remove leading spaces and add
	indexes.

2014-10-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_asset_iterator): Add ORDER expression to
	columns, as required by Postgres.
	(delete_trash_tasks): Delete tasks after referential dependencies,
	because Postgres checks this.

2014-10-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sqlite.c (manage_cert_loaded, manage_scap_loaded): Use a
	static variable to prevent multiple checks.  This has negligible affect
	on performance, but keeps the logs a little cleaner.

2014-10-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_report_host_details_iterator): Use a join
	instead of a subquery, to prevent SQLite from iterating over all NVTs.
	This greatly speeds up the GSA Hosts page.

2014-10-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_create_sql_functions): Add create_index.
	(create_tables): Create some indexes.

2014-10-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_aggregate_iterator): Add alias for subquery,
	and get LIMIT arg via sql_select_limit, for Postgres.
	(count): When the args effectively produce a simple count, then just do
	the simple count, because this is fastest, at least for Postgres.
	(cpe_highest_cvss): Add exists so that WHEN arg is a boolean.
	(init_host_prognosis_iterator, init_result_iterator)
	(init_all_info_iterator): Get LIMIT arg via sql_select_limit.
	(init_asset_iterator, filtered_host_count): Get LIMIT arg via
	sql_select_limit.  Remove report_results join, as this is much faster in
	Postgres.
	(select_config_nvts): Use 3 when "nvts.name" is given explicitly, too.
	(total_info_count): Just count simply when there is no filtering, as
	this is much faster.

2014-10-14  Michael Wiegand <michael.wiegand@greenbone.net>

	Post-release version bump.

	* CMakeLists.txt: Updated version number.

2014-10-14  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 6.0+beta3 release.

	* CHANGES: Updated.

2014-10-14  Michael Wiegand <michael.wiegand@greenbone.net>

	* CMakeLists.txt: Adjust location of Greenbone synchronization scripts
	since they are now being generated.

2014-10-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_create_sql_functions): Add NULL case to
	severity_to_type, to match SQLite version.

2014-10-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* tools/greenbone-certdata-sync.in (LOG_CMD): Remove -s.
	(sql_scap): New function.
	(sql): Use right database for SQLite case.
	(update_cvss): Use sql_scap so that SQLite case accesses right database.

2014-10-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Make the Greenbone sync scripts work for Postgres too.

	* tools/greenbone-certdata-sync, tools/greenbone-scapdata-sync: Remove.

	* tools/greenbone-certdata-sync.in,
	tools/greenbone-scapdata-sync.in: New files.  Copies of the removed
	scripts, with Postgres support.

	* src/CMakeLists.txt: Configure Greenbone scripts too.

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

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_AGGREGATES case
	add column_info section.

	* src/schema_formats/XML/OMP.xml (get_aggregates): Add column_info
	element in response.

	* doc/omp.html, doc/omp.rnc: Update from source.

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

	Get openvas-portnames-update working with Postgres.

	* tools/openvas-portnames-update.in: Update SQL for postgres.
	(POSTGRES, SQL): New variables.
	(SQLITE): Remove.  Now SQL.

	* tools/portnames_update.xsl: Add missing copyright header.
	(/, iana:record): DELETE and INSERT so that the SQL works in Postgres.
	Neaten indenting.

2014-10-09  Matthew Mundell <matthew.mundell@greenbone.net>

	Make the OpenVAS sync scripts work for Postgres too.

	* tools/openvas-certdata-sync.in (POSTGRES, SCHEMA)
	(RECURSIVE_TRIGGERS_OFF): New variables.
	(show_intro): Specify backend.
	(reinit, check_db_version): Use functions to run SQL.
	(PSQL): New variable.
	(sql_pg, sql_scap, sql, scap_db_exists, cert_db_exists)
	(cert_db_remove): New functions.
	(update_cvss): Use functions to run SQL.  Use substitutions to fit the
	SQL to the backend.
	(update_sec_db): Use functions to run SQL.  Swap "if" cases.  Remove
	empty lines from SQL output, else psql writes empty lines to stdout.

	* tools/openvas-scapdata-sync.in (POSTGRES, SCHEMA)
	(RECURSIVE_TRIGGERS_OFF): New variables.
	(show_intro): Specify backend.
	(reinit): Use functions to run SQL.
	(PSQL): New variable.
	(sql_pg, sql, sec_db_remove, sec_db_exists): New functions.
	(reinit): Use functions to run SQL.  Skip old migrators with Postgres.
	(init_sec_db_update, update_cvss, update_sec_db_private)
	(update_sec_db): Use functions to run SQL.  Use substitutions to fit
	parts of the SQL to the backend.  Use 0.0 for float columns instead of
	''.  Remove empty lines from SQL output.

2014-10-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* tools/cert_bund_update_pg.xsl: Convert to Postgres.

	* tools/dfn_cert_update_pg.xsl (/): Improve comment.

2014-10-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* tools/dfn_cert_update_pg.xsl (merge_dfn_cert_cve): Just INSERT,
	because there is no UUID or key.

2014-10-09  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* CMakeLists.txt: Adding missing "FILES" to make the cmake work
	properly.

2014-10-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* tools/cert_bund_update_pg.xsl, tools/cert_db_init_pg.sql,
	tools/cpe_update_pg.xsl, tools/cve_update_pg.xsl,
	tools/dfn_cert_update_pg.xsl, tools/oval_update_pg.xsl,
	tools/scap_db_init_pg.sql: New files.  Postgres equivalents of existing
	SQLite3 files.

	* CMakeLists.txt: Install SecInfo tools according to SQL backend.

2014-10-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_attach_databases): Add SCAP and CERT to schema
	search_path when they are loaded.
	(manage_cert_loaded): Correct schema name.

2014-10-07  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (result_iterator_type): Use correct column index and
	fix documentation.

2014-10-06  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/sql_sqlite3.c (sql_open): Add PRNG reset for SQLite versions
	older than 3.8.3 as a workaround for SQLite temp file name conflicts
	between forked processes.

2014-10-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Move SCAP and CERT attaching into backend specific files.

	* src/manage_sql.c (init_manage_process): Delete NVT CVEs before NVTs
	when updating, because they refer to NVTs.  Call manage_attach_databases
	to do the attaching.
	(manage_scap_loaded, manage_cert_loaded): Remove.  Now in backend files.

	* src/manage_pg.c (manage_attach_databases, manage_cert_loaded)
	(manage_scap_loaded): New functions.

	* src/manage_sqlite3.c (manage_attach_databases): New function.
	(manage_cert_loaded, manage_scap_loaded): New functions.  Were in
	manage_sql.c

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

	* src/manage_sql.c (filter_clause): Remove set but unused variables.

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

	* src/omp.c (omp_xml_handle_end_element): Remove break before goto in
	create_task error.

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

	* src/manage_sql.c (result_detection_reference): Simplify sql queries by
	using results' report column instead of report_results table.

2014-09-29  Matthew Mundell <matthew.mundell@greenbone.net>

	Add predefined role Monitor.

	* src/manage_sql.c (check_db_permissions, check_db_roles)
	(permission_is_predefined, role_is_predefined)
	(role_is_predefined_id): Add Monitor case.

	* src/manage_sql.h (ROLE_UUID_MONITOR): New define.

2014-09-29  Matthew Mundell <matthew.mundell@greenbone.net>

	Add timezone keyword to powerfilter for report.

	* src/omp.c (get_reports_data_t): Add timezone.
	(omp_xml_handle_start_element): Parse timezone.
	(omp_xml_handle_end_element): Pass timezone to manage_send_report.

	* src/manage_sql.c (manage_report_filter_controls, escalate_2)
	(escalate_1): Add timezone arg.
	(report_filter_term): Include timezone if given.
	(tz_revert): New function.
	(print_report_xml): Add timezone arg.  If given then tzset the zone
	before generating the report.  Also add the timezone to the filter
	elements.
	(manage_report, manage_send_report): Add timezone arg.

	* src/manage.h: Update headers accordingly.

	* src/schema_formats/XML/OMP.xml (get_reports): Add timezone attrib.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-09-29  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Add support for Tasks in get_aggregates command and chart settings
	for Tasks.

	* src/manage_sql.c (type_owned): Also consider info subtypes.
	(init_aggregate_iterator): Remove parameters which are now determined
	inside the function: columns, trash_columns, filter_columns, owned.
	Support apply_overrides filter keyword and special trash handling for
	Tasks. Document new failure return codes for invalid resource type
	and trying to get trash for types that don't use the trashcan.
	(modify_setting): Add cases for the Tasks charts.
	(type_columns, type_select_columns, type_filter_columns)
	(type_trash_columns): Add apply_overrides parameter and case for the
	Task type.
	(type_table): Fix special case for trash items being in the main table
	of the resource type.

	* src/manage.h (init_aggregate_iterator): Remove parameters.
	(type_columns, type_filter_columns, type_trash_columns): Add parameter.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_AGGREGATES case
	no longer determine columns, which are now handled by
	init_aggregate_iterator. Add cases to handle new return codes.

2014-09-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (TASK_ITERATOR_COLUMNS): For next_due, use the
	first_time of the schedule if the schedule is in the past, instead of
	using schedule_next_time which is 0.  This ensures that tasks with
	schedules in the past are sorted by schedule and that they come before
	tasks that have had their schedules removed.

2014-09-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (TASK_ITERATOR_FILTER_COLUMNS): Add "next_due".
	(TASK_ITERATOR_COLUMNS): Add schedule next due time as "next_due".

2014-09-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (TASK_ITERATOR_FILTER_COLUMNS): Add "schedule".
	(TASK_ITERATOR_COLUMNS): Add schedule name as "schedule".

2014-09-25  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (CVE_INFO_ITERATOR_FILTER_COLUMNS)
	(CVE_INFO_ITERATOR_COLUMNS): Allow both "created" and "published"
	as aliases for the "creation_time" column.

2014-09-25  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_AGGREGATES case
	Add new response elements c_count and c_sum for cumulative count and
	cumulative sum of data column.

	* src/schema_formats/XML/OMP.xml (get_aggregates): Add new response
	elements c_count and c_sum.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-09-25  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c (parse_osp_result): Parse the result's severity if
	available and adjust make_osp_result() call.

	* src/manage.h: Modify function prototype.

	* src/manage_sql.c (make_osp_result): Add severity function parameter.

2014-09-24  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (ELSE_ERROR): Remove static strings comparison.
	(ELSE_ERROR_CREATE_TASK): New macro.
	(omp_xml_handle_start_element): Use new macro accordingly.

2014-09-24  Michael Wiegand <michael.wiegand@greenbone.net>

	Bump required minimum version of openvas-libraries.

	* CMakeLists.txt: Bump required openvas-libraries version to 8.0.0 or
	later.

	* INSTALL: Update version of openvas-libraries dependency.

2014-09-23  Michael Wiegand <michael.wiegand@greenbone.net>

	Post-release version bump.

	* CMakeLists.txt: Updated version number.

2014-09-23  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 6.0+beta2 release.

	* CHANGES: Updated.

	* CMakeLists.txt: Ensure openvas-migrate-to-postgres is included in
	tar ball packages. Use correct prefix when chosing tools to install.

2014-09-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_migrators.c (migrate_133_to_134): Remove REFERENCES,
	because the credential is optional.

2014-09-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (set_task_schedule): Actually calculate next time,
	instead of setting it to first time.

2014-09-19  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/wizards/get_tasks_deep.xml: Add new option "include_scanners".

	* src/wizards/quick_auth_scan.xml: Add new optional parameter
	"scanner_id" to select the scanner of the created task.

2014-09-18  Hani Benhabiles  <hani.benhabiles@greenbone.net>

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

	* src/manage.h: Add new function prototype.

	* src/manage.c (parse_osp_report): Call new function.

2014-09-18  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (print_report_xml, manage_send_report): Add new
	ignore_pagination parameter to ignore filter terms and parameters that
	divide the report into pages.

	* src/manage.h (manage_send_report): Add new parameter.

	* src/omp.c (get_reports_data_t): Add new field ignore_pagination.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): In case for
	GET_REPORTS handle new ignore_pagination attribute.

	* src/schema_formats/XML/OMP.xml (get_reports): Add ignore_pagination
	attribute to command.

	* doc/omp.rnc, doc/omp.html: Update from source.

2014-09-18  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Add ESXi credentials field to targets, which are sent to scanner upon
	starting a task using the target. Hence increase database version
	to 134. Add database migration from version 133 to 134.

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

	* src/manage_migrators.c (migrate_133_to_134): New function.
	(database_migrators): Add migrate_133_to_134.

	* doc/db_postgres.sql: Add new column esxi_lsc_credential to table
	targets. Add new columns esxi_lsc_credential and esxi_location to
	table targets_trash.

	* src/manage_pg.c (create_tables): Add new columns to targets and
	targets_trash.

	* src/manage_sql.c (create_target): Add new esxi_lsc_credential
	parameter.
	(delete_target): Set new columns esxi_lsc_credential and esxi_location.
	(modify_target): Add new esxi_lsc_credential_id parameter and define
	return code in case ESXi credentials are not found.
	(TARGET_ITERATOR_FILTER_COLUMNS, TARGET_ITERATOR_COLUMNS): Add new
	columns for ESXi credentials and the ESXi credentials location.
	(TARGET_ITERATOR_TRASH_COLUMNS): Add columns reverse_lookup_only,
	reverse_lookup_unify, alive_test for consistency. Add new
	columns for ESXi credentials and the ESXi credentials location.
	(target_iterator_esxi_credential, target_iterator_esxi_trash): New
	iterator value getter functions.
	(target_esxi_lsc_credential): New function.
	(delete_lsc_credential): Set esxi_location for targets in trashcan.
	(manage_restore): Set esxi_location for targets in trashcan when
	restoring credentials and set esxi_lsc_credential for restored targets.

	* src/manage_sql.h (target_esxi_lsc_credential): New function prototype.

	* src/manage_sqlite3.c (create_tables): Add new columns to targets and
	targets_trash.

	* src/manage.c (run_task): Add plugin and preferences containing ESXi
	credentials and rewrite creation of authentication plugins list to
	generally make adding new items simpler.

	* src/manage.h (create_target, modify_target): Add new parameters.
	(target_iterator_esxi_credential): New function prototype.

	* src/omp.c (create_target_data_t, create_target_data_reset)
	(modify_target_data_t, modify_target_data_reset): Add new field
	esxi_lsc_credential_id.
	(client_state_t): Add CLIENT_CREATE_TARGET_ESXI_LSC_CREDENTIAL and
	CLIENT_MODIFY_TARGET_ESXI_LSC_CREDENTIAL
	(omp_xml_handle_start_element): In cases for CLIENT_MODIFY_TARGET
	and CLIENT_CREATE_TARGET, handle new ESXI_LSC_CREDENTIAL element.
	(omp_xml_handle_end_element): In cases for CLIENT_GET_TARGETS,
	CLIENT_CREATE_TARGET and CLIENT_MODIFY_TARGET add/handle new
	ESXI_LSC_CREDENTIAL element.

	* src/schema_formats/XML/OMP.xml (create_target, get_targets)
	(modify_target): Add new elements for ESXi credentials.

	* doc/omp.rnc, doc/omp.html: Update from source.

2014-09-18  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* INSTALL: Added prerequisite information for vernice report format.

2014-09-17  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (make_osp_result): Set the osp result severity
	correctly in Error Message case.

2014-09-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (run_task): Enable static disabled by last commit.

2014-09-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (run_task): When resuming a task, keep the slave task
	uuid on the report, because slave_setup (via run_slave_task) needs this
	uuid to resume the task on the slave.

2014-09-16  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.h (SCANNER_TYPE_OSP_OVALDI): Rename to SCANNER_TYPE_OSP.

	* src/manage_sql.c (create_config_from_scanner)
	(create_task_check_config_scanner, modify_task_check_config_scanner)
	(verify_scanner): Use new enum member name.

	* src/openvasmd.c (main): Simplify --scanner-type possible values to
	OpenVAS and OSP.

	* src/schema_formats/XML/OMP.xml: Update documentation.

2014-09-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (update_end_times): New function.  Body from slave_setup.
	(slave_setup): Also set end times while the report its running, because
	some hosts may finish long before the task is done.

2014-09-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (check_db_permissions): Allow Guest to get filters.

2014-09-15  Matthew Mundell <matthew.mundell@greenbone.net>

	Get report format dates working when timezone is UTC.

	* src/report_formats/HTML/HTML.xsl (date): New template.
	(scan_start, scan_end): Use date.
	(note, override, real-report): Generate dates with date.

	* src/report_formats/LaTeX/latex.xsl (scan_start, scan_end): Correct
	count.

	* src/report_formats/TXT/TXT.xsl (scan_start, scan_end): Correct count.
	(note, override): Generate dates with scan_start.
	(real-report): Apply scan_start now that it is a matched template.
	Correct location of host start time, and format it like others.

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

	* src/manage.c (run_osp_task): Don't force lsc credentials presence as
	not all osp scanners need them.

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

	* src/manage_sql.c (make_report_format_uuids_unique): When the duplicate
	report formats are in the same directory, then copy the old subdir to
	the new subdir, so that they both have subdirs.  When a subdir is
	missing just log an warning, instead of also failing.

2014-09-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Add new predefined role Guest.

	* src/manage_sql.c (check_db_permissions): Add Guest role permissions.
	(check_db_roles, permission_is_predefined, role_is_predefined)
	(role_is_predefined_id): Add Guest role.

2014-09-11  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Add sections for NVT tag "affected" to report formats.

	* src/report_formats/CSV_Results/CSV_Results.xsl: Add column
	"Affected Software/OS".

	* src/report_formats/HTML/HTML.xsl: Add section "Affected Software/OS".

	* src/report_formats/LaTeX/latex.xsl: Add section
	"Affected Software/OS".

	* src/report_formats/NBE/NBE.xsl: Add section "Affected Software/OS".

	* src/report_formats/TXT/TXT.xsl: Add section "Affected Software/OS".

	* src/report_formats/Verinice_ISM/Verinice_ISM.xsl: Add section
	"Affected Software/OS".

2014-09-10  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (filter_clause): Remove special cases for keyword
	"status".
	(TASK_ITERATOR_COLUMNS, REPORT_ITERATOR_COLUMNS): Rename column
	"status_text" to "status".

2014-09-10  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (manage_set_config_preference): Handle osp
	config preference case.

2014-09-10  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (manage_set_config_preference): Revert part of 20250.
	Neither use UPDATE as nvt_prefs entries may not be present nor INSERT OR
	REPLACE as it is not supported by postgresql.

2014-09-10  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* CMakeLists.txt: Fix install source for openvas-migrate-to-postgres.

2014-09-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_SCHEDULES handle
	the case where abbrev is not set by iso_time_tz.

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

	* CMakeLists.txt: Install openvas-migrate-to-postgres.

	* tools/openvas-migrate-to-postgres (migrate_133): Remove note about
	binary config preferences.  I doubt that anyone has these, and anyway
	they don't store properly in Manager or display at all in GSA.

2014-09-09  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (check_db_settings, modify_setting): Add new setting
	"Auto-Refresh".

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

	* tools/migrate-to-postgres: Remove.  Now openvas-migrate-to-postgres.

	* tools/openvas-migrate-to-postgres: New file.  Was migrate-to-postgres.

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

	* tools/migrate-to-postgres (sqlite): New function.
	(is_db_broken, migrate_133, migrate): Call sqlite, for clarity.

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

	* tools/migrate-to-postgres (sql): Remove.  Now called pg, for clarity.
	(pg): New function.  Was sql.  Update callers.

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

	* tools/migrate-to-postgres (migrate_133): Force a rebuild after the
	migration.

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

	* src/manage_sql.c (copy_config): Remove comment because it is added
	automatically, otherwise Postgres complains.

2014-09-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (create_tables): Use bytea for agent installer, which
	is binary.

	* src/sql_pg.c (bind_param): Format return like rest.

	* tools/migrate-to-postgres (create_tables_133): Use bytea for agent
	installer.
	(migrate_133): Remove agents from migration, for simplicity.

2014-09-08  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (create_config_from_scanner): Insert the parameter's
	default value.

2014-09-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* tools/migrate-to-postgres (migrate_133): Specify columns in COPY.

2014-09-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/HTML/HTML.xsl (real-report): Add task to delta
	case.

2014-09-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/LaTeX/latex.xsl (abstract): Add task to delta case.

2014-09-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/HTML/HTML.xsl,
	src/report_formats/TXT/TXT.xsl (real-report): Add task.

	* src/report_formats/LaTeX/latex.xsl (abstract): Add task.
	(results-overview): Use standard quote style.

2014-09-08  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (RESULT_ITERATOR_FILTER_COLUMNS)
	(RESULT_ITERATOR_COLUMNS): Rename column "report" to "report_rowid".
	Add column "report" / "report_id" with uuid of report.
	(RESULT_ITERATOR_COLUMN_COUNT): Increase to 26.

2014-09-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db.png: Set svn:mime-type property to application/octet-stream.

2014-09-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db_postgres.sql (reports): Correct column type.

	* doc/db.png: Update from source.

2014-09-05  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_migrators.c (migrate_128_to_129): Create scanners_trash
	table if it doesn't exist too.

2014-09-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* tools/migrate-to-postgres (PSQL): New variable.
	(sql): Move above does_pg_db_exist.
	(does_pg_db_exist): Use PSQL.  Check exit.
	(is_db_broken, create_tables_133, migrate): Use better log levels.
	(migrate_133): Use better log levels.  Do months update business in one
	go, so the months table is removed.  Remove debug output.  Use sql and
	PSQL instead of using psql directly.  Enable directory removal.

2014-09-05  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (check_db_configs): Don't insert "OSP Ovaldi" default
	config.
	(config_in_use): Remove check for default osp ovaldi config.
	(make_config_osp_ovaldi): Remove function.

	* src/manage_sql.h (CONFIG_UUID_OSP_OVALDI): Remove definition.

2014-09-05  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (TASK_ITERATOR_COLUMNS): Fix run_status_name alias to
	status_text.

2014-09-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_migrators.c (migrate_80_to_81): Add note about leaving
	column lying around.

2014-09-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (create_tables): Remove reference constraints where
	the column could refer to the trashcan.

	* tools/migrate-to-postgres (create_tables_133): Remove reference
	constraints where the column could refer to the trashcan.
	(migrate_133): Remove associated comment.

2014-09-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_create_sql_functions): Move pl/pgsql functions
	up, because they are used by some of the SQL functions.
	(create_tables): Remove description from tasks, to match SQLite.
	Correct references in report_format_params_trash and
	report_format_param_options_trash.

2014-09-05  Michael Wiegand <michael.wiegand@greenbone.net>

	* tools/migrate-to-postgres: Ensure the GPLv2+ license notice uses the
	paragraph suggested by the Free Software Foundation.

2014-09-04  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql (preference_iterator_type): New function.
	(init_preference_iterator): Add type column.

	* src/manage.h: Add new function prototype.

	* src/omp.c (omp_xml_handle_end_element): In GET_CONFIGS, set the
	type and prepend osp_ in OSP config case.

2014-09-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* tools/migrate-to-postgres: New file.  Functional, but needs some work.

2014-09-04  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Fix check for target value in
	OSP scan case. Remove useless else statements.

	* src/manage_sql.c (create_config_from_scanner): Fix config owner value
	inserted in DB.

2014-09-04  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/omp.c (xml_handle_end_element): In GET_RESULTS case use
	SEND_GET_END macro and calculate correct counts in cases where
	the count on the page is different from the maximum or a single
	result is selected by uuid.

2014-09-04  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Update OMP documentation to reflect recent changes to GET_RESULTS.

	* src/schema_formats/XML/OMP.xml: Add new elements that make
	get_results more consistent with other GET_... OMP commands.
	Place results directly inside get_results_response element and change
	the results element to contain the "max" and "start" attributes instead.
	Update examples accordingly and add compatibility change note.

	* doc/omp.rnc, doc/omp.html: Update from source.

2014-09-04  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/omp.c (xml_handle_start_element): In GET_RESULTS case place
	results directly inside the get_results_response element to make
	it more consistent with other GET_... OMP commands.

2014-09-04  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Allow apply_overrides attribute of GET_RESULTS command to switch off
	overrides.

	* src/omp.c (get_results_data_t): Add apply_overrides_set.
	(xml_handle_start_element): In GET_RESULTS case set apply_overrides_set
	depending on whether the apply_overrides attribute was set.
	(xml_handle_start_element): In GET_RESULTS case check
	apply_overrides_set to decide whether to use apply_overrides attribute.

2014-09-03  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Implement dynamically creating a scan config from an OSP Scanner.

	* src/manage.c (task_scanner_options): Adjust init_preference_iterator()
	call.

	* src/manage.h: Add new function prototype. Adjust modified functions
	prototypes.

	* src/manage_sql.c (get_scanner_params, create_config_from_scanner): New
	functions.
	(config_uuid): Return uuid pointer for consistency with similar
	functions.
	(init_preference_iterator): Remove unused section specifier argument.
	(manage_set_config_preference): Simplify SQL statements and remove
	useless type check.

	* src/omp.c (create_config_data_t): Add scanner element.
	(create_config_data_reset): Free scanner value.
	(client_state_t): Add CLIENT_CREATE_CONFIG_SCANNER state.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Handle new scanner element in create_config
	command. Adjust modified functions calls.

2014-09-03  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (RESULT_ITERATOR_COLUMNS_ARRAY): Make array
	dimensions and indexes match parameters of RESULT_ITERATOR_COLUMNS.
	(init_result_get_iterator, result_count): Adjust array dimensions.
	(init_result_iterator): Fix autofp subquery for selection by id.

2014-09-03  Michael Wiegand <michael.wiegand@greenbone.net>

	* doc/CMakeLists.txt: Use appropriate text for second paragraph of the
	license notices.

2014-09-03  Michael Wiegand <michael.wiegand@greenbone.net>

	Make license of CMakeLists.txt files consistent.

	* doc/CMakeLists.txt: Change license from LGPLv2+ to GPLv2+.

2014-09-02  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (filter_clause): Use column definition instead of
	column name in ORDER BY clause for "severity" and related keywords.
	Apply this to "original_severity" in addition to already existing
	severity related keywords.
	(RESULT_ITERATOR_FILTER_COLUMNS, RESULT_ITERATOR_COLUMNS): Rename
	column "severity" to "original_severity" and "new_severity" to
	"severity".

2014-09-01  Michael Wiegand <michael.wiegand@greenbone.net>

	* CMakeLists.txt, doc/openvasmd.8.xml,
	report_formats/simple_bar_chart/generate,
	report_formats/simple_bar_chart/plot-plt.xsl,
	report_formats/simple_bar_chart/plot.xsl,
	report_formats/simple_map_plot/generate,
	report_formats/simple_map_plot/join.awk,
	report_formats/simple_map_plot/report_to_csv_host.xsl,
	report_formats/simple_map_plot/world_map.map,
	report_formats/simple_pie_chart/generate,
	report_formats/simple_pie_chart/pieplot.xsl,
	report_formats/simple_topo_plot/generate,
	report_formats/simple_topo_plot/hostvisdot-summary.xsl,
	report_formats/sourcefire/generate,
	report_formats/sourcefire/sourcefire.xsl,
	report_formats/verinice-itg/classification-helpers.xsl,
	report_formats/verinice-itg/generate,
	report_formats/verinice-itg/gsm_verinice_itg.xsl, src/CMakeLists.txt,
	src/logf.h, src/lsc_crypt.c, src/lsc_crypt.h, src/lsc_user.c,
	src/lsc_user.h, src/manage_acl.c, src/manage_acl.h, src/manage.c,
	src/manage_config_discovery.c, src/manage_config_host_discovery.c,
	src/manage_config_system_discovery.c, src/manage.h,
	src/manage_migrators.c, src/manage_pg.c, src/manage_pg_server.c,
	src/manage_ranges_all_tcp_nmap_5_51_top_1000.c,
	src/manage_ranges_all_tcp_nmap_5_51_top_100.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, src/manage_sql.c,
	src/manage_sql.h, src/manage_sqlite3.c, src/manage_utils.c,
	src/manage_utils.h, src/omp.c, src/ompd.c, src/ompd.h, src/omp.h,
	src/openvasmd.c, src/otp.c, src/otp.h, src/ovas-mngr-comm.c,
	src/ovas-mngr-comm.h, src/scanner.c, src/scanner.h, src/splint.h,
	src/sql.c, src/sql.h, src/sql_pg.c, src/sql_sqlite3.c, src/tracef.h,
	src/types.h, src/alert_methods/Sourcefire/alert,
	src/alert_methods/verinice/alert, src/report_formats/ARF/ARF.xsl,
	src/report_formats/ARF/generate, src/report_formats/CPE/CPE.xsl,
	src/report_formats/CPE/generate, src/report_formats/create_signatures,
	src/report_formats/CSV_Hosts/CSV_Hosts.xsl,
	src/report_formats/CSV_Hosts/generate,
	src/report_formats/CSV_Results/CSV_Results.xsl,
	src/report_formats/CSV_Results/generate,
	src/report_formats/HTML/generate, src/report_formats/HTML/HTML.xsl,
	src/report_formats/ITG/generate, src/report_formats/ITG/ITG.xsl,
	src/report_formats/LaTeX/generate, src/report_formats/LaTeX/latex.xsl,
	src/report_formats/NBE/generate, src/report_formats/NBE/NBE.xsl,
	src/report_formats/PDF/generate, src/report_formats/Topology/generate,
	src/report_formats/Topology/hostvisdot-summary.xsl,
	src/report_formats/TXT/generate, src/report_formats/TXT/TXT.xsl,
	src/report_formats/Verinice_ISM/classification_generator.sh,
	src/report_formats/Verinice_ISM/generate,
	src/report_formats/Verinice_ISM/Verinice_ISM.xsl,
	src/report_formats/XML/generate, src/schema_formats/HTML/generate,
	src/schema_formats/HTML/HTML.xsl, src/schema_formats/HTML/rnc.xsl,
	src/schema_formats/RNC/generate, src/schema_formats/RNC/rnc.xsl,
	src/schema_formats/RNC/RNC.xsl, src/schema_formats/XML-brief/generate,
	src/schema_formats/XML-brief/OMP.xsl, src/schema_formats/XML/generate,
	src/schema_formats/XML/OMP.xml, src/wizards/delete_task_deep.xml,
	src/wizards/get_tasks_deep.xml, src/wizards/quick_auth_scan.xml,
	src/wizards/quick_first_scan.xml, src/wizards/quick_task.xml,
	src/wizards/reset_task.xml, tools/cert_bund_getbyname.xsl,
	tools/cert_bund_update.xsl, tools/cert_db_init.sql,
	tools/cpe_getbyname.xsl, tools/cpe_update.xsl,
	tools/cpe_youngerthan.xsl, tools/cve_getbyname.xsl,
	tools/cve_update.xsl, tools/cve_youngerthan.xsl,
	tools/dfn_cert_getbyname.xsl, tools/dfn_cert_update.xsl,
	tools/extra/xml_split, tools/greenbone-certdata-sync,
	tools/greenbone-scapdata-sync, tools/openvas-certdata-sync.in,
	tools/openvas-portnames-update.in, tools/openvas-scapdata-sync.in,
	tools/ovaldef_getbyname.xsl, tools/ovaldef_list_ids.xsl,
	tools/oval_timestamp.xsl, tools/oval_update.xsl,
	tools/oval_verify.xsl, tools/scap_db_init.sql: Ensure the GPLv2+
	license notice uses the paragraph suggested by the Free Software
	Foundation.

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

	* src/manage_sql.c (result_detection_reference): Remove useless
	assignment.

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

	* src/manage_sql.c (print_report_prognostic_xml): Remove unused
	variable.
	(init_nvt_info_iterator): Apply filtering clause correctly, to fix
	querying for a specific nvt by name or oid, using get_info command.

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

	* src/omp.c (results_xml_append_nvt), src/manage_sql.c (verify_scanner):
	Fix compiler warnings when NDEBUG is set.

2014-08-29  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (verify_scanner): Use certificates values from the
	scanner object instead of the default paths.

	* src/manage.c (run_osp_task): Adjust fork_osp_scan_handler() call. Use
	the scanner's certificates values, instead of file paths.
	(fork_osp_scan_handler): Remove host and port function arguments. Use
	certificates values when connecting instead of cert files paths.

2014-08-28  Hani Benhabiles  <hani.benhabiles@greenbone.net>

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

	* src/manage.h: Add new function prototype.

	* src/omp.c (omp_xml_handle_end_element): In CREATE_TASK and MODIFY_TASK
	cases, return error when using a multi-host target with an OSP scan
	config.

2014-08-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_report_internal): Keep going if the task
	slave is 0, which can happen if the slave is removed from the task.

2014-08-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* ChangeLog: Remove stray entry.

2014-08-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_create_sql_functions): Add a flag that
	prevents the functions from being created more than once in a process.
	Children of the main process will be forked with the flag set.  Also
	move the uuid-ossp check up for clarity.

2014-08-27  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Refactor code in CREATE_TASK
	case.

2014-08-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Finish Postgres resource_name SQL function.

	* src/manage.c (valid_db_resource_type): Remove.  Now in manage_utils.c.

	* src/manage_utils.c (valid_db_resource_type): New function.  From
	manage.c.

	* src/manage_utils.h: Add header accordingly.

	* src/manage_pg_server.c (sql_valid_db_resource_type): New function.

	* src/manage_pg.c (manage_create_sql_functions): Add
	valid_db_resource_type.  Convert resource_name to plpgsql, so that it
	can handle any resource, and add type check to it.

2014-08-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_migrators.c (SQLITE_OR_NULL): New macro.
	(database_migrators): When building with Postgres, disable migrators
	that depend on SQL functions resource_exists, clean_hosts and
	current_offset.

	* src/manage_pg.c (manage_create_sql_functions): Remove list now that all
	are implemented.

2014-08-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (collate_location): Remove.  No longer used.

2014-08-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sqlite3.c: Remove stray collation headers.
	(sql_order_port): Implement.

2014-08-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_create_sql_functions): Implement order_port.

	* src/manage_sql.c: Remove collation references in docs.

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

2014-08-26  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Add autofp and overrides for lists of results from GET_RESULTS.
	Create views for getting autofp and overrides applying to results to
	reduce size of often duplicated SQL fragments.

	* src/manage_pg.c (create_tables): Add views result_overrides,
	result_new_severities and results_autofp.

	* src/manage_sql.c (LSC_FAMILY_LIST): Remove. Moved to manage.h.
	(RESULT_ITERATOR_COLUMNS): Add autofp, override and dynamic parameters.
	(RESULT_ITERATOR_COLUMN_COUNT, RESULT_ITERATOR_COLUMNS_ARRAY): New
	macros.
	(init_result_get_iterator): Correct documentation. Take autofp,
	override and dynamic_severity parameters into account when getting
	iterator columns.
	(result_count): Correct documentation. Add autofp, override and
	dynamic_severity parameters.
	(init_result_iterator): Simplify queries by using views for autofp
	and overrides.

	* src/manage_sqlite3.c (manage_session_init): Create temporary table
	current_credentials as in PostgreSQL version.
	(create_tables): Add views result_overrides, result_new_severities,
	results_autofp.

	* src/manage.h (LSC_FAMILY_LIST): New. Moved here from manage_sql.c.
	(result_count): Add new parameters.

	* src/omp.c (xml_handle_end_element): In case CLIENT_GET_RESULTS
	apply autofp and apply_overrides and get values for them from filter.

2014-08-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Remove collations now that sorting is done via functions.

	* src/manage_pg.c (manage_create_sql_collations): Remove.

	* src/manage_sqlite3.c (manage_create_sql_collations): Remove.

	* src/manage_sql.c (collate_threat, collate_role): Remove.
	(init_manage_process): Remove collation setup.

2014-08-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (result_cmp): Remove out of date SQL reference note.

2014-08-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Order by threat using function instead of collation, for Postgres.

	* src/manage_sql.c (filter_clause): Order threat using function.  Also
	use column instead of alias.

	* src/manage_pg.c (manage_create_sql_functions): Add order_threat.

	* src/manage_sqlite3.c (sql_order_threat): New function.
	(manage_create_sql_functions): Add order_threat.

2014-08-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Order user roles Admin-first, like they were in the past.

	* src/manage_sql.c (filter_clause): Remove special case for sorting by
	"role", as this term is now "roles".  Add special case for "roles",
	which sorts Admin first and the rest alphabetically.
	(USER_ITERATOR_COLUMNS): Adjust the concat SQL statements to use a
	subselect, because the single select was causing errors in some cases.
	Also put Admin before the other roles in the list.
	(init_user_role_iterator): Sort with order_role so Admin comes first.

	* src/manage_pg.c (manage_create_sql_functions): Add order_role.

	* src/manage_sqlite3.c (sql_order_role): New function.
	(manage_create_sql_functions): Add order_role.

2014-08-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (task_severity): Put report selection in WHERE
	clause instead of using alias, for Postgres.

2014-08-25  Matthew Mundell <matthew.mundell@greenbone.net>

	Get regexp filtering working with Postgres.

	* src/manage_sql.c (filter_clause): Get regexp operator from backend.

	* src/sql_sqlite3.c, src/sql_pg.c (sql_regexp_op): New function.

	* src/sql.h: Add header accordingly.

2014-08-25  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (filter_clause): Cast severity to string for
	"CASE" clause to prevent type errors in PostgreSQL.
	Do not apply "lower" function for the keywords "created", "modified"
	and "published" when creating ORDER BY clause so the corresponding
	columns are not sorted as text.

2014-08-23  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Post-release version bump.

	* CMakeLists.txt: Updated version number.

2014-08-23  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Preparing the openvas-manager 6.0+beta1 release.

	* CHANGES: Updated.

2014-08-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_migrators.c (migrate_131_to_132): Add Postgres version of
	CREATE statements.

2014-08-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (make_result): Set owner to NULL instead of 0,
	otherwise Postgres sees a constraint error.

2014-08-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/postgres-HOWTO: Add functions and aggregates to drop script.

2014-08-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_create_sql_functions): Create
	task_threat_level after functions it uses.

2014-08-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_create_sql_functions): Delay creation of more
	functions that use tables.
	(create_tables): Change attack_state in report_hosts to text.

2014-08-21  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Handle newly added elements in results when importing reports.

	* src/manage_sql.c (create_report): Set owner and date for imported
	results.

	* src/omp.c (client_state_t): Add states for new elements in results:
	CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_COMMENT,
	CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_CREATION_TIME,
	CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_MODIFICATION_TIME,
	CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_NAME,
	CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_OWNER.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add
	read_over cases for the above new states.

2014-08-20  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (init_result_iterator): Fix aliased columns like
	name, created, modified. Add date column.

2014-08-20  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Add columns owner and date to results table. Hence increase database
	version to 133. Add database migration from version 132 to 133.
	Add the new fields to result xml and use powerfilter in GET_RESULTS.

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

	* src/manage_migrators.c (migrate_132_to_133): New function.
	(database_migrators): Add migrate_132_to_133.

	* doc/db_postgres.sql: Add new columns owner and date to results table.

	* src/manage_acl.c (where_owned): Add case for the type "result".

	* src/manage_pg.c (create_tables): Add new columns to results table.

	* src/manage_sql.c (resource_count): Add case for "result" type.
	(RESULT_ITERATOR_FILTER_COLUMNS, RESULT_ITERATOR_COLUMNS): New column
	definition macros.
	(init_result_get_iterator, result_count): New functions.
	(init_result_iterator): Add new columns to results table.
	(result_iterator_host, result_iterator_port, result_iterator_nvt_oid)
	(result_iterator_original_type, result_iterator_type)
	(result_iterator_descr, result_iterator_task, result_iterator_report)
	(result_iterator_scan_nvt_version, result_iterator_original_severity)
	(result_iterator_severity, result_iterator_severity_double)
	(result_iterator_original_level, result_iterator_level): Update column
	indexes to accommodate newly added columns at positions used by generic
	get iterator functions.

	* src/manage_sqlite3.c (create_tables): Add new columns to results
	table.

	* src/manage.h (result_count, init_result_get_iterator): New function
	prototypes.

	* src/omp.c (get_results_data_t, get_results_data_reset): Add field
	"get" for generic get data structure. Remove fields result_id and
	details, which are part of get.
	(omp_xml_handle_start_element): In GET_RESULTS case, parse generic get
	attributes and remove separate handling of attributes result_id and
	details.
	(buffer_results_xml): Add new fields owner, name, comment,
	creation_time and modification_time to XML.
	(omp_xml_handle_end_element): In CLIENT_GET_RESULTS case, replace
	result_id and details in get_results_data with equivalents in
	get_results_data.get and use new init_result_get_iterator function
	to get list of multiple results.

2014-08-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (slave_setup): When the slave status is Done, update the
	master progress just before setting the master status, instead of before
	updating the results, otherwise the progress is -1 while the status is
	still Running.

2014-08-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Add results from slave inside a transaction, to try reduce load on
	SQLite3 locking mechanism.

	* src/manage.c (update_from_slave): Remove.  Now in manage_sql.c.

	* src/manage_sql.c (update_from_slave): New function.  From manage.c.
	Add transaction around loop that adds results.

	* src/manage_sql.h: Add header accordingly.

2014-08-19  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Remove unused rpm, deb and exe lsc_credentials columns.  Hence increase
	database version to 132.  Add database migration from version 131 to
	132.

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

	* src/manage_migrators.c (migrate_131_to_132): New function.
	(database_migrators): Add migrate_131_to_132.

2014-08-19  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_pg.c (create_tables), src/manage_sqlite3.c (create_tables):
	Don't create rpm, deb and exe columns.

	* src/manage_sql.c (create_lsc_credential, copy_lsc_credential)
	(delete_lsc_credential, LSC_CREDENTIAL_ITERATOR_COLUMNS)
	(LSC_CREDENTIAL_ITERATOR_TRASH_COLUMNS, manage_restore): Adjust for
	unused columns removal.

	* doc/db_postgres.sql (lsc_credentials, lsc_credentials_trash): Remove
	rpm, deb and exe columns.

	* doc/db.png: Update.

2014-08-19  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (lsc_credential_iterator_rpm)
	(lsc_credential_iterator_deb, lsc_credential_iterator_exe): Change
	functions return value from const char to char as it is allocated
	dynamically.

	* src/manage.h: Adjust functions prototypes.

	* src/omp.c (omp_xml_handle_end_element): Free return value from creds
	packages iterators.

2014-08-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/HTML/HTML.xsl (scan_start, scan_end): Add timezone
	to date.

	* src/report_formats/LaTeX/latex.xsl (scan_start, scan_end): Add case
	for negative timezones.  Print sign for positive timezone.

	* src/report_formats/TXT/TXT.xsl (scan_start, scan_end): Add case
	for negative timezones.  Print sign for positive timezone.

2014-08-15  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (trim_report, trim_partial_report): Don't start a
	transaction as this is already done in called function. Fixes a
	transaction within transaction error when resuming stopped tasks.

2014-08-15  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (create_lsc_credential): Test the provided private
	key and passphrase combination before creation.

	* src/omp.c (omp_xml_handle_end_element): Handle new
	create_lsc_credential() error code.

2014-08-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Correct caching of Postgres counts when overrides are applied.

	* src/sql_pg.c (sql_stmt_param_add): Duplicate according to param size,
	because some params are binary.
	(sql_bind_double): Send param as string, to avoid binary format issues.

2014-08-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Move manage_db_version check out to backend function so that it works in
	Postgres.  This enables --migrate for Postgres.

	* src/manage_sqlite3.c, src/manage_pg.c (manage_db_empty): New function.

	* src/manage.h: Add header accordingly.

	* src/manage_sql.c (manage_db_version): Use manage_db_empty.

2014-08-14  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c (parse_osp_report): Use message type in osp report. Call
	make_osp_result() adequately.

	* src/manage.h: Add new function prototype.

	* src/manage_sql.c (ovaldef_cves): Fix function documentation.
	(make_osp_result): New function.
	(make_result): Remove oval definition case handling.

	* src/omp.c (results_xml_append_nvt): Handle oval definition with no
	CVEs case. Use nvt oid as name when no name is found.

2014-08-14  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/schema_formats/XML/OMP.xsl, doc/omp.html: Documentation update for
	pause_task and resume_paused_task OMP commands removal.

2014-08-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Account for recent command removal in permissions.  Hence increase
	database version to 131.  Add database migration from version 130 to
	131.

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

	* src/manage_migrators.c (migrate_130_to_131): New function.
	(database_migrators): Add migrate_130_to_131.

	* doc/db.png: Update for version change.

2014-08-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Remove target locators feature.

	* src/manage_sql.c (omp_commands): Remove GET_TARGET_LOCATORS.
	(create_target, modify_target): Remove target locator args.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (create_target_data_t, create_target_data_reset)
	(modify_target_data_t, modify_target_data_reset, client_state_t): Remove
	target locator elements.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Remove target locators.

	* src/schema_formats/XML/OMP.xml: Remove target locators from OMP.

	* doc/omp.rnc, doc/omp.html: Update from source.

2014-08-13  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* doc/omp.html, doc/omp.rnc, src/schema_formats/XML/OMP.xml: Update
	documentation for scan pausing removal.

2014-08-13  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Remove task pausing feature.

	* src/manage.h (task_status_t): Delete TASK_STATUS_PAUSE_REQUESTED,
	TASK_STATUS_PAUSE_WAITING, TASK_STATUS_PAUSED,
	TASK_STATUS_RESUME_REQUESTED, TASK_STATUS_RESUME_WAITING statuses.
	Remove deleted functions prototypes.

	* src/manage.c (run_status_name, run_status_name_internal, slave_setup)
	(stop_task_internal, manage_check_current_task): Remove handling of
	deleted statuses.
	(pause_task, resume_paused_task): Delete functions.

	* src/manage_pg.c (manage_create_sql_functions): Remove deleted task
	statuses handling.

	* src/manage_sql.c (omp_commands): Remove pause_task and
	resume_paused_task commands.
	(task_in_use, stop_active_tasks, set_task_requested,
	(task_iterator_current_report, set_task_schedule)
	(delete_report_internal, report_active, delete_user): Remove deleted
	task statuses handling.

	* src/omp.c (pause_task_data_t, resume_paused_task_data_t): Remove
	typedefs.
	(pause_task_daa_reset, resume_paused_task_data_reset): Delete functions.
	(command_data_t): Remove pause_task and resume_paused_task commands.
	(pause_task_data_t, resume_paused_task_data_t): Remove variables.
	(client_state_t): Remove CLIENT_PAUSE_TASK and
	CLIENT_RESUME_PAUSED_TASK states.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Remove task
	pausing and resuming handling.

	* src/otp.c (process_otp_scanner_input): Remove scan pausing and
	resuming handling.

2014-08-13  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (results_xml_append_nvt): Correctly set the nvt tag's
	cvss_base in oval definitions case.

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

	* src/manage_pg.c (manage_create_sql_functions): Add task_last_report and
	task_second_last_report.  Implement task_trend.

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

	* src/manage_sqlite3.c (report_severity_count): Correct arg count doc.

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

	Implement Postgres function report_severity_count.

	* src/manage_utils.c (level_min_severity, level_max_severity): New
	functions.  From manage.c.

	* src/manage.c (level_min_severity, level_max_severity): Remove.  Now in
	manage_utils.c.

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

	* src/manage_pg.c (manage_create_sql_functions): Move C section up.  Add
	names to report_severity args.  Add severity_class.  Implement
	report_severity_count.

	* src/manage_pg_server.c (sql_level_min_severity)
	(sql_level_max_severity): New functions.

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

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

	* src/manage.h: Add new function prototype.

	* src/omp.c (results_xml_append_nvt): Add the CVEs affecting the oval
	definition to the nvt tag.

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

	* src/manage.c (parse_osp_report): Don't append oval definition
	description as result description.

	* src/omp.c (results_xml_append_nvt): In oval definition case,
	adequately add the title and the description of the ovaldef to the nvt
	tag.

2014-08-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (cache_report_counts): Escape SQL keyword "user" for
	Postgres.

2014-08-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_create_sql_functions): Implement
	report_severity.  Move report_severity and report_severity_count below
	OVERRIDES_SQL.

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

	* src/manage.c (parse_osp_report): Don't append oval definition evaulation
	to the result description as only confirmed definitions are sent. Adjust
	and refactor code accordingly.

	* src/manage_sql.c (make_result): Handle null description value.

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

	* src/manage_pg.c (manage_create_sql_functions): Implement
	task_threat_level.  Correct severity_to_level check.

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

	* src/manage.c (fork_osp_scan_handler): Correctly assert osp_get_scan()
	return value. Remove retry limit to continue until success or failure
	and act similarly to the current OpenVAS scanner. Add log warning and
	report error when scan is stopped by the OSP Scanner.

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

	* src/manage_pg.c (manage_create_sql_functions): Implement task_severity.

2014-08-08  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Rebuild CERT database as version 6 to apply fix for problems with CVEs
	in older DFN-CERT advisories.

	* CMakeLists.txt (OPENVASMD_CERT_DATABASE_VERSION): Increase to 6.

	* tools/cert_db_init.sql: Increase database_version to 6.

	* tools/openvas-certdata-sync.in (db_migrate_4, db_migrate_5): Removed
	as database is rebuilt for version 6.
	(check_db_version): Rebuild to migrate to database version 6.

	* tools/greenbone-certdata-sync (db_migrate_4, db_migrate_5): Removed
	as database is rebuilt for version 6.
	(check_db_version): Rebuild to migrate to database version 6.

2014-08-08  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* tools/dfn_cert_update.xsl (atom:entry): Split CVE elements in case
	they contain a list of CVEs, fix or filter out invalid CVE-IDs.

2014-08-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (create_tables): Change some numeric columns to
	integers.

2014-08-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_create_sql_functions): Add report_active and
	report_progress_active.  Implement report_progress.

	* src/manage_sql.c (REPORT_ITERATOR_COLUMNS): Change the progress
	padding so that it also works in Postgres.

2014-08-07  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c (fork_osp_scan_handler): Add error message when stopping
	scan for time-out. Increase retry limit to handle larger files.

	* src/manage_sql.c (make_result): Handle null host and port function
	parameters.

2014-08-06  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/manage_sql.c (create_target, modify_target): Replace calls
	of request_resource functions by simply NULL in order de-couple
	this deprecated feature from openvas-libraries.
	The todo remains to entirely remove the target locators from
	OpenVAS Manager.

	* src/omp.c (omp_xml_handle_end_element): Replace call
	of request_resource function by simply NULL in order de-couple
	this deprecated feature from openvas-libraries.
	The todo remains to entirely remove the target locators from
	OpenVAS Manager.

2014-08-06  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c (parse_osp_report): Use transaction when inserting osp
	report results to improve performance.

	* src/manage_sql.c (make_result): Set severity to 0.0 when not found in
	ovaldi definition case too.

2014-08-06  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (results_xml_append_cert, results_xml_append_nvt): New
	functions.
	(buffer_results_xml): Refactor code to use new functions and add nvt
	name in oval definitions result case.

2014-08-06  Matthew Mundell <matthew.mundell@greenbone.net>

	Get the GSA Assets page loading with Postgres.

	* src/manage_sql.c (prognosis_order_by): Order host with function instead
	of collation.
	(where_levels): Add new_severity_sql argument.  Use instead of alias.
	(init_asset_iterator, filtered_host_count): Pass new_severity SQL into
	where_levels.  Move last_report SQL out of the SELECT columns and refer
	to it directly in the WHERE clauses.  Order hosts with function instead
	of collation.

2014-08-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_asset_iterator, filtered_host_count): Reduce
	SQL indent to make space for next change.

2014-08-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_asset_iterator, host_nthlast_report_host)
	(filtered_host_count): Remove report_hosts end_time '' checks, because
	end_time is now an integer.  Add aliases for subqueries.  For Postgres.

2014-08-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_create_sql_functions): Add common_cve.

	* src/manage_sqlite3.c (sql_common_cve): Correct doc.

2014-08-05  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c (parse_osp_report): Insert the oval definition as the
	result nvt when available to be able to correctly set the severity for
	the result. Adjust ovaldef_description() call.

	* src/manage.h: Add new functions prototypes.

	* src/manage_sql.c (ovaldef_severity, ovaldef_version): New functions.
	(make_result): In oval definition case, insert the result severity and
	version correctly. Cleanup function code.
	(ovaldef_description): Take ovaldef ID as function argument instead of
	the definition's name.

2014-08-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (get_ovaldi_files): Disable SQL, for Postgres.

2014-08-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_result_iterator, column_auto_type): Use =
	instead of == in SQL.  Use EXISTS in SQL to make sure the OR argument is
	boolean.  Both for Postgres.
	(report_counts_autofp_match): Use = instead of ==, for Postgres.

2014-08-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_session_init): Clear current_credentials in
	case the user is authenticating again in the session.

2014-08-05  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* tools/cert_bund_getbyname.xsl, tools/cert_bund_update.xsl: New
	XSL stylesheets.

2014-08-05  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Add new SecInfo subtype CERT-Bund Advisory (CERT_BUND_ADV).

	* CMakeLists.txt: Increase OPENVASMD_CERT_DATABASE_VERSION to 5.
	Install new CERT-Bund XSL stylesheet files.

	* src/manage_acl.c (user_owns_uuid): Add case for cert_bund_adv.

	* src/manage_sql.c (resource_name, trash_id_exists): Add cases for
	cert_bund_adv.
	(modify_setting): Add CERT-Bund filters and chart preferences.
	(CERT_BUND_ADV_INFO_ITERATOR_FILTER_COLUMNS)
	(CERT_BUND_ADV_INFO_ITERATOR_COLUMNS): New column #defines.
	(ALL_INFO_UNION_COLUMNS): Add cert_bund_adv.
	(init_cert_bund_adv_info_iterator, cert_bund_adv_info_count)
	(cert_bund_adv_info_iterator_title)
	(cert_bund_adv_info_iterator_summary)
	(cert_bund_adv_info_iterator_cve_refs)
	(cert_bund_adv_info_iterator_max_cvss, init_cve_cert_bund_adv_iterator)
	(init_nvt_cert_bund_adv_iterator): New cert_bund_adv iterator functions.
	(create_tag, modify_tag, type_columns, type_select_columns)
	(type_filter_columns): Add cases for cert_bund_adv.

	* src/manage.c (CERT_BUND_ADV_GETBYNAME_XSL)
	(CERT_BUND_ADV_FILENAME_FMT): New #define constants.
	(valid_db_resource_type): Add case for cert_bund_adv.
	(get_cert_bund_adv_filename): New static function.
	(get_nvti_xml): Add CERT-Bund to CERT references of NVT.
	(manage_read_info): Add case for cert_bund_adv.

	* src/manage.h (init_cert_bund_adv_info_iterator)
	(cert_bund_adv_info_count, cert_bund_adv_info_iterator_title)
	(cert_bund_adv_info_iterator_summary)
	(cert_bund_adv_info_iterator_cve_refs)
	(cert_bund_adv_info_iterator_max_cvss, init_cve_cert_bund_adv_iterator)
	(init_nvt_cert_bund_adv_iterator): New function prototypes.

	* src/omp.c (buffer_results_xml): Add CERT-Bund to CERT references of
	NVT.
	(omp_xml_handle_end_element): In CLIENT_GET_INFO case, add info subtype
	cert_bund_adv. Add CERT-Bund to CERT references of CVE details.

	* src/schema_formats/XML/OMP.xml (get_info): Add CERT_BUND_ADV as info
	type in request and response.

	* doc/omp.rnc, doc/omp.html: Update from source.

	* tools/cert_db_init.sql: Increase database_version to 5.
	(cert_bund_advs, cert_bund_cves): New tables.
	(cert_bund_advs_idx, cert_bund_cves_adv_idx, cert_bund_cves_cve_idx):
	New indexes.
	(cert_bund_adv_delete): New deletion trigger.

	* tools/greenbone-certdata-sync: Increase script version number.
	(db_migrate_5): New function.
	(check_db_version): Migrate to database version 5.
	(update_cvss, update_cert_db): Add Update of CERT-Bund data.

	* tools/openvas-certdata-sync.in (db_migrate_5): New function.
	(check_db_version): Migrate to database version 5.
	(update_cvss, update_sec_db): Add Update of CERT-Bund data.

2014-08-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (parse_iso_time): When there is a timezone in the
	time string, then convert the time under that timezone, otherwise it is
	assumed to be in the current timezone.  In particular this ensures that
	the task "Scan started" time is correct in slave scans when the master
	and slave users have different timezones.

2014-08-05  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (create_report): Use sql transactions as Debian 5 is
	not supported anymore.

2014-08-04  Hani Benhabiles  <hani.benhabiles@greenbone.net>

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

	* src/manage.h: Add function prototype.

	* src/manage.c (parse_osp_report): Use the oval definition's id instead
	of its name as it may not be unique.
	(get_definitions_file): New function.

2014-08-04  Matthew Mundell <matthew.mundell@greenbone.net>

	Add options --max-email-attachment-size and --max-email-include-size.

	* src/manage_sql.c (REPORT_NOTICE_FORMAT, REPORT_ATTACH_FORMAT): Remove
	extra specifiers now that the message is in one argument.
	(MAX_CONTENT_LENGTH, MAX_ATTACH_LENGTH): Update doc.
	(max_content_length, max_attach_length): New variables.
	(escalate_2): Use variables instead of definitions for the max values.
	(init_manage_internal, init_manage): Add args for email maximums.

	* src/omp.c (init_omp): Add args for email maximums.

	* src/ompd.c (init_ompd): Add args for email maximums.

	* src/ompd.h, src/omp.h: Update headers accordingly.

	* src/openvasmd.c (main): Add options.  Pass to init_ompd.

	* doc/openvasmd.8.xml: Add max options.

	* doc/openvasmd.8, doc/openvasmd.html: Update from source.

2014-08-04  Hani Benhabiles  <hani.benhabiles@greenbone.net>

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

	* src/manage.h: Add new function prototype.

	* src/manage.c (parse_osp_report): Add the oval definition's
	description to the result's description adequately. Adjust formatting.

2014-08-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_role): Correct return doc.

	* src/omp.c (omp_xml_handle_end_element): Correct CREATE_ROLE error
	message.

2014-07-04  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c (run_osp_task): Set task run status after connecting and
	on errors accordingly.
	(fork_osp_scan_handler): Set task and report run status on fork failure.

2014-08-01  Henri Doreau <henri.doreau@gmail.com>

	* src/manage.c (slave_setup): Use openvas_server_sendf instead of
	openvas_server_send, which is to be removed eventually.

2014-07-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_user): For ldap_connect users, generate the
	password if it is empty.

2014-07-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (setup_full_config_prefs): Add unscanned_closed_udp.

2014-07-30  Matthew Mundell <matthew.mundell@greenbone.net>

	Make GET_REPORTS work with shared report formats.

	* src/manage_sql.c (manage_report, manage_send_report): In the script
	path, use the UUID of the report format's owner, because the report
	format might not be owned by the current user.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_REPORTS search
	in all report formats, so that the user can specify report formats that
	are owned by someone else.

	* src/manage.h: Add header accordingly.

2014-07-30  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (init_aggregate_iterator): Use column aliases again
	in outer SELECT columns and GROUP BY clause.

2014-07-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* ChangeLog: Add entry for r19597 that was overwritten by r19598.

2014-07-30  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c (delete_osp_scan): New function.
	(fork_osp_scan_handler): Delete OSP scan upon successful finish.

2014-07-30  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (modify_setting): Add chart preferences and
	dashboard filters. Rename filter_name to setting_name.

2014-07-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (group_users, role_users): Do the group_concat in an
	outer SELECT, so that it aggregates the selected rows.

2014-07-29  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c (task_scanner_options): Adjust the base path of ovaldi
	definitions file.

	* src/omp.c (get_ovaldi_files): Get the list from the scap.db xml_files
	values of ovaldefs table instead of iterating over the directory files
	in filesystem.

2014-07-28  Matthew Mundell <matthew.mundell@greenbone.net>

	When importing a report format, give the report format a new UUID if its
	UUID clashes with another report format.  Also create a link to the feed
	signature of the existing report format to keep the trust working.

	* src/manage_sql.c (find_signature): Add uuid arg.  If given then also
	look for the signature as a link in the private directory.  If the link
	exists return UUID at destination in uuid arg.  Update callers.
	(create_report_format): When verifying use the linked signature if it is
	present.  When a report format or trash report format with the given
	UUID exists already, create the format with a new UUID and link to the
	signature of the existing UUID in the feed.
	(delete_report_format): Remove signature links when ultimately deleting.
	(verify_report_format_internal): Use the linked signature if it is
	present.

2014-07-25  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c (get_nvti_xml): Remove hardcoded and unused nvt checksum
	and algorithm values.

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

2014-07-25  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (make_result): Handle null nvt case when inserting
	the result in DB.

2014-07-25  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c (task_scanner_options): Fetch the definitions file from
	disk, as only the name is stored in DB now.

2014-07-25  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (get_ovaldi_files): New function.
	(omp_xml_handle_end_element): In GET_SCAN_CONFIGS case, send list of xml
	files under scap-data/defs folder as default value for definitions_file
	config preference. Change type from osp_file to ovaldi_file. Adjust
	related code accordingly.

2014-07-25  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (init_scanner_task_iterator)
	(scanner_task_iterator_uuid, scanner_task_iterator_name): New functions.

	* src/omp.c (omp_xml_handle_end_element): Include tasks using the
	scanner object in GET_SCANNERS when the details attribute is set.

	* src/manage.h: Add new functions prototypes.

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

2014-07-25  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Allow ALLINFO to be used in the GET_AGGREGATES command.

	* src/manage.h (type_table): New function prototype.

	* src/manage_sql.c (init_aggregate_iterator): Get expression for SQL
	FROM clause with new type_table function.
	(type_columns, type_select_columns, type_filter_columns): Add case for
	ALLINFO.
	(type_table): New function.

2014-07-23  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c (run_task): Check if scanner is loading right after the
	connecting to it.

	* src/scanner.c (openvas_scanner_is_loading): New function.

	* src/scanner.h: Add new function prototype.

2014-07-23  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (ALERT_ITERATOR_TRASH_COLUMNS)
	(TARGET_ITERATOR_TRASH_COLUMNS): Fix tables names.
	(PORT_LIST_ITERATOR_TRASH_COLUMNS): Fix table columns names.
	(init_port_list_iterator): Fix trash_columns variable value.
	(init_port_range_iterator): Fix counting to correctly handle port lists
	in trashcan case.

2014-07-22  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c (run_osp_task): Use LSC Credentials attached to the
	target as OSP scan options and adjust function accordingly.
	(parse_osp_report): Adjust make_result() function call.

	* src/manage_sql.c (make_config_osp_ovaldi, check_db_configs): Remove
	unused osp ovaldi config preferences and delete left-overs.

2014-07-21  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/schema_formats/XML/OMP.xml, doc/omp.rnc, doc/omp.html: Update
	documentation for get tasks OMP command.

2014-07-21  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/schema_formats/XML/OMP.xml, doc/omp.rnc, doc/omp.html: Update
	documentation for create_task and modify_task OMP commands.

2014-07-21  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/schema_formats/XML/OMP.xml, doc/omp.rnc, doc/omp.html: Add
	documentation for create_scanner, modify_scanner, get_scanners and
	delete_scanner OMP commands.

2014-07-21  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Increase limit of max number of hosts specified in user Host Access
	Control to 16,777,216.

	* src/manage.h (MANAGE_USER_MAX_HOSTS): New define.

	* src/manage_sql.c (manage_set_max_hosts): New function.
	(create_user, modify_user): Use the new maximum number of specified
	hosts.

2014-07-21  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.h: Add new function header.

	* src/manage_sql.c (modify_task_check_slave_scanner): New function.
	(modify_task_check_config_scanner): Handle one null parameter case.

	* src/omp.c (omp_xml_handle_end_element): In CREATE_TASK and MODIFY_TASK
	cases, improve the handling of erroneous scanner and slave values
	combinations.

2014-07-18  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (modify_scanner): Do not set certs fields if provided
	values are empty.

2014-07-18  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Send scanner CA public key and
	public key in GET_SCANNERS case. Adjust modify_scanner() call.
	(modify_scanner_data_t): Add new elements for scanners certs.
	(modify_scanner_data_reset): Free data in new elements.
	(client_state_t): Add new states for MODIFY_SCANNER.
	(omp_xml_handle_start_element, omp_xml_handle_text): Handle new
	MODIFY_SCANNER states.

	* src/manage.h: Add and modify functions prototypes.

	* src/manage_sql.c (modify_scanner): Enable modifying ca_pub, key_pub
	and key_priv fields when provided.

2014-07-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (NOTE_ITERATOR_COLUMNS, NOTE_ITERATOR_TRASH_COLUMNS)
	(OVERRIDE_ITERATOR_COLUMNS, OVERRIDE_ITERATOR_TRASH_COLUMNS): Cast
	string literals because Postgres requires this when the SELECT is
	enclosed in a SELECT DISTINCT, which can happen since yesterday's
	init_get_iterator commit.

2014-07-18  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (create_scanner_data_t): Add ca_pub, key_pub and key_priv
	elements.
	(create_scanner_data_reset): Free new elements memory accordingly.
	(client_state_t): Add new states for CREATE_SCANNER.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Handle new states and values accordingly. Adjust
	create_scanner() call.

2014-07-18  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Use Scanner certs from DB.

	* src/manage_sql.c (manage_scanner_set, verify_scanner): Call
	openvas_scanner_set_certs() accordingly.
	(scanner_ca_pub, scanner_key_pub, scanner_key_priv): New functions.

	* src/manage.c (scanner_connect): Set scanner certs values from DB.
	(stop_task_internal): Remove handling of tasks with no scanner.

	* src/manage.h: Add functions prototypes.

	* src/scanner.c (openvas_scanner_connect): Connect with
	openvas_server_new_mem() and adjust to use certificates global variables
	accordingly.
	(openvas_scanner_free): Free certificates memory and reset variables.
	(openvas_scanner_set_certs): New function.

	* src/scanner.h: Add new function prototype.

2014-07-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (columns_build_select): Include column aliases.

2014-07-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_get_iterator): Do the DISTINCT case with an
	enclosing SELECT DISTINCT, because if a SELECT is DISTINCT then Postgres
	requires the ORDER BY clause to be in the SELECT columns.  Adding an
	enclosing SELECT is simpler than adding the ORDER BY clause to the
	SELECT columns.

2014-07-17  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (SCANNER_ITERATOR_COLUMNS): Add ca_pub, key_pub and
	key_priv columns.
	(scanner_iterator_ca_pub, scanner_iterator_key_pub)
	(scanner_iterator_key_priv): New functions.

2014-07-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_result_iterator): Order by port, host and
	message type using order functions instead of COLLATE, because Postgres
	COLLATE is limited.

2014-07-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (make_result): Change double to text in coalesce,
	because cvss_base is text and Postgres wants them the same.

2014-07-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_report_errors_iterator): Use comma instead of
	JOIN, for Postgres and general consistency.

2014-07-17  Matthew Mundell <matthew.mundell@greenbone.net>

	Remove alias usage in results SQL, for Postgres.

	* src/manage_sql.c (where_levels_auto): Add args for new severity and
	auto type SQL.  Use the SQL instead of the aliases.
	(CVSS_BASE_SQL): New define.  For init_result_iterator.
	(init_result_iterator): Use the CVSS base SQL directly, instead of the
	alias "cvss_base".  Similary use the new severity and auto type SQL
	directly in the ORDER clause.  And pass the new severity and auto type
	SQL into where_levels_auto so that the WHERE levels clause uses the SQL
	directly instead of using the aliases.
	(column_auto_type): Remove commas from SQL.
	(report_scan_result_count): As above, pass SQL into where_levels_auto
	and use SQL directly instead of using aliases.

2014-07-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (create_tables): Make severity a double in the notes
	tables, to match overrides.

2014-07-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (resource_name): Expect the end_time to be an
	integer instead of text.
	(set_task_end_time): Convert the given string to an integer.

2014-07-17  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/scanner.c (openvas_scanner_write): Adjust openvas_server_connect()
	function call.

2014-07-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (filter_clause, report_scan_result_count): Cast to
	REAL instead of NUMBER, because Postgres does not support NUMBER.

2014-07-17  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/otp.h (scanner_init_state_t): Remove SCANNER_INIT_CONNECT_INTR state.

	* src/otp.c (process_otp_scanner_input): Remove
	SCANNER_INIT_CONNECT_INTR case.

	* src/scanner.c (openvas_scanner_write): Remove handling of removed init
	case. Adjust openvas_server_connect() call and return value handling
	accordingly. Set socket to be nonblocking only after successful connect.
	(openvas_scanner_connect): Don't set socket to nonblocking.
	(openvas_scanner_init): Don't loop over openvas_scanner_write() anymore.
	Code style update.

	* src/ompd.c: Remove useless include.
	(serve_omp): Don't handle removed scanner init state.

2014-07-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (task_severity, report_add_result)
	(init_result_iterator, init_asset_iterator, report_scan_result_count)
	(filtered_host_count): Limit override selection to one row, as Postgres
	complains if a subselect in an expression returns multiple rows.

2014-07-17  Matthew Mundell <matthew.mundell@greenbone.net>

	Adjust SQL bind functions slightly, for Postgres.

	* src/manage_sql.c (report_severity_data): Send address instead of value
	to int64 and double bind functions.

	* src/sql_pg.c, src/sql_sqlite3.c (sql_bind_int64, sql_bind_double): Make
	value arg a pointer, for Postgres binding.

	* src/sql.h: Update headers accordingly.

2014-07-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sqlite3.c (sql_order_message_type, sql_order_port): New
	functions.
	(manage_create_sql_functions): Create sorting functions
	order_message_type and order_port, to match Postgres.

2014-07-17  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Add --verify-scanner option.

	* src/manage_acl.c (user_has_access_uuid): Return true if the user's
	uuid is empty.

	* src/manage_sql.c (manage_verify_scanner): New function.
	(verify_scanner): Fix memory leak on error.

	* src/manage.h: Add function prototype.

	* src/openvasmd.c (main): Add --verify-scanner option.

2014-07-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_create_sql_functions): Add an integer version
	of "lower", because the iterator ORDER BY expressions may use lower on
	integer columns.

2014-07-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/sql_pg.c (struct sql_stmt, sql_stmt_init, sql_finalize)
	(sql_reset): Remove store.  No longer used.

2014-07-16  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/scanner.c (openvas_scanner_write): Remove openvas_server_verify()
	call. This is done in libraries.

2014-07-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Get results as text instead of as binary in the Postgres SQL layer.
	This prevents having to worry about byte ordering, especially for
	doubles.

	* src/sql_pg.c (sql_stmt_store): Remove.  No longer used.
	(sql_exec_internal): Request text results.
	(sql_column_double, sql_column_text, sql_column_int)
	(sql_column_int64): Expect results as text.

2014-07-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_create_sql_functions): Switch first arg of
	severity_in_level to double.  Add double-integer version of
	severity_to_level.  Add order_message_type and order_port dummy, for
	sorting.  Add severity_to_type and severity_matches_ov.
	(create_tables): Switch severity columns in overrides tables to double.

2014-07-16  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Add --scanner-ca-pub, --scanner-key-pub and --scanner-key-priv
	command-line arguments.

	* src/manage_sql.c (manage_create_scanner): Add ca_pub_path,
	key_pub_path and key_priv_path function arguments. Read files content
	and call create_scanner accordingly.
	(create_scanner): Add ca_pub, key_pub and key_priv function arguments.
	Insert values in DB accordingly.

	* src/openvasmd.c (main): Add new cli options and adjust
	manage_create_scanner() call.

	* src/omp.c (omp_xml_handle_end_element): Adjust create_scanner call.

	* src/ompd.c: Remove unused defines.

	* src/manage.h: Update functions prototypes.

	* doc/openvasmd.8, doc/openvasmd.8.xml, doc/openvasmd.html: Update
	documentation.

2014-07-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (make_nvt_from_nvti): Correct modification time tag
	name changed in parse_time patch on 2014-06-02.

2014-07-16  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (check_db_scanners): Insert the default certificates
	when creating the default scanner. Return value for success or error.
	(check_db): Adjust for check_db_scanners() call change.
	(copy_scanner, delete_scanner, manage_restore): Add scanners new columns.

2014-07-15  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Add scanners columns for ca cert and client key pairs. Hence increase
	database version to 130. Add database migration from version 129 to 130.

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

	* src/manage_migrators.c (migrate_129_to_130): New function.
	(database_migrators): Add migrate_129_to_130.

	* src/manage_pg.c, src/manage_sqlite3.c (create_tables): Add ca_pub,
	key_pub and key_priv columns to scanners and scanners_trash tables
	creation.

	* doc/db_postgres.sql (scanners, scanners_trash): Add new columns.

	* doc/db.png: Update documentation.

2014-07-14  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Use default scanner when none
	is provided in CREATE_TASK. Fixes issue in run wizard case.

2014-07-14  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (make_nvt_from_nvti): Delete any NVT with the same
	OID before inserting the new one.

2014-07-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_family_iterator, select_config_nvts): Use
	numeric position of column in ORDER BY when there is an EXCEPT, for
	Postgres.

2014-07-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sqlite3.c (sql_severity_matches_ov): Correct doc and error
	message.  Add missing space.

2014-07-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_host_iterator): Convert host into Internet
	address type in ORDER BY, because using collation for custom sorting in
	Postgres is not possible.

	* src/manage_sqlite3.c (sql_inet): New function.
	(manage_create_sql_functions): Create function "inet" to match Postgres.

2014-07-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (select_config_nvts): Use = instead of == in SQL, for
	Postgres.

2014-07-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Indent to avoid lone closing
	paren.

	* src/manage_sql.c (report_add_result): Move closing paren up.
	(PORT_LIST_ITERATOR_COLUMNS, PORT_LIST_ITERATOR_TRASH_COLUMNS): Remove
	stray space.

2014-07-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_aggregate_iterator): Convert column for GROUP
	BY to the SELECT column.

2014-07-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (filter_clause): Put the "lower" back into the
	ORDER BY, now that the ORDER BY expression is the actual SELECT column
	instead of the alias.

2014-07-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* ChangeLog: Correct last entry.  Remove extra entry.

2014-07-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_create_sql_functions): Add hosts_contains.

2014-07-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (columns_select_column): Add check for filter
	columns that have been prefixed with underscore to differentiate them
	from columns that have the same name.

2014-07-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (underscore_sql_quote): Remove.  No longer used.
	(filter_clause): Lookup column from filter column in all cases.
	(PERMISSION_ITERATOR_COLUMNS, PERMISSION_ITERATOR_TRASH_COLUMNS): Make
	spacing consistent.

2014-07-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sqlite3.c (sql_report_progress): Correct doc.

2014-07-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_create_sql_functions): Add dummy functions for
	task_trend, task_threat_level and task_severity, so that the Reports
	page loads.
	(create_tables): Remove explicit references that are optional in notes
	and overrides, for now.

2014-07-09  Matthew Mundell <matthew.mundell@greenbone.net>

	Use the column value directly in WHERE clauses generated for filter
	terms, because Postgres does not allow the WHERE clause to use column
	aliases.

	For example, for the filter term "ips=20" use the SQL

	    SELECT name, (SELECT count (*) FROM ...) AS ips, ...
	    FROM targets
	    WHERE (SELECT count (*) FROM ...) = 20;

	instead of

	    SELECT name, (SELECT count (*) FROM ...) AS ips, ...
	    FROM targets
	    WHERE ips = 20;

	* src/manage_sql.c (column_t): New type.
	(columns_select_column, columns_build_select): New functions.
	(filter_clause): Add select_columns arg.  Lookup the actual column
	expression in select_columns instead of using aliases, for the clause.
	(GET_ITERATOR_COLUMNS_STRING): New define.
	(GET_ITERATOR_COLUMNS_PREFIX, GET_ITERATOR_COLUMNS): Switch to structure.
	(init_get_iterator, count): Add select_columns and trash_select_columns
	args.  Pass to filter_clause, and use to build the SELECT column string
	for the SQL.
	(init_aggregate_iterator): Add select_columns and trash_select_columns
	args.  Pass to filter_clause.
	(ALERT_ITERATOR_COLUMNS, ALERT_ITERATOR_TRASH_COLUMNS)
	(TASK_ITERATOR_COLUMNS, REPORT_ITERATOR_COLUMNS)
	(TARGET_ITERATOR_COLUMNS, TARGET_ITERATOR_TRASH_COLUMNS)
	(CONFIG_ITERATOR_COLUMNS, CONFIG_ITERATOR_TRASH_COLUMNS)
	(NVT_ITERATOR_COLUMNS, NVT_ITERATOR_COLUMNS_NVTS)
	(LSC_CREDENTIAL_ITERATOR_COLUMNS, LSC_CREDENTIAL_ITERATOR_TRASH_COLUMNS)
	(AGENT_ITERATOR_COLUMNS, AGENT_ITERATOR_TRASH_COLUMNS)
	(NOTE_ITERATOR_COLUMNS, NOTE_ITERATOR_TRASH_COLUMNS)
	(OVERRIDE_ITERATOR_COLUMNS, OVERRIDE_ITERATOR_TRASH_COLUMNS)
	(SCANNER_ITERATOR_COLUMNS, SCANNER_ITERATOR_TRASH_COLUMNS)
	(SCHEDULE_ITERATOR_COLUMNS, SCHEDULE_ITERATOR_TRASH_COLUMNS)
	(REPORT_FORMAT_ITERATOR_COLUMNS, REPORT_FORMAT_ITERATOR_TRASH_COLUMNS)
	(SLAVE_ITERATOR_COLUMNS, SLAVE_ITERATOR_TRASH_COLUMNS)
	(GROUP_ITERATOR_COLUMNS, GROUP_ITERATOR_TRASH_COLUMNS)
	(PERMISSION_ITERATOR_COLUMNS, PERMISSION_ITERATOR_TRASH_COLUMNS)
	(PORT_LIST_ITERATOR_COLUMNS, PORT_LIST_ITERATOR_TRASH_COLUMNS)
	(ROLE_ITERATOR_COLUMNS, ROLE_ITERATOR_TRASH_COLUMNS)
	(FILTER_ITERATOR_COLUMNS, FILTER_ITERATOR_TRASH_COLUMNS)
	(CVE_INFO_ITERATOR_COLUMNS, CPE_INFO_ITERATOR_COLUMNS)
	(OVALDEF_INFO_ITERATOR_COLUMNS, DFN_CERT_ADV_INFO_ITERATOR_COLUMNS)
	(USER_ITERATOR_COLUMNS, USER_ITERATOR_TRASH_COLUMNS)
	(TAG_ITERATOR_COLUMNS, TAG_ITERATOR_TRASH_COLUMNS)
	(TAG_NAME_ITERATOR_COLUMNS): Switch to structure.
	(alert_count, init_alert_iterator, init_task_iterator, resource_count)
	(task_count, report_count, init_report_iterator, target_count)
	(init_target_iterator, config_count, init_config_iterator)
	(init_nvt_info_iterator, nvt_info_count, init_nvt_info)
	(lsc_credential_count, init_lsc_credential_iterator)
	(init_agent_iterator, agent_count, note_count, init_note_iterator)
	(override_count, init_override_iterator, init_scanner_iterator)
	(scanner_count, schedule_count, init_schedule_iterator)
	(report_format_count, init_report_format_iterator, slave_count)
	(init_slave_iterator, group_count, init_group_iterator)
	(permission_count, init_permission_iterator, port_list_count)
	(init_port_list_iterator, role_count, init_role_iterator, filter_count)
	(init_filter_iterator, setting_count, init_setting_iterator)
	(cpe_info_count, init_cpe_info_iterator, cve_info_count)
	(init_cve_info_iterator, init_ovaldef_info_iterator, ovaldef_info_count)
	(init_dfn_cert_adv_info_iterator, dfn_cert_adv_info_count)
	(init_cve_dfn_cert_adv_iterator, init_nvt_dfn_cert_adv_iterator)
	(total_info_count, init_all_info_iterator, user_count)
	(init_user_iterator, init_tag_iterator, tag_count)
	(init_tag_name_iterator): Pass column structures instead of strings.
	(TASK_ITERATOR_TRASH_COLUMNS): Remove.  Same as TASK_ITERATOR_COLUMNS.
	(init_user_task_iterator, init_user_target_iterator)
	(init_user_config_iterator, update_all_config_caches)
	(update_config_cache_init, init_user_lsc_credential_iterator)
	(): Build SELECT string from column structure.
	(nvt_iterator_columns, nvt_iterator_columns_nvts): New function.
	(select_config_nvts): Use function fto get SELECT column string.
	(SETTING_ITERATOR_EXTRA_COLS): Remove.  Now
	SETTING_ITERATOR_FILTER_COLUMNS, to match other.
	(SETTING_ITERATOR_FILTER_COLUMNS): New define.  Renamed.
	(SETTING_ITERATOR_COLUMNS, ALL_INFO_ITERATOR_COLUMNS): New defines.
	(ALL_INFO_UNIION_COLUMNS): Use GET_ITERATOR_COLUMNS_STRING.
	(type_columns, type_trash_columns): Build SELECT column string from
	column structure.  Adjust return accordingly.
	(type_select_columns): New function.

	* src/manage.h: Adjust headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): Free type_columns and
	type_trash_columns returns, because they are allocated now.

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

	* src/manage_sql.c (escalate_2): Use the value of alert method data
	'verinice_server_report_format' to get the report format, if the method
	data is set.

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

	* src/make_config_discovery.c (make_config_discovery): Add config type.

	* src/manage_config_host_discovery.c (make_config_host_discovery): Add
	config type.

	* src/manage_config_system_discovery.c (make_config_system_discovery):
	Add config type.

	* src/manage_sql.c (check_db_tasks): Add default scanner for the example
	task.

2014-07-04  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_TASKS, adjust scanner
	element values when task is of type container.

2014-07-03  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/ompd.c (serve_omp): In NVT cache mode, do not attempt to connect
	to the default scanner if already connected to another one.

	* src/openvasmd.c (main): Take into account --scanner-port and
	--scanner-host options when using --rebuild and --update.

	* doc/openvasmd.8, doc/openvasmd.html, doc/openvasmd.8.xml: Update
	documentation.

2014-07-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_migrators.c (migrate_128_to_129): Ensure table exists.

2014-07-02  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_TASKS, send the scanner
	type too.

	* src/manage_sql.c (modify_task_check_config_scanner): Handle unchanging
	config and scanner case.

2014-07-02  Henri Doreau <henri.doreau@gmail.com>

	* CMakeLists.txt, src/CMakeLists.txt: Properly handle libgcrypt compile
	switches.

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

	* src/manage_sqlite3.c (sql_tag): Correct doc.

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

	For Postgres add actual max_hosts implementation, and get next_time
	working.

	* src/manage_pg.c (manage_create_sql_functions): Implement max_hosts,
	as a C function.  Remove STRICT from next_time.

	* src/manage_pg_server.c (sql_next_time): Correct name in
	PG_FUNCTION_INFO_V1.
	(textndup, sql_max_hosts): New function.

	* src/manage_utils.c (manage_count_hosts_FIX): New function.

	* src/manage_utils.h: Add header accordingly.

2014-06-30  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* doc/postgres-HOWTO: Added item about library path for postgres.

2014-06-30  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (delete_scanner): Don't allow deleting a scanner in
	use. Update function documentation accordingly.
	(manage_delete_scanner): Handle new return code.

	* src/main.c (manage_delete_scanner): Handle new return code.

2014-06-30  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_migrators.c (migrate_128_to_129): Use current sql instead
	of calling check_db_scanners() as the function may change in the future.

2014-06-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_get_iterator): Remove extra_tables arg, which
	was always NULL.  Update callers.

2014-06-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/CMakeLists.txt: Add "openvasmd" to manage-pg-server destination.

2014-06-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/postgres-HOWTO: Add command to create uuid-ossp extension.

2014-06-27  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Set all tasks to have an associated scanner.  Hence increase database
	version to 129.  Add database migration from version 128 to 129.

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

	* src/manage_migrators.c (migrate_128_to_129): New function.
	(database_migrators): Add migrate_128_to_129.

	* src/manage_sql.c (check_db_scanners): Export function.
	(run_osp_task, run_task, stop_task_internal, pause_task)
	(resume_paused_task): Check that the task has an associated scanner.
	Adjust the functions accordingly.

	* src/manage.h: Add function prototype.

2014-06-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_create_sql_functions): Update iso_time to get
	the required timezone according to the current user.  In SQLite the
	user's timezone is the current timezone, but the Postgres functions run
	on the server so they always have the server's timezone.  Use pspgsql
	instead of plain SQL to help with reusing values in the calcuation.

2014-06-27  Hani Benhabiles  <hani.benhabiles@greenbone.net>

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

	* src/manage.h: Add function prototype.

	* src/omp.c (omp_xml_handle_end_element): Make scanner mandatory in task
	creation and modification.

2014-06-26  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (manage_get_scanners): Print both the Scanner's UUID
	and its name.
	(manage_delete_scanner): Don't allow deletion of the default scanner.

	* doc/openvasmd.8, doc/openvasmd.8.xml, doc/openvasmd.html: Update
	documentation.

2014-06-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (buffer_notes_xml, buffer_overrides_xml): Send OWNER in both
	cases, else GSA assumes the note/override is global.

2014-06-25  Matthew Mundell <matthew.mundell@greenbone.net>

	Prevent any changes to the permissions of predefined roles.

	* src/manage_sql.c (find_permission, permission_subject_type)
	(permission_subject): New functions.
	(create_permission, copy_permission): Prevent creation of permissions
	that have predefined roles as subjects.
	(permission_is_predefined): Include permissions of predefined roles.
	(delete_permission, modify_permission): Prevent modification of
	permissions of predefined roles.
	(find_permission): Move up in file.
	(role_is_predefined_id): New function.

2014-06-25  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c (scanner_connect): Adequately return value for success or
	error.

	(run_task, stop_task_internal, pause_task, resume_paused_task): Use the
	default scanner when the task has no scanner associated. Check error
	codes accordingly.

	* src/openvasmd.c (main): Don't preemptively set the scanner's address
	and port.

2014-06-25  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Check if the last commands most likely failed due to a database lock
	and retry in this case.
	Make error messages for failed commands more consistent and replace
	sqlite3 calls with $SQLITE3 where it makes more sense.

	* tools/greenbone-certdata-sync (): Add -bail parameter to SQLITE3
	variable. Add variables MAX_SQL_RERTRIES and SQL_RETRY_DELAY.
	(reset_sql_tries): New function.
	(test_exit_codes, test_sql_exit): Add checks for database lock and make
	error messages more consistent.
	(is_db_broken, reinit, db_migrate_4, update_cvss, update_cert_db): Add
	retry loops.

	* tools/greenbone-scapdata-sync (): Add -bail parameter to SQLITE3
	variable. Add variables MAX_SQL_RERTRIES and SQL_RETRY_DELAY.
	(reset_sql_tries): New function.
	(test_exit_codes, test_sql_exit): Add checks for database lock and make
	error messages more consistent.
	(is_db_broken, reinit, db_migrate_9, db_migrate_10, db_migrate_11)
	(db_migrate_12, db_migrate_13, db_migrate_14, init_scap_db_update)
	(update_cvss, update_scap_db_private, update_scap_db): Add retry loops.
	Use $SQLITE3 instead of sqlite3 without extra parameters.

	* tools/openvas-certdata-sync.in (): Add -bail parameter to SQLITE3
	variable. Add variables MAX_SQL_RERTRIES and SQL_RETRY_DELAY.
	(reset_sql_tries): New function.
	(test_exit_codes, test_sql_exit): Add checks for database lock and make
	error messages more consistent.
	(reinit, db_migrate_4, update_cvss, update_sec_db): Add retry loops.

	* tools/openvas-scapdata-sync.in (): Add -bail parameter to SQLITE3
	variable. Add variables MAX_SQL_RERTRIES and SQL_RETRY_DELAY.
	(reset_sql_tries): New function.
	(test_exit_codes, test_sql_exit): Add checks for database lock and make
	error messages more consistent.
	(reinit, db_migrate_9, db_migrate_10, db_migrate_11, db_migrate_12)
	(db_migrate_13, db_migrate_14, update_sec_db_private)
	(update_sec_db): Add retry loops. Use $SQLITE3 instead of sqlite3
	without extra parameters.

2014-06-25  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (check_db_scanners): New function.
	(check_db): Check or add default openvas scanner in db.
	(manage_scanner_set, manage_scanner_set_default): New functions.
	(verify_scanner): Verify openvas_scanner_set_address() return value for
	errors.

	* src/manage.h: Add functions prototypes.

	* src/manage_sql.h (SCANNER_UUID_DEFAULT): New define.

	* src/ompd.c (serve_omp): Connect to the default scanner in nvt cache mode.

	* src/openvasmd.c (update_or_rebuild_nvt_cache): Do not attempt to
	connect to the scanner.

	* src/scanner.c (openvas_scanner_set_address): Resolve the address if
	provided as a hostname.

2014-06-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_user, modify_user): Validate the hosts arg.
	This catches errors like forgotten commas in the hosts, for example.

	* src/omp.c (omp_xml_handle_end_element): Handle new create_user and
	modify_user returns.

2014-06-24  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c (scanner_active): Remove redundant variable.
	(run_task): Don't set scanner_active value.

	* src/omp.c (scanner_is_active): Remove function.

	* src/omp.h: Delete removed functions prototypes.

	* src/openvasmd.c (serve_omp): Remove check for scanner with
	scanner_is_active() as connections aren't preemptive anymore.

	* src/otp.c (process_otp_scanner_input): Don't set scanner_active
	values.

2014-06-24  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/ompd.c (serve_omp): Adjust condition to call
	process_otp_scanner_input() and remove redundant call. Code clean-up and
	style update.

	* src/otp.c (process_otp_scanner_input): Remove knowledge about where
	the function was called from in serve_omp and make it more reentrant.

	* src/scanner.c (openvas_scanner_write): Return success if there is
	nothing to do for current init state.

2014-06-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (utf8_substring): New function.
	(buffer_notes_xml, buffer_overrides_xml): Use utf8_substring instead of
	g_utf8_substring, which only appears in Glib 2.30.

2014-06-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (get_schedules): Add TIMEZONE_ABBREV.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-06-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/Verinice_ISM/generate: Correct XSL file name.

2014-06-24  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Add --delete-scanner option.

	* doc/openvasmd.8: Update documentation.

	* src/manage.h: Add function prototype.

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

	* src/openvasmd.c (main): Add --delete-scanner cli option.

2014-06-23  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/openvasmd.c (main): Add --create-scanner with --scanner-host,
	--scanner-port and --scanner-type options.

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

	* src/manage.h: Add function prototype.

	* doc/openvasmd.8: Update documentation.

2014-06-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Send timezone abbreviation with schedule in GET_SCHEDULES.

	* src/manage_sql.c (iso_time_internal): New function.  Body from
	iso_time.
	(iso_time): Call iso_time_internal.
	(iso_time_tz): Add abbrev arg.

	* src/manage.h: Adjust header accordingly.

	* src/omp.c (omp_xml_handle_end_element): Add TIMEZONE_ABBREV to
	GET_SCHEDULES.

2014-06-23  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Remove --slisten and --sport options. Rename --list-users to
	--get-users. Add --get-scanners.

	* doc/openvasmd.8: Update documentation.

	* src/manage.h: Add and rename function prototypes.

	* src/manage_sql.c (manage_list_users): Rename to manage_get_users.
	(manage_get_scanners): New function.

	* src/openvasmd.c (main): Remove --slisten and --sport options. Rename
	--list-users to --get-users. Add --get-scanners options.
	(openvassd_port, scanner_address_string): Remove variables.
	(update_or_rebuild_nvt_cache): Remove scanner address and port
	arguments.
	(rebuild_nvt_cache_retry): Adjust update_or_rebuild_nvt_cache() call.

2014-06-23  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* doc/postgres-HOWTO: Minor hint to avoid confusion.

2014-06-21  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/CMakeLists.txt: Install the special library for pg.

	* doc/postgres-HOWTO: Adjusted so that no manual installation
	is necessary anymore.

2014-06-21  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* CMakeLists.txt: Made variable BACKEND configurable.

	* doc/postgres-HOWTO: Adjusted so that PostgreSQL can be
	configured without need to change CMakeLists.txt.

2014-06-20  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/ompd.c (serve_omp): Never connect to scanner, let caller decide on
	this. Clean-up code and adjust return values.

	* src/openvasmd.c (update_or_rebuild_nvt_cache): Try to connect to
	scanner before serve_omp() call. Free scanner buffers after finish.

2014-06-20  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/scanner.c (openvas_scanner_full, openvas_scanner_close)
	(openvas_scanner_fd_isset, openvas_scanner_fd_set, openvas_scanner_peek)
	(openvas_scanner_get_nfds, openvas_scanner_session_peek)
	(openvas_scanner_connected, openvas_scanner_init)
	(openvas_scanner_set_address): Add functions documentation.
	(openvas_scanner_peek): Always return 1 on success.

2014-06-19  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (lsc_credential_packaged): Adjust to handle encrypted
	credentials case. Move function up in file.
	(modify_lsc_credential): Adjust lsc_credential_packaged() call.

	* src/manage.h: Remove useless prototype.

2014-06-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/postgres-HOWTO: New file.

2014-06-19  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* CMakeLists.txt: Check for libgcrypt presence at configure time.

2014-06-19  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Add per-task Scanner support.

	* src/manage.c (scanner_connect): New function.
	(run_task): Check earlier for config value error. Use task specific
	scanner if present to run the task.
	(stop_task_internal, pause_task, resume_paused_task): Use task specific
	scanner if present for the specified action.
	(stop_task): Check for task stopping support depending on config type.

2014-06-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (add_users): Quote "user" for Postgres.

2014-06-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_group, manage_restore): Use the new group ID
	when moving the group-user relation to/from the trashcan, otherwise the
	users could be attached to the wrong group.

2014-06-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_report_format, delete_group)
	(delete_port_list, manage_restore, manage_empty_trashcan): Delete
	dependent resources first, at least to prevent constraint errors.

2014-06-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_create_sql_functions): Remove ".so" from
	library name, because Postgres adds it.

2014-06-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_create_sql_functions): In iso_time use "FM" in
	strings to prevent leading spaces, add missing "+" before timezone and
	treat the timezone as minutes instead of hundreds.

2014-06-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db_postgres.sql: Correct table name in group_users_trash
	REFERENCES. Add missing columns to targets_trash, report_formats_trash
	and tags_trash.  Change port and type in scanners and scanners_trash to
	integers, because they're treated as integers.

	* doc/db.png: Update from source.

2014-06-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (create_tables): Correct table name in
	group_users_trash REFERENCES.  Add missing columns to targets_trash,
	report_formats_trash and tags_trash.  Change port and type in scanners
	and scanners_trash to integers, because they're treated as integers.

2014-06-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/sql_pg.c (sql_column_int, sql_column_int64): If the column is
	boolean, convert to int.

2014-06-18  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (scanner_type): New function.
	(modify_task_check_config_scanner): Adjust to handle openvas non-default
	scanners.

	* src/manage.h: Add function prototype.

	* src/omp.c (omp_xml_handle_end_element): Adjust checking for scanner
	and config types matching in CREATE_TASK.

2014-06-18  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/openvasmd.c (main), src/manage_sql.c (verify_scanner): Keep port
	value in host order.

	* src/scanner.c (openvas_scanner_set_address): Set port value in network
	order.

2014-06-18  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/ompd.c (serve_omp): Only try to initialize scanner connection when
	in nvt cache mode.

	* src/scanner.c (openvas_scanner_init): Free internal buffers before
	returning error.

2014-06-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (create_tables): Correct column name and add missing
	ssh_port column to targets_trash.

	* doc/db_postgres.sql (targets, targets_trash): Correct name, add
	column.

	* doc/db.png: Update from source.

2014-06-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (copy_port_list): Quote an "end" missed earlier, for
	Postgres.

2014-06-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_setting_iterator): Use sql_select_limit to get
	the LIMIT arg, for Postgres.

2014-06-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (create_tables): Remove explicit references that are
	optional in targets, for now.

2014-06-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_create_sql_functions): Update function list.
	(create_tables): Remove unique constraint from uuid in settings because
	they are only unique per user at the moment.

2014-06-18  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.h (scanner_type_t): Add SCANNER_TYPE_OPENVAS.

	* src/manage_sql.c (verify_scanner): Handle OpenVAS Scanner type
	verification.

2014-06-18  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/ompd.c (serve_omp): Fix scanner sessions preemptive connections
	after scan starting. Fix memory leaks.

	* src/scanner.c (openvas_scanner_reconnect): Remove function.
	(openvas_scanner_free): New function.

	* src/scanner.h: Add and remove function prototypes.

2014-06-18  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/ompd.c (session_clean): New function.
	(serve_omp): Free the client session buffers without closing it as it
	may still be in use by the parent process.

2014-06-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_create_sql_functions): Correct schema name in
	table check.

2014-06-17  Matthew Mundell <matthew.mundell@greenbone.net>

	Add Postgres SQL functions "severity_in_level" and "severity_to_level".

	* src/manage_pg.c (manage_session_init): New function.  Creates
	temporary table for storing session info.  Automatically removed at end
	of session.
	(manage_create_sql_functions): Add "severity_in_level" and
	"severity_to_level".
	(create_tables): Add current_credentials so that the table exists when
	functions that refer to it are created.  The temporary tables will be
	used instead.

	* src/manage_sql.h (manage_session_init): New header.

	* src/manage_sql.c (authenticate): Call session init to store user uuid.

	* src/manage_sqlite3.c (manage_session_init): New function.  Dummy.

2014-06-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_create_sql_functions): Only create function
	resource_name if the tables exist, because it uses tables.  Add pl/pgsql
	function "uniquify".

2014-06-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (copy_task): Remove another use of tasks column time.
	(delete_task): Delete task after resources that refer to task.

2014-06-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_port_range, port_list_is_predefined): Quote
	UUIDs with single quote in SQL, for consistency and Postgres.

2014-06-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (PORT_LIST_ITERATOR_COLUMNS)
	(PORT_LIST_ITERATOR_TRASH_COLUMNS): Quote end in SQL for Postgres.

2014-06-17  Matthew Mundell <matthew.mundell@greenbone.net>

	Handle integer columns in Postgres sql_column_text.

	* src/sql_pg.c (struct sql_stmt): Add store.
	(sql_stmt_store): New function.
	(sql_finalize, sql_reset): Free store.
	(sql_column_text): Correct return in doc.  If the column is actually an
	int then convert it to a string, to match SQLite behaviour.  Store the
	return in the sql_stmt_t, so that it is freed with the statement.
	(sql_column_int, sql_column_int64): Correct return in doc.

2014-06-17  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (make_result): Check for the provided NVT's presence
	in the DB. Fix function documentation.
	(report_add_result): Add function parameters values check.

2014-06-17  Matthew Mundell <matthew.mundell@greenbone.net>

	Remove last use of tasks column "time".

	* src/manage_sql.c (make_task): Remove time argument, column is not
	used.  Update caller.

	* src/manage.h: Update header accordingly.

	* src/manage_sqlite3.c (create_tables): Add note about time column.

	* src/omp.c (omp_xml_handle_start_element): Update make_task call.

2014-06-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_port_name, setting_severity)
	(setting_dynamic_severity): Use Postgres friendly syntax for LIMIT.
	Also consistent with rest of code.

2014-06-17  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/sql_pg.c (sql_column_double, sql_column_text, sql_column_int)
	(sql_column_int64): Add NULL checks.

2014-06-17  Matthew Mundell <matthew.mundell@greenbone.net>

	Add server side Postgres function "resource_name".  Move some functions
	to new file manage_utils.c to make linking the Postgres shared library
	easier.

	* CMakeLists.txt: Improve regex used to hack PostgreSQL_INCLUDE_DIRS.
	Use pg_config to setup POSTGRESQL_SERVER_CFLAGS.

	* src/CMakeLists.txt: Add shared library manage-pg-server, for server
	side functions.  Add manage_utils.c.

	* src/manage_pg.c (manage_create_sql_functions): Create server side
	"resource_name".

	* src/manage_pg_server.c: New file.  Postgres server side functions.

	* src/manage_utils.c, src/manage_utils.h: New files.  Self-contained
	manage functions.

	* src/manage.c (next_time): Remove.  Now in manage_utils.c.

	* src/manage.h: Remove header accordingly.

	* src/manage_sql.c (MONTHS_WITHIN_YEAR, months_between)
	(add_months): Remove.  Now in manage_utils.c.

	* src/manage_sql.h: Update headers accordingly.

	* src/manage_sqlite3.c: Include manage_utils.h.

2014-06-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_create_sql_functions): Add resource_name.

2014-06-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_acl.h (USER_MAY): Make the column a comparison so that the
	result is boolean.  Use id instead of ROWID.  Quote with " instead of `.
	Quote user too.  All for Postgres.

	* src/manage_sql.c (init_port_range_iterator): Quote end, and cast
	integer terms to boolean, for Postgres.

2014-06-16  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/scanner.c (openvas_scanner_write): Don't send CERTIFICATES and GO
	ON otp commands as they are ignored by the scanner.

2014-06-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/sql_pg.c (log_notice): New function.
	(sql_open): Divert NOTICE messages to log.

2014-06-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (create_tables): Add qod to results.

	* doc/db_postgres.sql (results): Add qod.

	* doc/db.png: Update from source.

2014-06-16  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/ompd.c (scanner_address): Remove variable.

	* src/openvasmd.c: Include scanner.h. Use new
	openvas_scanner_set_address() call instead of directly accessing
	scanner_address variable.

	* src/scanner.c (openvas_scanner_address): New variable.
	(openvas_scanner_write): Use new variable instead of scanner_address.
	(openvas_scanner_set_address): New function.

	* src/scanner.h: Add new function prototype.

2014-06-13  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Remove preemptive Scanner connecting. Connect only on NVT cache update
	or task starting, resuming, pausing and stopping.

	* src/manage.c (run_task, stop_task_internal, pause_task)
	(resume_paused_task): Try to initialize a connection with the scanner
	when not connected already.

	* src/ompd.c (serve_omp): Connect only in nvt cache update. Call
	openvas_scanner_init() accordingly and adjust loop for scan handler
	forked process.

	* src/scanner.c (openvas_scanner_connect): Call init_otp_data().
	(openvas_scanner_init): Handle openvas_scanner_write() returning an
	error value.

2014-06-13  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/ompd.c (serve_omp): Refactor code. Remove redundant check for
	scanner being dead.

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

	Add Quality of Detection storage to results.  Hence increase database
	version to 128.  Add database migration from version 127 to 128.

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

	* src/manage_migrators.c (migrate_127_to_128): New function.
	(database_migrators): Add migrate_127_to_128.

	* src/manage_sql.c (check_db_tasks): Init example result QOD.
	(make_result): Set QOD of result, according to remote_banner_unreliable
	tag.
	(create_report): Init result QODs.

	* src/manage_sqlite3.c (create_tables): Add qod to results.

	* doc/db.png: Update for version change.

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

	* src/ompd.c (FD_CLIENT_READ, FD_CLIENT_WRITE, FD_SCANNER_READ)
	(FD_SCANNER_READ, FD_SCANNER_WRITE): Remove constants.
	(serve_omp): Replace redundant constants usage with adequate fd_set
	checks.

2014-06-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Separate init for command options like --create-user into new function,
	otherwise these options affect active tasks.

	* src/manage_sql.c (manage_encrypt_all_credentials): Init with
	init_manage_helper, to ensure the database is up to date.
	(init_manage_process): Improve doc slightly.
	(init_manage_internal): New function.  Body from init_manage.  Add
	summary of init cases and stop_tasks arg.
	(init_manage): Call init_manage_internal.
	(init_manage_helper): New function.
	(manage_create_user, manage_delete_user, manage_list_users)
	(manage_set_password): Call init_manage_helper instead of init_manage,
	which stops active tasks.

	* src/manage.h: Update headers accordingly.

	* src/openvasmd.c (main): Handle new returns from encrypt and decrypt
	functions.

2014-06-11  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c (scanner_up): Remove variable.
	(run_task, stop_task_internal, pause_task, resume_paused_task): Use
	openvas_scanner_connected() instead of directly checking scanner_up
	value.

	* src/manage.h: Remove variable declaration.

	* src/omp.c (scanner_is_up): Remove function.

	* src/ompd.c (serve_omp): Remove scanner_up and scanner_is_up() usage
	and use openvas_scanner_connected() accordingly.

	* src/scanner.c (openvas_scanner_read, openvas_scanner_write)
	(openvas_scanner_wait, openvas_scanner_close, openvas_scanner_fd_isset)
	(openvas_scanner_fd_set, openvas_scanner_peek)
	(openvas_scanner_session_peek): Add checks for when the scanner isn't
	connected.
	(openvas_scanner_connected, openvas_scanner_init): New functions.

	* src/scanner.h: Add new functions prototypes.

2014-06-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/proto_postgres.sql: Remove.  Old prototype.

2014-06-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (create_config): Remove leftover
	RCFILE element and example.
	(create_task): Remove description of RCFILE option.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-06-10  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/otp.h: Fix build on opensuse due to missing argument in
	process_otp_scanner_input() prototype.

2014-06-10  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/scanner.h: Fix openvas_scanner_write() prototype.

2014-06-10  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/scanner.c, src/scanner.h: New files.
	(openvas_scanner_write): Add argument for nvt cache mode.
	(openvas_scanner_buf_filled): New function.

	* src/ompd.c: Move openvas_scanner and related variables to scanner.c.
	Include scanner.h
	(serve_omp): Adjust for new and modified functions usage.

	* src/CMakeLists.txt: Add scanner.c to build process.

2014-06-10  Matthew Mundell <matthew.mundell@greenbone.net>

	Add support for multiple "To" addresses in Alerts.

	* src/manage_sql.c (validate_email): Make static.
	(validate_email_list): New function.
	(create_alert, modify_alert): Validate "to_address" as list.

2014-06-09  Matthew Mundell <matthew.mundell@greenbone.net>

	Make report form "Verinice ISM" predefined.

	* src/manage_sql.c (check_db_report_formats)
	(format_predefined): Add Verinice ISM.

	* CMakeLists.txt: Install Verinice ISM.

2014-06-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/Verinice_ISM/create_report_import: Remove.

	* src/report_formats/Verinice_ISM/gsm_verinice_ism.xsl: Remove.  Now
	Verinice_ISM.xsl.

	* src/report_formats/Verinice_ISM/Verinice_ISM.xsl: New file.  Was
	gsm_verinice_ism.xsl.

2014-06-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* report_formats/verinice-ism: Remove.  Now in src/report_formats.

	* src/report_formats/Verinice_ISM: New directory.  Was
	report_formats/verinice-ism.

2014-06-09  Matthew Mundell <matthew.mundell@greenbone.net>

	Use new resource UUID when copying permissions in copy_task.  Hence
	increase database version to 127.  Add database migration from version
	126 to 127.

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

	* src/manage_migrators.c (migrate_126_to_127): New function.
	(database_migrators): Add migrate_126_to_127.

	* src/manage_sql.c (copy_task): Use UUID of new task instead of old task
	when copying permissions.

	* doc/db.png: Update for version change.

2014-06-09  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/ompd.c (openvas_scanner_wait, serve_omp): Remove handling of
	unused out-of-band data.

2014-06-09  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/ompd.c (openvas_scanner_fd_isset, openvas_scanner_fd_set)
	(openvas_scanner_peek, openvas_scanner_nfds_from_socket)
	(openvas_scanner_session_peek): New functions.
	(serve_omp): Use new functions instead of directly accessing the
	openvas_scanner variables. Don't check scanner socket for out-of-band
	data as none is sent by the scanner.

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

	* src/ompd.c (read_from_server): Rename to openvas_scanner_read. Adjust
	to use shared current scanner connection variables.
	(recreate_session): Remove function.
	(openvas_scanner_close): Add return code for success or error.
	(openvas_scanner_reconnect): New function.
	(serve_omp): Use openvas_scanner helper functions where possible instead
	of accessing the connection variables directly. Adjust to call new and
	renamed functions.

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

	* src/ompd.c (openvas_scanner_session, openvas_scanner_socket)
	(openvas_scanner_credentials): New variables for the currently connected
	to scanner.
	(write_to_scanner): Rename to openvas_scanner_write. Adjust for using
	new scanner variables.
	(wait_for_connection): Rename to openvas_scanner_wait. Adjust for using
	new scanner variables.
	(openvas_scanner_close): New function.
	(openvas_scanner_connect): Use new variables.
	(serve_omp): Adjust modified functions calls and use new variables
	accordingly.

2014-06-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (create_tables): Add missing tags columns.

	* doc/db_postgres.sql (tags): Add missing tags columns.

	* doc/db.png: Update from source.

2014-06-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_create_sql_functions): Check if permissions
	table exists before trying to create user_can_everything, which requires
	the table.

2014-06-05  Matthew Mundell <matthew.mundell at greenbone.net>

	Add group_concat to Postgres.

	* src/manage_pg.c (manage_create_sql_functions): Add aggregate
	"group_concat".

	* src/manage_sql.c (group_users, role_users)
	(USER_ITERATOR_COLUMNS): Group by name, because Posgres requires a GROUP
	BY clause for any table column used in an aggregate in the SELECT
	columns.

2014-06-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (filter_clause, prognosis_order_by)
	(init_result_iterator): Remove conversion to lowercase in ORDER BY,
	for now, because Postgres does not allow named SELECT columns in
	expressions in ORDER BY.

2014-06-05  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/ompd.c: Add include. Fixes build on some environments.

	* src/openvasmd.c: Remove unused include.

2014-06-05  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/ompd.c (load_cas): New function. Moved from openvasmd.c
	(openvas_scanner_connect): New function.
	(serve_omp): Remove scanner_session, scanner_credentials and
	scanner_socket_addr function parameters. Create scanner session by
	calling openvas_scanner_connect() and adjust accordingly.

	* src/openvasmd.c (serve_client, update_or_rebuild_nvt_cache): Update
	for serve_omp() call change.

2014-06-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_acl.c (where_owned): Use "t ()" instead of 1 in SQL, to
	support both backends.

2014-06-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (count): Use a subselect to prevent having regular
	columns alongside the "count" aggregate in the result columns, for
	Postgres.

2014-06-04  Matthew Mundell <matthew.mundell@greenbone.net>

	Use function for LIMIT arg in SQL, to cater for both backend syntaxes.

	* src/manage_sql.c (init_get_iterator): Use sql_select_limit to provide
	LIMIT arg.

	* src/sql_sqlite3.c, src/sql_pg.c (sql_select_limit): New function.

	* src/sql.h: Add header accordingly.

2014-06-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (setting_count, init_setting_iterator): Use = instead
	of == in SQL, for Postgres.

2014-06-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_acl.c, src/manage_sql.c: Quote Postgres reserved words in
	SQL.

2014-06-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_create_sql_functions): Add dummies for
	task_severity, task_threat_level and task_trend.  Add run_status_name
	and user_can_everything.

2014-06-04  Matthew Mundell <matthew.mundell@greenbone.net>

	Add missing Postgres tables and columns.

	* src/manage_pg.c (create_tables): Add missing fields to schedules.
	Add scanners and scanners_trash.  Move scanner up in tasks.

	* doc/db_postgres.sql (tasks): Move scanner up.
	(schedules, schedules_trash): Add missing fields.

	* doc/db.png: Update from source.

2014-06-04  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.h: Add function prototype.

	* src/omp.c (omp_xml_handle_end_element): Send config type value in
	CLIENT_GET_TASKS case.

2014-06-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (create_tables): Use bigint for the type_min and
	type_max columns, because they may contain LLONG_MAX and LLONG_MIN.

2014-06-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Remove use of the "parse_time" SQL function, except in the SQLite3
	migrators.

	* src/manage_sql.c (tag_value, parse_time): New functions.  Bodies from
	manage_sqlite3.c.
	(make_nvt_from_nvti): Extract and parse date tags in C instead of via
	SQL functions.

	* src/manage_sqlite3.c (sql_parse_time, sql_tag): Call new manage_sql.c
	functions to do the work.

2014-06-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_nvt_preferences_enable): Correct name.

2014-06-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Get truth with a dedicated SQL function.

	* src/manage_sql.c (init_get_iterator): Use "t ()" to get truth value,
	because SQLite3 uses 1 and Postgres uses "true".

	* src/manage_sqlite3.c (sql_t): New function.
	(manage_create_sql_functions): Create "t".

	* src/manage_pg.c (manage_create_sql_functions): Create "t".

2014-06-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_create_sql_functions): Add "tag".

2014-06-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (set_nvts_feed_version)
	(manage_nvt_preferences_enable): DELETE then INSERT instead of using
	INSERT OR REPLACE, for Postgres.

2014-06-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Adjust SQL slightly for Postgres compatibility.

	* src/manage_sql.c (filter_clause): Use "lower" instead of COLLATE
	NOCASE.
	(cleanup_tables, prognosis_order_by): Quote "user" in SQL, for Postgres.
	(task_severity, init_asset_iterator, report_scan_result_count)
	(report_severity_data, filtered_host_count, note_count)
	(init_note_iterator, override_count, init_override_iterator): Use single
	instead of double quotes in SQL.
	(report_add_result): Remove "OR IGNORE" because the previous statement
	checks if the row exists.  Quote "user".  Use single quotes.
	(init_result_iterator): Use single quotes.  Use "lower" instead of
	COLLATE NOCASE.

2014-06-02  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Fix errors found when building with Clang 3.4

	* src/manage_sql.c (alive_test_from_string): Change return value to int
	as -1 is returned on error.
	(create_target, modify_target): Adjust variable type for
	alive_test_from_string() change.

	* src/omp.c (omp_xml_handle_end_element): Fix variables use before
	initialization error.

2014-06-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (create_tables): Correct column name in targets.
	Remove explicit references that are optional in tasks, for now.

2014-06-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_user_set_role, report_add_result)
	(report_add_result, report_scan_result_count, report_counts_cache_exists)
	(report_counts_from_cache, cache_report_counts, copy_user, delete_user)
	(delete_user, modify_user, modify_user, trash_user_writable)
	(init_user_group_iterator, init_user_role_iterator): Quote "user" in SQL
	because it is reserved in Postgres.

2014-06-02  Hani Benhabiles  <hani.benhabiles@greenbone.net>

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

	* src/manage.h: Add function prototypes.

	* src/omp.c (omp_xml_handle_end_element): In MODIFY_TASK case, check
	that the specified config's type matches the scanner set for the task.

2014-05-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_create_sql_functions): Add make_uuid.

2014-05-30  Matthew Mundell <matthew.mundell@greenbone.net>

	Quote keyword "end" in SQL, for Postgres.

	* src/manage_migrators.c (MIGRATE_55_TO_56_RANGE)
	(migrate_55_to_56): Quote keyword "end" in SQL.

	* 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 (RANGE): Quote keyword
	"end" in SQL.

	* src/manage_migrators.c (RANGE, check_db_port_lists)
	(create_port_list_lock, copy_port_list, create_port_range)
	(delete_port_list, manage_restore): Quote keyword "end" in SQL.

2014-05-30  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (set_task_hosts_ordering, set_task_parameter): Quote
	strings before insertion.

2014-05-30  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c (task_scanner_options): Encode OSP file options before
	storing them.

2014-05-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (check_db_port_lists, report_severity)
	(create_schedule, modify_schedule):  Replace "now" with "m_now" in SQL.

	* src/manage_migrators.c (migrate_104_to_105): Replace "now" with
	"m_now" in SQL.

2014-05-30  Matthew Mundell <matthew.mundell@greenbone.net>

	Remove explicit control of the IDs of the Full and * configs, because
	this interferes with the autoincrement of the ID in Postgres.  All other
	configs specify only the UUID anyway.

	* src/manage_sql.c (check_db_configs): Let database insert IDs.
	(config_in_use): Check all by UUID.

	* src/manage_migrators.c (CONFIG_ID_FULL_AND_FAST)
	(CONFIG_ID_FULL_AND_FAST_ULTIMATE, CONFIG_ID_FULL_AND_VERY_DEEP)
	(CONFIG_ID_FULL_AND_VERY_DEEP_ULTIMATE): Remove.  Now in
	manage_migrators.c.

	* src/manage_migrators.c (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.  From
	manage_sql.h.  Old IDs used only here.

2014-05-30  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* tools/greenbone-certdata-sync, tools/greenbone-scapdata-sync:
	Fix URL of feed home.

2014-05-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c: Neaten line ends in defines.

2014-05-29  Matthew Mundell <matthew.mundell@greenbone.net>

	Rename SQL function "now" to "m_now" to avoid conflict with Postgres
	"now".  Add Postgres "m_now".

	* src/manage_pg.c (manage_create_sql_functions): Neaten "iso_time".  Add
	"m_now".

	* src/manage_sqlite3.c (manage_create_sql_functions): Rename "now" to
	"m_now".

	* src/manage_config_discovery.c, src/manage_config_host_discovery.c,
	src/manage_config_system_discovery.c, src/manage_migrators.c,
	src/manage_sql.c: Use "m_now" instead of "now" in SQL.

2014-05-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_pg.c (manage_create_sql_functions): Add iso_time.
	(create_tables): Switch dates to integers because dates are treated as
	seconds since the epoch.

2014-05-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (nvt_selector_family_count): Use "IS NOT NULL" like
	everywhere else.

2014-05-29  Matthew Mundell <matthew.mundell@greenbone.net>

	Hide a REINDEX from Postgres for now.

	* src/manage_sql.c (refresh_nvt_cves): Hide REINDEX.

	* src/sql_pg.c, src/sql_sqlite3.c (sql_is_sqlite3): New function.

	* src/sql.h: Add header accordingly.

2014-05-29  Matthew Mundell <matthew.mundell@greenbone.net>

	Add new function for inserting and retrieving row ID in one call.

	* src/sql_pg.c, src/sql_sqlite3.c (sqli): New function.

	* src/sql.h: Add header accordingly.

	* src/sql.c (sqlv, sql_x): Remove static as these are now used in the
	backends.

	* src/manage_sql.c (check_db_configs): Insert with sqli in order to get
	ID of inserted row, because sql_last_insert_row seems gets the ID of a
	previous row.

2014-05-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_config_discovery.c, src/manage_config_host_discovery.c,
	src/manage_config_system_discovery.c, src/manage_migrators.c,
	src/manage_ranges_all_tcp_nmap_5_51_top_1000.c,
	src/manage_ranges_all_tcp_nmap_5_51_top_100.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: Start transactions via
	SQL interface.

2014-05-29  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (make_config_osp_ovaldi): name definitions preference
	as definitions_file.
	(config_in_use): Check OSP Ovaldi config too.

	* src/omp.c (omp_xml_handle_end_element): Adjust GET_CONFIGS when
	sending OSP config preferences for osp_file type.

2014-05-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/sql_pg.c (bind_param): Correct doc.
	(sql_column_int, sql_column_int64): Remove breaks for consistency.

2014-05-29  Matthew Mundell <matthew.mundell@greenbone.net>

	Create transactions via SQL interface.

	* src/sql_sqlite3.c, src/sql_pg.c (sql_begin_exclusive)
	(sql_begin_exclusive_giveup, sql_begin_immediate): New functions.

	* src/sql.h: Add headers accordingly.

	* src/manage_sql.c: Use sql_begin_* instead of calling BEGIN directly.

2014-05-28  Matthew Mundell <matthew.mundell@greenbone.net>

	Add Postgres SQL layer and table creation.

	* CMakeLists.txt: Add BACKEND variable which controls whether SQLite3 or
	PostgreSQL is compiled.

	* src/CMakeLists.txt: Set compile and link options according to BACKEND.

	* src/sql_sqlite3.c (task_db): Initialise so that sql_is_open always
	works.
	(sql_schema): New function.

	* src/sql.h: Add header accordingly.

	* src/manage_migrators.c (migrate_75_to_76): Use sql_schema to get
	main schema.

	* src/manage_sql.c (create_tables): Remove.  Now in manage_sqlite3.c.
	(set_db_version): DELETE then INSERT to avoid OR REPLACE.  Use
	sql_schema.
	(manage_db_version, manage_update_nvti_cache, check_db_versions)
	(check_db_nvts, nvts_feed_version, set_nvts_feed_version)
	(manage_nvt_preferences_enable): Use sql_schema.
	(check_db): Add progress call removed from create_tables.

	* src/manage_sqlite.c (create_tables): New function.  From manage_sql.c.
	Remove progress call.

	* src/manage_pg.c, src/sql_pg.c: New files.

	* doc/db_postgres.sql: Format like SQL in C code.  Replace booleans with
	integers.  Add missing ID columns.

	* doc/db.png: Update from source.

2014-05-27  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/manage_sql.c (modify_setting): Added Chinese as allowed
	value for interface language.

2014-05-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/sql_sqlite3.c (sql_prepare_internal): Set stmt even in
	sqlite3_prepare error return case, to match previous behaviour.
	(sql_finalize): Add NULL check before sqlite3_finalize, in case the
	caller's prepare timed out in sql_prepare_internal.

2014-05-27  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Add new OMP command GET_AGGREGATES.

	* src/manage_sql.c (init_aggregate_iterator, aggregate_iterator_count)
	(aggregate_iterator_min, aggregate_iterator_max)
	(aggregate_iterator_mean, aggregate_iterator_sum)
	(aggregate_iterator_value, type_columns, type_filter_columns)
	(type_trash_columns): New functions.

	* src/manage.h (init_aggregate_iterator, aggregate_iterator_count)
	(aggregate_iterator_min, aggregate_iterator_max)
	(aggregate_iterator_mean, aggregate_iterator_sum)
	(aggregate_iterator_value, type_columns, type_filter_columns)
	(type_trash_columns): New function prototypes.

	* src/omp.c (get_aggregates_data_t): New typedef.
	(get_aggregates_data_reset): New function.
	(command_data_t): Add get_aggregates.
	(get_aggregates_data): New variable for GET_AGGREGATES callback data.
	(client_state_t): Add CLIENT_GET_AGGREGATES.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add cases
	for GET_AGGREGATES command.

	* src/schema_formats/XML/OMP.xml (get_aggregates): New command.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-05-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_acl.c, src/manage_config_discovery.c,
	src/manage_config_host_discovery.c,
	src/manage_config_system_discovery.c, src/manage_migrators.c,
	src/manage_sql.c: In SQL use "id" instead of SQLite3 specific "ROWID".

2014-05-26  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c (run_task, stop_task, pause_task): Don't try to resume,
	stop or pause task if using an OSP scanner.
	(omp_xml_handle_end_element): Handle new return values for run_task(),
	stop_task() and pause_task().

2014-05-23  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c (parse_osp_report): Parse the OSP scan report's results
	and insert them accordingly..
	(fork_osp_scan_handler): Adjust log message. Set the task and report
	states adequately. Set retry limits when waiting for scan to finish.

2014-05-22  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Further OSP scans handling improvmnets.

	* src/manage.c (parse_osp_report, fork_osp_scan_handler): New functions.
	(run_osp_task):
	(threat_message_type, message_type_threat): Handle Error Message case.

	* src/manage_sql.c (collate_message_type): Handle Error Message case.
	(set_scan_start_time_epoch, set_scan_end_time_epoch): New functions.

	* src/manage.h: Add functions prototypes.

2014-05-22  Matthew Mundell <matthew.mundell@greenbone.net>

	Use numbers instead of names to specify bind locations in SQL.

	* src/manage_migrators.c (migrate_19_to_20): Use number instead of name
	in SQL.

	* src/manage_sql.c (init_prognosis_iterator, report_severity_data)
	(create_agent): Use numbers instead of names in SQL.

2014-05-22  Matthew Mundell <matthew.mundell@greenbone.net>

	Remove description from tasks table.  Hence increase database version to
	126.  Add database migration from version 125 to 126.

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

	* src/manage_migrators.c (migrate_125_to_126): New function.
	(database_migrators): Add migrate_125_to_126.

	* src/manage_sql.c (create_tables): Remove description from tasks.

	* doc/db.png: Update for version change.

2014-05-21  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_ql.c (create_port_list): Don't specify port_list value in
	resource_with_name_exists() call.

2014-05-21  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c (severity_matches_type, rc_preference): Remove unused
	functions.

	* src/manage_sql.c (tag_iterator_resource): Remove unused function.

	* src/manage.h: Remove unused functions prototypes.

2014-05-21  Matthew Mundell <matthew.mundell@greenbone.net>

	Remove openvasrc file support from OMP.

	* src/omp.c (create_config_data_t, create_config_data_reset)
	(get_tasks_data_t, modify_task_data_t, modify_task_data_reset): Remove
	rcfile handling.
	(client_state_t): Remove RCFILE entries.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Remove "rcfile" attribute from GET_TASKS.  Remove
	RCFILE from MODIFY_TASK, CREATE_CONFIG and CREATE_TASK.  Remove RCFILE
	from GET_TASKS response.

	* src/manage_sql.c (task_description, set_task_description)
	(make_task_rcfile, add_task_description_line, set_target_hosts)
	(config_preference, clude, insert_rc_into_config, create_config_rc)
	(nvt_selector_nvts_growing): Remove.  Out of use.
	(set_task_parameter): Remove "RCFILE" parameter.

	* src/manage.h: Remove headers accordingly.

	* src/schema_formats/XML/OMP.xml (create_config, create_task, get_tasks)
	(modify_task): Remove RC elements and attributes.  Add CHANGEs
	accordingly.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-05-21  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (make_task_rcfile): Don't create the rcfile for tasks
	using a different scanner as it is not used.

	* src/omp.c (omp_xml_handle_end_element): In CREATE_TASK, check that
	specified config and scanner types for the task match.

	* src/manage.h: Add function prototype.

2014-05-21  Matthew Mundell <matthew.mundell@greenbone.net>

	Make sql_stmt_t opaque, to remove last of SQLite from SQL interface.

	* src/sql.h: Remove SQLite include.
	(sql_stmt_t): Use opaque type.

	* src/sql_sqlite3.c (struct sql_stmt): New struct.
	(sql_prepare_internal): Allocate and setup new struct.
	(sql_exec_internal, iterator_null, iterator_column_name)
	(iterator_column_count, sql_bind_blob, sql_bind_int64, sql_bind_double)
	(sql_bind_text, sql_finalize, sql_reset, sql_column_double)
	(sql_column_text, sql_column_int, sql_column_int64): Get statement from
	struct.

	* src/manage_sqlite3.c: Include sqlite3.h.

2014-05-20  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In MODIFY_TASK, set scanner to
	default value, if provided scanner id value is 0.

2014-05-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (report_severity_data): Format SQL better.

2014-05-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* ChangeLog: Remove extra entry introduced 2014-03-14 in r18988.

2014-05-21  Matthew Mundell <matthew.mundell@greenbone.net>

	Remove task_db from SQL interface.

	* src/sql.h (task_db): Remove.  No longer used in interface.
	(sql_is_open, sql_close_fork): New functions.

	* src/sql.c (sql_is_open, sql_close_fork): New functions.

	* src/manage_sql.c (init_manage_process, cleanup_manage_process)
	(manage_cleanup_process_error): Use new interface functions instead
	of accessing task_db directly.

	* src/manage_sqlite3.c (task_db): New header.  Was in sql.h.

2014-05-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db_postgres.sql: Make all id columns of type SERIAL.

	* doc/db.png: Update from source.

2014-05-20  Matthew Mundell <matthew.mundell@greenbone.net>

	Move SQLite specific code in the SQL library to a separate file.

	* src/sql.c (DB_CHUNK_SIZE, task_db, sql_open, sql_close, sql_changes)
	(sql_last_insert_rowid, sql_prepare_internal, sql_exec_internal)
	(iterator_null, iterator_column_name, iterator_column_count)
	(sql_bind_blob, sql_bind_int64, sql_bind_double, sql_bind_text)
	(sql_finalize, sql_reset, sql_column_double, sql_column_text)
	(sql_column_int, sql_column_int64): Remove.  Now in sql_sqlite3.c.  Add
	headers for internal functions.

	* src/sql_sqlite3.c: New file.

	* src/CMakeLists.txt: Add sql_sqlite3.c.

2014-05-20  Matthew Mundell <matthew.mundell@greenbone.net>

	Isolate SQLite calls in SQL library: sqlite3_column_int and
	sqlite3_column_int64.

	* src/sql.c (sql_int, sql_int64, iterator_int, iterator_int64): Use new
	functions.
	(sql_column_int, sql_column_int64): New functions.

	* src/sql.h: Add headers accordingly.

2014-05-20  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (manage_set_config_families): Don't set families
	for OSP configs as they are not used.

2014-05-20  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (config_type, config_iterator_type): New functions.
	(copy_config, update_config_cache): Adjust for config type.
	(CONFIG_ITERATOR_COLUMNS, CONFIG_ITERATOR_TRASH_COLUMNS): Add type
	column.

	* src/manage.h: Add function prototype.

	* src/omp.c (omp_xml_handle_end_element): Adjust GET_CONFIGS case to
	send config type value. Adjust accordingly.

2014-05-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/sql.c (sql, sql_error, sql_giveup): Remove error warning, because
	the internal functions have the same warning.

2014-05-20  Matthew Mundell <matthew.mundell@greenbone.net>

	Isolate SQLite calls in SQL library: sqlite3_step.

	* src/sql.c (sql_exec_internal): New function.  Based on sql_exec.
	(sqlv, sql_quiet, sql_x_internal, next, sql_exec): Use
	sql_exec_internal instead of doing the sqlite3_exec by hand.

2014-05-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (authenticate): Move comment into block it applies
	to.

	* src/sql.c (init_iterator): Use sql_stmt_t instead of sqlite3_stmt.

2014-05-20  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (copy_config): Copy config type column too.

2014-05-20  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (make_config_osp_ovaldi, check_db_configs)
	(create_config, create_config_rc, delete_config, manage_restore): Insert
	value for config type column.

2014-05-20  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c (task_scanner_options): Get options from the task's
	config preferences.

	* src/manage.h: Add function prototypes.

	* src/manage_sql.c (make_config_osp_ovaldi): New function.
	(check_db_configs): Check for osp ovaldi default config.
	(init_preference_iterator, preference_iterator_name)
	(preference_iterator_value): Export functions.

	* src/manage_sql.h (CONFIG_UUID_OSP_OVALDI): New config UUID value.

2014-05-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_lsc_credential): Remove extra argument that
	corresponded to public key before 2014-05-06.

2014-05-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Isolate SQLite calls in SQL library: sqlite3_prepare.

	* src/sql.c (sql_prepare_internal): New function.  Based on sql_prepare.
	(sqlv, sql_quiet, sql_x_internal, init_iterator, sql_prepare): Use
	sql_prepare_internal instead of doing the sqlite3_prepare by hand.
	(sql_x, sql_x_quiet, sql_double, sql_int, sql_string, sql_string_quiet)
	(sql_int64): Use sql_stmt_t instead of sqlite3_stmt.

2014-05-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Move collation and SQL function creation into new SQLite specific file,
	because these use many "manage" functions.

	* src/CMakeLists.txt: Add manage_sqlite3.c.

	* src/manage_sqlite3.c: New file.  Code from sql.c.

	* src/manage_sql.c (init_manage_process): Adjust name of functions.

	* src/manage_migrators.c (migrate_51_to_52): Adjust name of function.

	* src/sql.c: Remove all functions that setup collation and SQL
	functions.  Now in manage_sqlite3.c.  Some are generic, but some call
	functions that are part of manage_sql.c, and it's easier to group them
	together.

	* src/sql.h: Update headers accordingly.

2014-05-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/sql.c: Use sql_finalize, sql_column_double and sql_column_text in
	more places.

2014-05-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Use sql_stmt_t in more places.

	* src/sql.h (sql_stmt_t): Move up in file.
	(iterator_t): Use sql_stmt_t.

	* src/sql.c (sql_prepare): Move into Prepared statements section.
	Change return type to sql_stmt_t.
	(init_prepared_iterator): Match arg to header.

2014-05-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Move resource_t and iterator_t to SQL library.

	* src/sql.h: Remove manage.h include because this sould be a plain SQL
	interface.
	(resource_t, iterator_t): New type.  Were in manage.h.

	* src/manage.h: Include sql.h for resource_t and iterator_t.  Remove
	sqlite3.h now that all SQLite code is in sql.c.
	(resource_t, iterator_t): Remove.  Now in sql.h because they are part of
	the SQL interface.

	* src/sql.c: Include manage.h which was being included in sql.h, because
	there are still manager calls in here.

2014-05-19  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c (task_scanner_options, run_osp_task): New functions.
	(run_task): Call run_osp_task() if task has a scanner specified.

	* src/manage_sql.c (scanner_host, scanner_port): New functions.

	* src/manage.h: Add functions prototypes.

	* src/omp.c (omp_xml_handle_end_element): Handle run_task() returning -1
	value.

	* src/openvasmd.c (scanner_port): Change variable name to
	openvassd_port.

2014-05-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/sql.h (sql_make_uuid, sql_hosts_contains, sql_clean_hosts)
	(sql_uniquify, sql_iso_time, sql_parse_time, sql_next_time, sql_now)
	(sql_tag, sql_max_hosts, sql_common_cve, sql_current_offset)
	(sql_report_progress, sql_report_severity, sql_report_severity_count)
	(sql_task_severity, sql_severity_matches_ov, sql_severity_to_level)
	(sql_severity_to_type, sql_task_trend, sql_threat_level, sql_regexp)
	(sql_run_status_name, sql_resource_name, sql_resource_exists)
	(sql_severity_in_level, sql_user_can_everything): Remove.  Now used in
	sql.c only.
	(sql_prepare): Move to Prepared statements.
	(init_prepared_iterator): Use sql_stmt_t.

2014-05-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c: Remove SQLite include because all SQLite code is in
	SQL library now.

2014-05-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Move SQLite calls into SQL library: migrator SQL function creation.

	* src/sql.c (migrate_51_to_52_sql_convert): New function.  From
	manage_migrators.c.
	(sql_create_migrate_51_to_52_convert): New function.

	* src/sql.h: Add header accordingly.

	* src/manage_migrators.c (migrate_51_to_52_convert): Remove.  Now in
	sql.c.
	(migrate_51_to_52): Let SQL lib create "convert".

2014-05-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Move SQLite calls into SQL library: sql_column_double and
	sql_column_text.

	* src/sql.c (sql_column_double, sql_column_text): New functions.

	* src/sql.h: Add headers accordingly.

	* src/manage_sql.c (report_severity_data): Replace sqlite3_column_double
	and sqlite3_column_text with sql_column_double and sql_column_text.

2014-05-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Move SQLite calls into SQL library: sqlite3_clear_bindings.

	* src/sql.c (sql_reset): Clear bindings before reset.  This was only
	done before one of the sql_reset callers, but is safe to do always.

	* src/manage_sql.c (init_prognosis_iterator): Remove
	sqlite3_clear_bindings.  Now done in sql_reset.

2014-05-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Move SQLite calls into SQL library: sqlite3_reset.

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

	* src/sql.h: Add header accordingly.

	* src/manage_sql.c: Replace sqlite3_reset with sql_reset.

2014-05-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Move SQLite specifics into SQL library: sqlite3_stmt.

	* src/sql.c: Use sql_stmt_t instead of sqlite3_stmt in interface
	functions.

	* src/sql.h: Update headers accordingly.
	(sql_stmt_t): New type.

	* src/manage_sql.c, src/manage_migrators.c: Replace sqlite3_stmt with
	sql_stmt_t.

2014-05-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Move SQLite calls into SQL library: sqlite3_finalize.

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

	* src/sql.h: Add header accordingly.

	* src/manage_sql.c, src/manage_migrators.c: Replace sqlite3_finalize
	with sql_finalize.

2014-05-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Move SQLite calls into SQL library: sqlite3_step.

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

	* src/sql.h: Add header accordingly.

	* src/manage_sql.c, src/manage_migrators.c: Replace sqlite3_step with
	sql_exec.

2014-05-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Move SQLite calls into SQL library: sqlite3_bind_*.

	* src/sql.c (sql_bind_blob, sql_bind_int64, sql_bind_double)
	(sql_bind_text): New functions.

	* src/sql.h: Add headers accordingly.

	* src/manage_sql.c, src/manage_migrators.c: Replace sqlite3_bind_text,
	sqlite3_bind_int64, sqlite3_bind_double and sqlite3_bind_blob with
	sql_bind_text, sql_bind_int64, sql_bind_double and sql_bind_blob.

2014-05-16  Timo Pollmeier <timo.pollmeier@greenbone.net>

	In SCAP and CERT sync, ensure timestamps are based on the UTC timezone
	and make the cut-off times for updates more precise by using the UNIX
	epoch format and use stricter conditions.

	* tools/cpe_youngerthan.xsl, tools/cve_youngerthan.xsl: Use EXSLT
	conversion to seconds since UNIX epoch for comparison with refdate.

	* tools/dfn_cert_update.xsl: Use EXSLT conversion to seconds since
	UNIX epoch for comparison with refdate and for the SQL inserts.

	* tools/oval_update.xsl: Use EXSLT conversion to seconds since
	UNIX epoch for the SQL inserts.

	* tools/greenbone-certdata-sync (update_cert_db): Use UNIX timestamp
	format for refdates. Files with dates equal to the reference are now
	considered old. Account for missing seconds in timestamp file in
	comparisons. Force UTC timezone when writing last_update.

	* tools/greenbone-scapdata-sync (init_scap_db_update)
	(update_scap_db_private, update_scap_db): Same as above sync script.

	* tools/openvas-certdata-sync.in (update_sec_db): Same as above.

	* tools/openvas-scapdata-sync.in (init_sec_db_update)
	(update_sec_db_private, update_sec_db): Same as above.

2014-05-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Move SQLite calls into SQL library: sqlite3_prepare.

	* src/sql.c (sql_prepare): Return instead of aborting, so that the
	caller can rollback if required.

	* src/manage_migrators.c (migrate_19_to_20): Replace sqlite3_prepare
	call with sql_prepare.

	* src/manage_sql.c (init_prognosis_iterator): Handle new sql_prepare
	return.
	(report_severity_data, clude, create_agent): Replace sqlite3_prepare
	call with sql_prepare.

2014-05-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (sql_nquote): Revert r18716 from 2014-02-06 which did
	not correctly handle the length argument, causing memory access past the
	end of the existing string in certain cases.

2014-05-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (next_report): Call "next" instead of doing the same
	sqlite3 calls manually.

2014-05-15  Matthew Mundell <matthew.mundell@greenbone.net>

	Move SQLite calls into SQL library: sqlite3_column_type.

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

	* src/sql.h: Add header accordingly.

	* src/manage_sql.c: Replace sqlite3_column_type calls with
	iterator_null.

2014-05-15  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (create_target, manage_set_config_name)
	(manage_set_config_name_comment, create_schedule, create_port_list)
	(modify_port_list, modify_role, create_filter, modify_filter): Call
	resource_with_name_exists() accordingly.

2014-05-14  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (create_target, modify_target, modify_lsc_credential)
	(create_scanner, modify_scanner, modify_schedule, create_report_format)
	(create_slave, modify_slave, create_group, modify_group)
	(create_port_list_unique, create_port_list, create_role, create_user):
	Refactor code. Call resource_with_name_exists() accordingly.

2014-05-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (reinit_manage_process): Make database comment
	generic.

2014-05-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Move SQLite calls into SQL library: sqlite3_create_function.

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

	* src/sql.h: Add header accordingly.

	* src/manage_sql.c: Replace sqlite3_create_function calls with one
	sql_create_functions.

2014-05-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (task_iterator_scanner): Use iterator_int64 instead
	of sqlite3_column_int64.

2014-05-14  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Test exit codes of sqlite and xsltproc in SCAP and CERT sync scripts
	and abort with an error message if it is non-zero and exit the script
	on interrupt signal instead of just aborting the current command.

	* tools/greenbone-certdata-sync (set_interrupt_trap, handle_interrupt)
	(test_exit_codes, test_sql_exit): New functions.
	(reinit, db_migrate_4, update_cvss, update_cert_db): Add exit code
	checks and interrupt trap.

	* tools/greenbone-scapdata-sync (set_interrupt_trap, handle_interrupt)
	(test_exit_codes, test_sql_exit): New functions.
	(reinit, db_migrate_9, db_migrate_10, db_migrate_11, db_migrate_12)
	(db_migrate_13, db_migrate_14, init_scap_db_update, update_cvss)
	(update_scap_db_private, update_scap_db): Add exit code checks and
	interrupt traps.

	* tools/openvas-certdata-sync.in (set_interrupt_trap, handle_interrupt)
	(test_exit_codes, test_sql_exit): New functions.
	(reinit, db_migrate_4, update_cvss, update_sec_db): Add exit code
	checks and interrupt trap.

	* tools/openvas-scapdata-sync.in (set_interrupt_trap, handle_interrupt)
	(test_exit_codes, test_sql_exit): New functions.
	(reinit, db_migrate_9, db_migrate_10, db_migrate_11, db_migrate_12)
	(db_migrate_13, db_migrate_14, init_sec_db_update, update_cvss)
	(update_sec_db_private, update_sec_db): Add exit code checks and
	interrupt traps.

2014-05-14  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Add tasks scanner and configs type.
	Hence increase database version to 125.  Add database migration from
	version 124 to 125.

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

	* src/manage_migrators.c (migrate_124_to_125): New function.
	(database_migrators): Add migrate_124_to_125.

	* doc/db_postgres.sql, doc/db.png: Update documentation for new table
	columns.

	* src/manage_sql.c (create_tables): Add scanner column for tasks. Add
	type column for configs and configs_trash.
	(TASK_ITERATOR_COLUMNS, TASK_ITERATOR_TRASH_COLUMNS): Iterate over
	scanner column.
	(task_iterator_scanner, task_scanner, set_task_scanner, find_scanner)
	(scanner_name): New functions.
	(copy_task): Adjust for new column.
	(scanner_in_use): Check if a task is using the scanner.

	* src/manage.h: Add function prototypes accordingly.

	* src/omp.c (create_task_data_t, create_task_data_reset)
	(modify_task_data_t, modify_task_data_reset): Add scanner_id element.
	(client_state_t): Add CLIENT_CREATE_TASK_SCANNER and
	CLIENT_MODIFY_TASK_SCANNER states.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Adjust
	GET_TASKS, CREATE_TASK and MODIFY_TASK for adding task scanner element.

2014-05-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (permission_is_predefined, delete_port_range)
	(port_list_is_predefined): Remove overlooked sql_int cell arguments.

2014-05-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Move SQLite calls into SQL library: sqlite3_create_collation.

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

	* src/sql.h: Add headers accordingly.

	* src/manage_sql.c: Replace sqlite3_create_collation calls with one
	sql_create_collations.

2014-05-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Move SQLite calls into SQL library: sqlite3_open and sqlite3_close.

	* src/sql.c (DB_CHUNK_SIZE): New define.  From manage_sql.c
	(sql_open, sql_close): New functions.

	* src/sql.h: Add headers accordingly.

	* src/manage_sql.c: Replace sqlite3_open and sqlite3_close with sql_open
	and sql_close.
	(DB_CHUNK_SIZE): Remove.  Now in sql.c.

2014-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Move SQLite calls into SQL library: sqlite3_column_int.

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

	* src/sql.h: Add header accordingly.

	* src/manage_sql.c: Replace sqlite3_column_int with iterator_int.

2014-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c: Replace overlooked cases of sqlite3_column_text with
	iterator_string.

2014-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Move SQLite calls into SQL library: sqlite3_column_double.

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

	* src/sql.h: Add header accordingly.

	* src/manage_sql.c: Replace sqlite3_column_double with iterator_double.

2014-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Move SQLite calls into SQL library: sqlite3_column_text.

	* src/manage_migrators.c, src/manage_sql.c: Call iterator_string instead
	of sqlite3_column_text.

2014-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Move SQLite calls into SQL library: sqlite3_column_int64.

	* src/manage_sql.c: Call iterator_int64 instead of sqlite3_column_int64.

2014-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Move SQLite calls into SQL library: sqlite3_changes.

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

	* src/sql.h: Add header accordingly.

	* src/manage_migrators.c, src/manage_sql.c: Replace sqlite3_changes with
	sql_changes.

2014-05-13  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Reduce the amount of extra SQL queries when getting tasks.

	* src/manage_sql.c (TASK_ITERATOR_COLUMNS, TASK_ITERATOR_TRASH_COLUMNS):
	Select uuid instead of date for last report. Remove unused selected
	column. Select the number of finished reports and hosts ordering.
	(task_iterator_run_status_name, task_iterator_last_report)
	(task_iterator_finished_reports, task_iterator_hosts_ordering): New
	function.
	(task_current_report): Rename to task_iterator_current_report. Take
	iterator as argument.
	(task_last_report_id): Remove function.
	(task_iterator_trend_counts): Call new function.

	* src/omp.c (omp_xml_handle_end_element): Call new functions accordingly
	in GET_TASKS case. Code style update.

	* src/manage.h: Add and remove functions prototypes accordingly.

2014-05-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Move SQLite calls into SQL library: sqlite3_last_insert_rowid.

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

	* src/sql.h: Add header accordingly.

	* src/manage_config_host_discovery.c, src/manage_sql.c,
	src/manage_config_system_discovery.c, src/manage_migrators.c: Replace
	sqlite3_last_insert_rowid with sql_last_insert_rowid.

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

	Some Task iterator related optimizations.

	* src/manage_sql.c (TASK_ITERATOR_COLUMNS, TASK_ITERATOR_TRASH_COLUMNS):
	Count total as all tasks reports. Select uuid instead of date for first
	column, to be used by task_iterator_first_report(). Remove duplicate
	selection of last column.
	(task_iterator_total_reports, task_iterator_first_report): New
	functions.
	(task_report_count): Delete function.
	(task_trend_counts): Rename task_iterator_trend_counts. Take task
	iterator as argument, instead of task ROWID.

	* src/manage.h: Add, adjust and remove functions prototypes accordingly.

	* src/omp.c (omp_xml_handle_end_element): Adjust GET_TASKS case to use
	new functions accordingly.

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

	Remove cell args from internal SQL functions.

	* src/sql.c (sql_x_internal, sql_x, sql_x_quiet): Remove col and row
	args.  Update callers.

	* src/sql.h (sql_x): Remove.  Internal to the SQL "library".

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

	Remove cell args from sql_int.

	* src/sql.c (sql_int): Remove col and row args.  Update caller.

	* src/sql.h: Update headers accordingly.

	* src/manage.c, src/manage_acl.c, src/manage_config_host_discovery.c,
	src/manage_migrators.c, src/manage_sql.c: Update callers.

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

	Remove cell args from sql_string.

	* src/sql.c (sql_string): Remove col and row args.

	* src/sql.h: Update headers accordingly.

	* src/manage.c, src/manage_migrators.c, src/manage_sql.c: Update
	callers.

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

	* src/manage_sql.c (task_second_last_report_id): Use SQL OFFSET to pick
	row instead of sql_string args.

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

	Remove cell args from sql_int64.

	* src/sql.c (sql_int64): Remove col and row args.

	* src/sql.h: Update headers accordingly.

	* src/manage_migrators.c, src/manage_acl.c, src/manage_sql.c: Update
	callers.

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

	* src/manage_sql.c (task_second_last_report)
	(host_nthlast_report_host): Use SQL OFFSET to pick row instead of
	sql_int64 args.

2014-05-09  Matthew Mundell <matthew.mundell@greenbone.net>

	Remove cell args from sql_double and sql_string_quiet.

	* src/sql.c (sql_double, sql_string_quiet): Remove col and row args.

	* src/sql.h: Update headers accordingly.

	* src/manage_sql.c: Update callers.

2014-05-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (report_format_content_type, report_format_in_use)
	(trash_report_format_in_use): Neaten doc comments and SQL.

2014-05-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_report_format): Check if the report format is
	in use.
	(trash_report_format_in_use): Select from the trash table because only
	trash alerts should refer to trash report formats.  Select original_uuid
	instead of uuid for report format, because that's what the alerts refer
	to.

2014-05-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (resource_with_name_exists): Rename resource_id
	param to resource, because _id params are usually UUIDs.  Expect 0
	instead of -1 to indicate "no resource", like most other places do.
	Update callers accordingly.

2014-05-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/lsc_user.c, src/manage_sql.c, src/omp.c, src/openvasmd.c,
	src/otp.c: Use ** to start Doxygen top-level comments.

2014-05-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage): Add comment full stop.
	(manage_restore): Correct order of warning args.

	* src/manage_migrators.c (migrate_122_to_123): Neaten comment.
	(migrate_123_to_124): Remove extra space.

2014-05-09  Matthew Mundell <matthew.mundell@greenbone.net>

	Prevent duplicate report format UUIDs.  Ensure all are unique at
	startup.

	* src/manage_sql.c (make_report_format_uuids_unique): New function.
	(check_db_report_formats): Call make_report_format_uuids_unique.  Adjust
	return.
	(check_db): Check for check_db_report_formats return.
	(create_report_format): Prevent any report formats from having the same
	UUIDs, regardless of who owns the report format.
	(manage_restore): Also check if a report format with the candidate UUID
	exists in the regular table.

	* src/omp.c (omp_xml_handle_end_element): Handle new manage_restore
	return.

2014-05-08  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (resource_with_name_exists): Add resource_id, to
	handle case of ignoring a specific resource.
	(copy_resource_lock, create_alert, create_config, create_config_rc)
	(create_lsc_credential, create_agent, modify_agent, modify_alert):
	Update modified function calls accordingly.

2014-05-08  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (resource_with_name_exists): New function.
	(copy_resource_lock, create_alert, create_config, create_config_rc)
	(create_lsc_credential, create_agent, modify_agent, modify_alert): Use
	new function. Code style update.

2014-05-08  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Remove group and role assignments of deleted users at startup and
	when deleting users.

	* src/manage_sql.c (cleanup_tables): New function.
	(init_manage): Remove group and role assignments of deleted users.
	(delete_user): Delete user from groups and roles.

2014-05-08  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (init_manage_process): Don't create unused sqlite
	severity_matches_type() function.
	(check_db_tasks, check_db_targets, check_db_port_lists)
	(check_db_settings, check_db_nvts, check_db_configs)
	(check_db_report_formats, check_db_report_formats_trash)
	(check_db_permissions, check_db_roles): New functions.
	(check_db): Move data check routines to related new functions.
	(ensure_predefined_port_lists_exist): Rename to check_db_port_lists.
	(init_manage_settings): Rename to check_db_settings.

	* src/sql.c (sql_severity_matches_type): Delete unused function.

	* src/manage.h, src/sql.h: Remove deleted functions prototypes.

2014-05-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (check_db): Clean Topology report format indenting.

2014-05-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_DELETE_USER include
	paused tasks in error message.

2014-05-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Increase OMP version.

2014-05-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_migrators.c (migrate_116_to_117, migrate_120_to_121): Clean
	comments and indenting.

2014-05-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (version): Increase.
	(create_lsc_credential): Add compatibility change about removing
	KEY/PUBLIC.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-05-07  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_migrators.c (migrate_120_to_121, migrate_121_to_122):
	Remove all permissions for User, Info and Observer roles which means
	that they will be re-inserted on next startup along with help
	permisions.

	* src/manage_sql.c (check_db): Apply same verification for Observer and
	Info roles' permissions as for User. See revision 19385.

2014-05-07  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (check_db): When checking permissions for User role,
	verify that there are more than one permission. This covers a path
	covering migrations from old users on disk case + DB migration to
	version >=122.

2014-05-06  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Finish removal of public_key column from lsc_credentials table.
	Hence increase database version to 124.  Add database migration from
	version 123 to 124.

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

	* src/manage_migrators.c (migrate_123_to_124): New function.
	(database_migrators): Add migrate_123_to_124.

	* src/manage.c (slave_setup): Adjust omp_create_lsc_credential_key() call.

	* doc/db_postgres.sql, doc/db.png: Update documentation for table column
	removal.

	* src/schema_formats/XML/OMP.xml, doc/omp.html, doc/omp.rnc: Update
	documentation for public_key element removal in create_lsc_credential
	command.

2014-05-06  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Remove Public Key requirement for LSC Credentials.

	* src/manage.h: Adjust function prototype accordingly.

	* src/manage_sql.c (create_tables): Remove public_key column from
	lsc_credentials and lsc_credentials_trash tables.
	(create_lsc_credential): Don't insert a public key and remove matching
	function argument.
	(copy_lsc_credential): Don't copy the public key.
	(delete_lsc_credential): Don't move the public key to trash.
	(LSC_CREDENTIAL_ITERATOR_COLUMNS)
	(LSC_CREDENTIAL_ITERATOR_TRASH_COLUMNS): Don't iterate over public key.
	(lsc_credential_packaged): Adjust to check for private key presence
	instead.
	(lsc_credential_iterator_pass_or_priv): Adjust iterated over column
	number
	(manage_restore): Don't restore public_key value.
	(create_lsc_credential_data, create_lsc_credential_data_reset): Remove
	key_public element.
	(client_state_t): Remove CLIENT_CREATE_LSC_CREDENTIAL_KEY_PUBLIC state.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Adjust for create_lsc_credential public element
	removal.

2014-05-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* INSTALL: Move "Creating an administrator" section below Initialise and
	Migrate sections, because --create-user needs an initialised db that is
	at the current version.

2014-05-06  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/omp.c (): Add #include of openvas/base/pwpolicy.h
	(omp_xml_handle_end_element): In case CLIENT_AUTHENTICATE check if
	the password used complies with password policy and add a warning
	message to the response if not.

2014-05-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_user): Skip current_credentials check if user
	is NULL, which is the case with --delete-user.

2014-05-06  Matthew Mundell <matthew.mundell@greenbone.net>

	For the command options, like --create-user, check the db version.

	* src/manage_sql.c (manage_create_user, manage_delete_user)
	(manage_list_user, manage_set_password): Do full init, which checks db
	version.

	* src/manage.h: Add headers accordingly.

	* src/openvasmd.c (main): Handle new returns.

2014-05-06  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c (slave_setup): Check credential type by checking for
	private key value. Adjust omp_create_lsc_credential_key call.
	(run_task): Don't send public key value to scanner.

	* src/manage.h: Remove deleted function prototype.

	* src/manage_sql.c (lsc_credential_iterator_public_key): Remove
	function.
	(lsc_credential_iterator_rpm, lsc_credential_iterator_deb): Adjust to
	get public key value from private key.

	* omp/omp.c (omp_xml_handle_end_element): Get the public key value from
	the private key in GET_LSC_CREDENTIALS case.

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

	Set the start time of a report once only, the first time the scan is
	started.  This ensures that the start time remains the same, even when
	the task is resumed, because the start time is what identifies the scan.

	* src/manage_sql.c (set_task_start_time_epoch)
	(scan_start_time_epoch): New functions.

	* src/manage.h: Add headers accordingly.

	* src/manage.c (run_task): Only do a reset_task when creating a new
	report.  When resuming an old report set the task start time from the
	report.  Move the target_hosts call above the fork, so that it still
	exits before the reset_task on error.

	* src/otp.c (process_otp_scanner_input): When receiving a SCAN_START,
	only set the start start times for new reports, leaving the start times
	alone when resuming a task.

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

	* src/manage_migrators.c (manage_migrate): Reopen DB before ANALYZE, in
	case the schema has changed.

2014-04-30  Michael Wiegand <michael.wiegand@greenbone.net>

	* tools/greenbone-scapdata-sync, tools/greenbone-certdata-sync: Do not
	exit early if synchronization is disabled. Instead, note the fact in
	the log and behave as if REFRESH_ONLY was requested, thus still
	remaining useful for local operations.

2014-04-30  Michael Wiegand <michael.wiegand@greenbone.net>

	* tools/greenbone-scapdata-sync, tools/greenbone-certdata-sync:
	Streamline handling of REFRESH_ONLY to consistently only operate on
	local data and exclude network communication.

2014-04-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage): Init current_credentials with memset,
	so that all fields are cleared.
	(authenticate): Set timezone in credentials.

2014-04-30  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (manage_restore): Restore scanner object when found.
	(manage_empty_trashcan): Empty trash scanners.

2014-04-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ompd.c (wait_for_connection): New function.
	(serve_omp): When the scanner connection is interrupted, wait for the
	scanner socket to be writable, instead of immediately calling
	get_sockopt via write_to_scanner.

2014-04-29  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c (severity_matches_type): Fix comparison against static
	string instead of the actual type variable.

2014-04-29  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (modify_scanner): Allow modifying the host, port and
	type values.
	(create_scanner): SQL quote provided host value.

	* src/omp.c (modify_scanner_data_t): Add host, port and type elements.
	(modify_scanner_data_reset): Free new elements.
	(client_state_t): Add new modify scanner states.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Adjust for modify_scanner changes to handle host,
	port and type value modifying.

2014-04-28  Michael Wiegand <michael.wiegand@greenbone.net>

	Post branch version bump.

	* CMakeLists.txt: Updated version to 6.0+beta1.

2014-04-28  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Cleanup of miscllaneous unused functions and code refactoring.

	* src/manage.c (slave_setup): Use generic get_iterator_resource
	function.

	* src/manage.h: Remove deleted functions prototypes.

	* src/manage_sql.c (alert_iterator_alert, alert_iterator_uuid,
	(alert_iterator_name, alert_iterator_comment, target_iterator_target)
	(target_iterator_uuid, target_iterator_name, target_iterator_comment)
	(config_iterator_config, config_iterator_uuid, config_iterator_name)
	(config_iterator_comment)
	(lsc_credential_iterator_lsc_credential, lsc_credential_iterator_uuid)
	(lsc_credential_iterator_name, lsc_credential_iterator_comment)
	(agent_iterator_uuid, agent_iterator_name, agent_iterator_comment)
	(schedule_iterator_schedule, schedule_iterator_uuid)
	(schedule_iterator_name, schedule_iterator_comment)
	(report_format_iterator_report_format, report_format_iterator_uuid)
	(report_format_iterator_name, slave_iterator_slave, slave_iterator_uuid)
	(slave_iterator_name, slave_iterator_comment)
	(port_list_iterator_port_list, port_list_iterator_uuid,
	(port_list_iterator_name, port_list_iterator_comment): Remove functions.
	(manage_report, manage_send_report, update_config_cache)
	(manage_complete_nvt_cache_update, verify_report_format_internal)
	(omp_xml_handle_end_element): Use generic get_iterator_* functions
	accordingly.

2014-04-28  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Add create_scanner, get_scanners, modify_scanner, delete_scanner and
	verify_scanner OMP commands.

	* src/manage.h: Add new functions prototypes.
	(scanner_type_t): New enum.
	(scanner_t): New type.

	* src/manage_sql.c (omp_commands): Add create_scanner, delete_scanner,
	get_scanners, modify_scanner and verify_scanner commands.
	(create_tables): Create scanners and scanners_trash tables.
	(find_scanner_with_permission, create_scanner, copy_scanner)
	(modify_scanner, delete_scanner, init_scanner_iterator)
	(scanner_iterator_host, scanner_iterator_port, scanner_iterator_type,
	(scanner_in_use, trash_scanner_in_use, scanner_writable)
	(trash_scanner_writable, scanner_uuid, scanner_count, verify_scanner):
	New functions.
	(SCANNER_ITERATOR_FILTER_COLUMNS, SCANNER_ITERATOR_COLUMNS)
	(SCANNER_ITERATOR_TRASH_COLUMNS): New defines.

	* src/omp.c (create_scanner_data_t, delete_scanner_data_t)
	(get_scanners_data_t, modify_scanner_data_t, verify_scanner_data_t): New
	structs.
	(create_scanner_data_reset, delete_scanner_data_reset)
	(get_scanners_data_reset, modify_scanner_data_reset)
	(verify_scanner_data_reset): New functions.
	(command_data_t): Add elements for new commands.
	(create_scanner_data, delete_scanner_data, get_scanners_data)
	(modify_scanner_data, verify_scanner_data): New variables.
	(client_state_t): Add states for new scanners commands.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Handle new omp commands accordingly.

2014-04-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otp.c (blank_control_chars): New function.
	(parse_scanner_preference_value): Blank control chars in the OTP
	messages, as was done before r18496.  r18496 was the switch to UTF-8
	OTP.  Encoded control characters are valid in XML 1.1, but we use 1.0
	and libxslt only supports 1.0.

2014-04-23  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number to 5.0.1.

2014-04-23  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* CMakeLists.txt: Now really set to 5.0.0.

2014-04-23  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Preparing the openvas-manager 5.0.0 release.

	* CHANGES: Updated.

	* CMakeLists.txt: Update to 5.0.0.

2014-04-23  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* INSTALL: Adjust requirements.

	* src/openvasmd.c (main): Adjust copyright year.

2014-04-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* TODO: Remove entry about memory leaks, which is ongoing.

2014-04-22  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c (scanner): Remove variable.

	* src/manage.h (scanner_t): Remove struct.
	(scanner): Remove extern variable.

	* src/otp.h (plugins_feed_version): New static variable.
	(init_otp_data, process_otp_scanner_input): Adjust to use new static
	variable instead of extern scanner struct's element.

2014-04-22  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Add alive_test column to targets_trash table which was missing in
	new databases but not ones migrated from versions before 111.
	Hence increase database version to 123.  Add database migration from
	version 122 to 123.

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

	* src/manage_migrators.c (migrate_122_to_123): New function.
	(database_migrators): Add migrate_122_to_123.

	* src/manage_sql.c (create_tables): Add alive_test to targets_trash
	table.

2014-04-17  Matthew Mundell <matthew.mundell@greenbone.net>

	Bring database doc up to date.

	* doc/db_postgres.sql (groups, groups_trash, group_users)
	(group_users_trash, roles, roles_trash, role_users, role_users_trash)
	(port_names, nvt_cves, permissions, permissions_trash, tags)
	(tags_trash): New tables.
	(task_users): Remove.
	(users, task_preferences, results, reports, report_counts, notes)
	(overrides, overrides_trash): Update columns.

	* doc/db.png: Update from source.

2014-04-17  Matthew Mundell <matthew.mundell@greenbone.net>

	Add HELP permission check.  Give User and Info roles HELP permission.
	Hence increase database version to 122.  Add database migration from
	version 121 to 122.

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

	* src/manage_migrators.c (migrate_121_to_122): New function.
	(database_migrators): Add migrate_121_to_122.

	* src/manage_sql.c (check_db): Add HELP permission to User and Info.

	* src/omp.c (omp_xml_handle_end_element): Add permission check for HELP.

	* doc/db.png: Update for version change.

2014-04-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Give the Observer role AUTHENTICATE permission.  Hence increase database
	version to 121.  Add database migration from version 120 to 121.

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

	* src/manage_migrators.c (migrate_120_to_121): New function.
	(database_migrators): Add migrate_120_to_121.

	* src/manage_sql.c (check_db): Give Observer AUTHENTICATE permission.

	* doc/db.png: Update for version change.

2014-04-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Only allow users to AUTHENTICATE if they have permission.

	* src/manage_sql.c (authenticate): Add permission check.

	* src/omp.c (omp_xml_handle_end_element): Add permission return case to
	CLIENT_AUTHENTICATE.

2014-04-16  Matthew Mundell <matthew.mundell@greenbone.net>

	Add new role Info.

	* src/manage_sql.h (ROLE_UUID_INFO): New define.

	* src/manage_sql.c (check_db, role_is_predefined): Add new role and
	permissions.

2014-04-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* CMakeLists.txt: Raise version in libopenvas dependency, for auth.conf
	path change.

2014-04-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Add openvasmd to auth.conf
	path.

2014-04-16  Benot Allard  <benoit.allard@greenbone.net>

	* CMakeLists.txt: Install openvas-lsc-rpm-creator.sh
	* tools/openvas-lsc-rpm-creator.sh: Moved from openvas-libraries here.

2014-04-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* README: Update usage.

2014-04-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/lsc_crypt.c, src/manage_acl.c, src/manage.c,
	src/manage_config_discovery.c, src/manage_config_host_discovery.c,
	src/manage_config_system_discovery.c, src/manage_sql.c, src/omp.c,
	src/otp.c: Sort out Doxygen warnings.

2014-04-15  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* CMakeLists.txt, src/CMakeLists.txt: Remove useless linking against
	libuuid.

	* INSTALL: Remove libuuid dependency.

	* src/manage.c: Remove uuid include.

2014-04-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Add compatibility change about
	renaming filter type "report" to "result".
	(create_user, modifyuser): Allow multiple roles, identified by UUID.
	Add compatibility change about UUID.
	(get_users): Correct ROLE in example.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-04-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Replace "number" with "integer" as
	type, because "integer" is an existing type.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-04-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Remove all traces of old GET_USERS attributes.

	* src/omp.c (get_users_data_t, get_users_data_reset): Remove name and
	sort_order.
	(omp_xml_handle_start_element): Remove GET_USERS attributes.

	* src/schema_formats/XML/OMP.xml: Add compatibility change for
	GET_USERS.
	(get_users): Remove name attribute.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-04-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Ensure all relevant GET commands have
	filter attributes.
	(get_users): Add other missing attributes too.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-04-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Remove sort_field and sort_order
	attributes from all relevant GET responses.  Add compatibility change
	for 4.0 about these attributes.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-04-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Ensure all relevant GET responses
	include FILTERS, SORT and the count elements like TARGETS and
	TARGET_COUNT.  Ensure that these FILTERS all include KEYWORDS.
	(get_info): Remove extra FILTERS.
	(get_settings): Match to code.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-04-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Ensure all relevant GET responses
	include OWNER.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-04-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (get_users): Add standard GET elements.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-04-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (report): Add the standard GET
	elements.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-04-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (report, get_agents, get_targets)
	(get_alerts, get_filters, get_groups, get_infos, get_lsc_credentials)
	(get_notes, get_nvts, get_overrides, get_permissions, get_port_lists)
	(get_report_formats, get_results, get_roles, get_schedules, get_slaves)
	(get_targets, get_tasks, get_users): Add PERMISSIONS.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-04-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (get_report_formats): Add ALERTS.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-04-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (create_agent, create_alert)
	(create_group, create_lsc_credential, create_port_list)
	(create_port_range, create_report_format, create_role)
	(create_schedule, create_slave, create_task, create_user): Add COPY.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-04-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otp.c (process_otp_scanner_input): Use strlen to get ver_str
	length.

2014-04-11  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/otp.c (process_otp_scanner_input): Fix hard-coded version string
	length left from r19226. Improve code style.

2014-04-10  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/ompd.c (write_to_scanner), src/otp.c (process_otp_scanner_input):
	Remove "beta" from OTP identifer.

2014-04-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (get_users): Add GROUPS.  Update ROLE
	to new style.  Add compatibility change about ROLE.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-04-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (get_tasks): Add GROUP and ROLE to
	TASK/OBSERVERS.
	(get_users): Add ANY now that users can have any number of roles.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-04-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (report): Add REPORT/TIMESTAMP and
	REPORT/DELTA/TIMESTAMP.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-04-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (create_tag): Use TYPE instead of
	PATTERN for attribute.  Add T around "uuid" in PATTERN.
	(get_tags, modify_tag): Use TYPE instead of PATTERN for attribute.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-04-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Remove Ts placed around "text" in
	PATTERNs.  "text" is not a type, but signifies free text.

2014-04-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Clean up strings in
	CLIENT_DESCRIBE_FEED, CLIENT_DESCRIBE_SCAP and CLIENT_DESCRIBE_CERT.

2014-04-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Remove Ts placed inside TYPEs.  T is
	for the type of a PATTERN.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-04-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Remove fullstops from summaries.
	It's up to the generator to add these to the final format.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-04-10  Matthew Mundell <matthew.mundell@greenbone.net>

	Add last two missing commands to OMP doc.

	* src/schema_formats/XML/OMP.xml (get_roles, modify_permission): New
	commands.
	(get_groups): Clarify user list.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-04-10  Matthew Mundell <matthew.mundell@greenbone.net>

	Add last two missing commands to OMP doc.

	* src/schema_formats/XML/OMP.xml (get_roles, modify_permission): New
	commands.
	(get_groups): Clarify user list.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-04-10  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number to 5.0+beta14.

2014-04-10  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 5.0+beta13 release.

	* CHANGES: Updated.

2014-04-09  Matthew Mundell <matthew.mundell@greenbone.net>

	Add some missing commands to OMP doc.

	* src/schema_formats/XML/OMP.xml (create_permission, describe_cert)
	(describe_feed, describe_scap, get_groups, get_permissions, sync_feed)
	(sync_scap, sync_cert): New commands.
	(describe_auth): Update slightly.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-04-08  Matthew Mundell <matthew.mundell@greenbone.net>

	Correct errors in the OTP sent for alive tests.

	* src/manage.c (send_alive_test_preferences): Get the alive tests as a
	bitfield, in order to check if only "Consider Alive" was selected.  If
	so, set "Do a TCP ping" to yes.  This prevents the "Consider Alive" case
	from always setting "Do a TCP ping" to yes.  In the process add a
	missing SYN check to the main "Do a TCP ping" case.

	* src/manage_sql.c (target_alive_tests): New function.
	(target_alive_test): Remove.

	* src/manage.h, src/manage_sql.h: Update headers accordingly.

2014-04-08  Matthew Mundell <matthew.mundell@greenbone.net>

	Rename alive test "TCP Service Ping" to "TCP-ACK Service Ping".  Add
	alive test "TCP-SYN Service Ping".

	* src/manage.c (send_alive_test_preferences): Add TCP SYN Ping.

	* src/manage.h (alive_test_t): Add ACK to TCP ping.  Add TCP SYN Ping.

	* src/manage_sql.c (alive_test_from_string)
	(target_iterator_alive_tests): Add ACK to TCP service ping name.  Add
	TCP SYN Ping.

2014-04-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_migrators.c (migrate_116_to_117): Ensure tables exist
	before using them.

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

	* src/sql.c (sqlv): Free formatted in "gave up" case.

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

	Recover from the deficiency in manage_empty_trashcan which was rectified
	in last commit.  Hence increase database version to 120.  Add database
	migration from version 119 to 120.

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

	* src/manage_migrators.c (migrate_119_to_120): New function.
	(database_migrators): Add migrate_119_to_120.

	* src/manage_sql.c (resource_exists): New function.
	(init_manage_process): Increase resource_exists args.

	* src/sql.c (sql_resource_exists): Add location to SQL args.  Take ID
	instead of UUID as second SQL arg.  Use resource_exists to do the check.

	* doc/db.png: Update for version change.

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

	* src/manage_sql.c (manage_empty_trashcan): Delete permissions of
	trashcan groups and roles.  Update orphan state or permissions resources
	that were in the trashcan.  Remove tags_trash update because tags_trash
	has just been emptied.

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

	* src/manage_sql.c (PERMISSION_ITERATOR_COLUMNS)
	(PERMISSION_ITERATOR_TRASH_COLUMNS): Add roles trash cases for subject
	UUID and name.

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

	Remove "Clean up orphaned results" from startup.  Hence increase
	database version to 119.  Add database migration from version 118 to
	119.

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

	* src/manage_migrators.c (migrate_118_to_119): New function.
	(database_migrators): Add migrate_118_to_119.

	* src/manage_sql.c (check_db): Remove "Clean up orphaned results".

	* doc/db.png: Update for version change.

2014-04-03  Matthew Mundell <matthew.mundell@greenbone.net>

	Add option --disable-scheduling.

	* src/manage.c (manage_schedule): Add arg run_tasks.

	* src/manage.h: Update header accordingly.

	* src/openvasmd.c (scheduling_enabled): New variable.
	(serve_and_schedule): Pass scheduling_enabled to manage_schedule.
	(main): Add --disable-scheduling.

2014-04-03  Matthew Mundell <matthew.mundell@greenbone.net>

	Run ANALYZE after migrate instead of on startup, to speed up startup.

	* src/manage_migrators.c (manage_migrate): Run ANALYZE if any migration
	happens.

	* src/manage_sql.c (check_db, manage_complete_nvt_cache_update): Remove
	ANALYZE.

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

	* src/manage_sql.c (ALL_INFO_UNIION_COLUMNS): Indent under SELECT
	consistently.

2014-04-02  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/openvasmd.c (main): Make description consistent with option
	name.

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

	* src/omp.c: Revert doxygen "@cond STATIC" Hani removed in r19030, at
	least to keep the @endcond company.

2014-04-02  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_migrators.c (migrate_116_to_117): Only try to get ROWIDs
	for SCAP and CERT info if the respective databases are available.
	Consistently set resource to 0 for undefined types.

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

	* src/schema_formats/XML/OMP.xml (commands): Add modify_report_format.

	* doc/omp.html, doc/omp.rnc: Update from source.

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

	* src/schema_formats/XML/OMP.xml (create_group, delete_group)
	(modify_group): New commands.

	* doc/omp.html, doc/omp.rnc: Update from source.

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

	* src/manage_sql.c (manage_empty_trashcan): Delete roles.

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

	* src/wizards/quick_task.xml: Do not try to create alert if email
	parameter is empty and do not try to get slaves if the get_slaves
	command is not available.

2014-04-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (create_role, delete_role)
	(modify_role): New commands.
	(help): Update example to match actual response.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-04-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_migrators.c: Make "Set the database" comments all the same.

2014-04-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_role): Expect role, as in create_group.

2014-04-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_group): Correct param doc.

	* src/omp.c (omp_xml_handle_end_element): Add missing create_group
	and create_role return cases.  Order copy_group and copy_role return
	cases better.

2014-04-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (group_add_users, role_add_users): Remove.
	(add_users): New function.  Body from group_add_users.
	(create_group, modify_group, create_role, modify_role): Call add_users
	instead of type-specific functions.

2014-04-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (find_trash): Make doc lines shorter.

2014-04-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Correct MODIFY_GROUP and
	MODIFY_ROLE error responses.

2014-04-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db.png: Update for version change.

2014-04-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (valid_db_resource_type): Add role.

	* src/manage_sql.c (delete_group, delete_role): Set orphans and
	locations of tags.

2014-04-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (permissions_set_subjects): Use the type arg, to
	consider roles as well as groups.

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

	Rebuild the resource_location column in the tags and tags_trash tables
	to find correct locations for all resource types. Apply the location
	of a task to its reports and results as well. Also use defines
	LOCATION_TABLE and LOCATION_TRASH for the resource_location values.
	Hence increase database version to 118. Add database migration from
	version 117 to 118.

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

	* src/manage_migrators.c (RESOURCE_TRASH): Use type parameter correctly
	and use defines LOCATION_TABLE and LOCATION_TRASH for the values.
	(migrate_116_to_117): Fix typo in comment, use defines and set location
	for tags on reports and results.
	(migrate_117_to_118): New function. Rebuilds resource_location column
	in the tags and tags_trash tables.
	(database_migrators): Add migrate_117_to_118.

	* src/manage_sql.c (copy_resource_lock, delete_report_internal): Use
	defines LOCATION_TABLE and LOCATION_TRASH to specify location.
	(delete_task, manage_restore): Update resource_location of tags on
	associated reports and results.
	(create_tag, modify_tag, tags_set_orphans): Use defines LOCATION_TABLE
	and LOCATION_TRASH to specify location.

2014-03-31  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c: Line up newline escapes nicely.

2014-03-31  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP MODIFY_ROLE.

	* src/manage_sql.c (omp_commands): Add MODIFY_ROLE.
	(role_add_users): New function.  Body from create_role.
	(create_role): Call role_add_users to add users.
	(modify_role): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (modify_role_data_t): New type.
	(modify_role_data_reset): New function.
	(command_data_t, client_state_t): Add MODIFY_ROLE entries.
	(modify_role_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add MODIFY_ROLE.

2014-03-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (copy_role): Copy command-level permissions too.
	Don't copy the users, otherwise permissions may accidentally be granted
	during editing.

2014-03-28  Benot Allard  <benoit.allard@greenbone.net>

	Post release version bump.

	* CMakeLists.txt, CHANGES: 5.0+beta13

2014-03-28  Benot Allard  <benoit.allard@greenbone.net>

	Prepare release of manager-5.0+beta12

	* CHANGES: Update

2014-03-28  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/openvasmd.c (main): Add --dh-params command-line option. Call
	set_gnutls_dhparams() accordingly.

	* doc/openvasmd.8: Update documentation.

2014-03-28  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (copy_resource_lock): Additionally copy tags
	attached to the resource.

2014-03-28  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/manage_sql.c (init_manage): Increased the max value
	for IPs per target that could be specified via --max-ips-per-target
	to 70000 to at least cover all of 192.168 network, a typical case
	for host discovery.

2014-03-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_tables): Put one progress back from last
	commit, because it is still a progress point.

2014-03-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_tables): Remove ANALYZE which is done later
	in check_db anyway, to save a few seconds on startup.

2014-03-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db.png: Update for version change.

2014-03-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (permission_is_predefined): Add doc.

2014-03-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP DELETE_ROLE.

	* src/manage_sql.c (omp_commands): Add DELETE_ROLE.
	(create_tables): Add roles_trash and role_users_trash.
	(role_is_predefined, delete_role): New functions.
	(role_writable, trash_role_writable): Make roles writable.
	(ROLE_ITERATOR_TRASH_COLUMNS): New define.
	(role_count, init_role_iterator): Pass trash columns.
	(manage_restore): Add roles.

	* src/manage.h: Add header accordingly.

	* src/omp.c (delete_role_data_t): New type.
	(delete_role_data_reset): New function.
	(command_data_t, client_state_t): Add DELETE_ROLE entry.
	(delete_role_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add
	DELETE_ROLE.

2014-03-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Check return of
	init_report_format_file_iterator in CLIENT_GET_REPORT_FORMATS.

2014-03-26  Benot Allard  <benoit.allard@greenbone.net>

	Post release version bump

	* CMakeLists.txt: 5.0+beta12

2014-03-26  Benot Allard  <benoit.allard@greenbone.net>

	Prepare the 5.0+beta11 release.

	* CHANGES: Update

2014-03-26  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Get tags for resources by ROWID instead of UUID. Make iterator
	functions for active and orphan fields return int.

	* src/manage_sql.c (print_report_xml): Use ROWID of report instead of
	UUID when getting tags.
	(tag_iterator_active, tag_iterator_orphan): Change return type to int.
	(init_resource_tag_iterator, resource_tag_count): Use ROWID of resource
	instead of UUID  when getting tags.

	* src/manage.c (get_nvti_xml): Use ROWID of NVT instead of UUID when
	getting tags.

	* src/manage.h (tag_iterator_active, tag_iterator_orphan): Change
	return type to int.
	(init_resource_tag_iterator, resource_tag_count): Change type of
	resource parameter to resource_t.

	* src/omp.c (send_get_common, buffer_notes_xml, buffer_overrides_xml)
	(buffer_results_xml): Use ROWID of resource instead of UUID when
	getting tags.
	(xml_handle_end_element): In case CLIENT_GET_TAGS adjust elements
	to new return type of tag_iterator_active and tag_iterator_orphan.

2014-03-26  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Rename "attach_id" to "resource_uuid", "attach_type" to "resource_type"
	add resource rowid "resource" and "resource_location" to tags tables.
	Hence increase database version to 117.  Add database migration from
	version 116 to 117.
	Change tag OMP elements accordingly and make them more consistent with
	the resource in permissions overall. Allow tags to be attached to
	resources in trash. Rename "orphaned" in tags to "orphan".

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

	* src/manage_migrators.c (migrate_116_to_117): New function.
	Renames and add tags table columns for consistency with permissions.
	(database_migrators): Add migrate_116_to_117.

	* src/manage_acl.c (user_owns_uuid): Add special case for SecInfo as
	they do not have an owner.

	* src/manage_sql.c (tags_set_locations, tags_set_orphans): New
	functions and prototypes analogous to permissions_set_... functions.
	(filter_clause): Rename tag resource columns.
	(resource_name): Check if type is one without a trash table.
	(create_tables): Rename tag resource columns.
	(delete_alert): Call tags_set_locations and tags_set_orphans.
	(resource_id_exists): Add case for tasks.
	(trash_id_exists): New function. Trash version of resource_id_exists.
	(delete_report_internal): Set tag resource_location and resource fields.
	(request_delete_task_uuid, delete_target, delete_config)
	(delete_lsc_credential, delete_agent, delete_note, delete_override)
	(delete_schedule, delete_report_format, delete_slave, delete_permission)
	(delete_port_list, delete_filter, manage_restore): Call
	tags_set_locations and tags_set_orphans.
	(manage_empty_trashcan): Update tag resources and resource locations.
	(create_tag, delete_tag, modify_tag, TAG_ITERATOR_FILTER_COLUMNS)
	(TAG_ITERATOR_COLUMNS, TAG_ITERATOR_TRASH_COLUMNS)
	(TAG_NAME_ITERATOR_FILTER_COLUMNS): Rename and add resource columns,
	including resource_name for trash columns.
	(tag_iterator_attach_type): Remove. Replaced with
	tag_iterator_resource_type.
	(tag_iterator_resource_type): New function.
	(tag_iterator_attach_id): Remove. Replaced with tag_iterator_resource
	and tag_iterator_resource_uuid.
	(tag_iterator_resource_uuid, tag_iterator_resource)
	(tag_iterator_resource_location): New functions.
	(tag_iterator_active, tag_iterator_value): Adjust column number.
	(tag_iterator_orphaned): Remove. Replaced with tag_iterator_orphan.
	(tag_iterator_orphan): New function.
	(tag_iterator_attach_name): Remove. Replaced with
	tag_iterator_resource_name.
	(init_resource_tag_iterator, resource_tag_count): Rename resource
	columns.

	* src/manage.h (trash_id_exists): New function prototype.
	(tag_iterator_attach_type): Remove. Replaced with
	tag_iterator_resource_type.
	(tag_iterator_resource_type): New function.
	(tag_iterator_attach_id): Remove. Replaced with tag_iterator_resource
	and tag_iterator_resource_uuid.
	(tag_iterator_resource_uuid, tag_iterator_resource)
	(tag_iterator_resource_location): New functions.
	(tag_iterator_active, tag_iterator_value): Adjust column number.
	(tag_iterator_orphaned): Remove. Replaced with tag_iterator_orphan.
	(tag_iterator_orphan): New function.
	(tag_iterator_attach_name): Remove. Replaced with
	tag_iterator_resource_name.

	* src/omp.c (create_tag_data_t, create_tag_data_reset)
	(modify_tag_data_t, modify_tag_data_reset): Rename attach_id to
	resource_id and attach_type to resource_type.
	(client_state_t): Remove CLIENT_CREATE_TAG_ATTACH_ID and
	CLIENT_MODIFY_TAG_ATTACH_ID. Rename ATTACH elements to their RESOURCE
	equivalents.
	(omp_xml_handle_start_element): In cases for create_tag and modify_tags
	rename ATTACH elements to RESOURCE and make the resource ID an
	attribute.
	(omp_xml_handle_start_element): In cases for get_tags, create_tag and
	modify_tag rename ATTACH elements to RESOURCE and make the resource ID
	an attribute. Rename ORPHANED element to ORPHAN.

	* src/schema_formats/XML/OMP.xml (create_tag, get_tags, modify_tag):
	Rename "attach" and "orphaned" elements to "resource" and "orphan" and
	make them more consistent with the ones in permissions.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-03-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_config_system_discovery.c
	(make_config_system_discovery): Correct comment.

2014-03-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP CREATE_ROLE.

	* src/omp.c (create_role_data_t): New type.
	(create_role_data_reset): New function.
	(command_data_t, client_state_t): Add CREATE_ROLE entry.
	(create_role_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add CREATE_ROLE.

	* src/manage_sql.c (omp_commands): Add CREATE_ROLE.
	(copy_role, create_role): New functions.

	* src/manage.h: Add headers accordingly.

2014-03-25  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c (alert_condition_description), src/manage_sql.c
	(escalate_2, event_applies, delete_user), src/omp.c
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Remove
	useless break statements following return statements.

2014-03-24  Matthew Mundell <matthew.mundell@greenbone.net>

	Remove NVTs 810002 "CPE Inventory" and 810003 "Host Summary" from
	predefined configs.  Hence increase database version to 116.  Add
	database migration from version 115 to 116.

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

	* src/manage_migrators.c (migrate_115_to_116): New function.  Adds
	exclude rule to config "Discovery" for "CPE Inventory".
	(database_migrators): Add migrate_115_to_116.

	* src/manage_config_discovery.c (make_config_discovery): Remove "CPE
	Inventory".

	* src/manage_sql.c (check_db): Ensure the "All" NVT selector excludes
	"CPE Inventory" and "Host Summary".  This covers the Full and * configs.

	* doc/db.png: Update for version change.

2014-03-24  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Drop sign_key_ids column from nvts table.  Hence increase database
	version to 115.  Add database migration from version
	114 to 115.

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

	* src/manage_migrators.c (migrate_114_to_115): New function.
	(database_migrators): Add migrate_114_to_115.

	* src/manage_sql.c (create_tables): Remove sign_key_ids from nvts table
	creation.

	* doc/db_postgres.sql (nvts): Remove sign_key_ids column.

	* doc/db.png, doc/omp.html, doc/omp.rnc: Update from source.

	* src/schema_formats/XML/OMP.xml: Add compatibility change for
	GET_NVTS.

2014-03-24  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c (get_nvti_xml): Remove fingerprint element.

	* src/manage_sql.c (make_nvt_from_nvti): Don't store empty sign key id.
	(NVT_ITERATOR_COLUMNS, NVT_ITERATOR_COLUMNS_NVTS): Don't iterate over
	unused sign_key_ids column.
	(nvt_iterator_sign_key_ids): Remove function.
	(nvt_iterator_category, nvt_iterator_family, nvt_iterator_cvss_base):
	Adjust accessed column index.

	* src/schema_formats/XML/OMP.xml: Update documnetation.

	* src/manage.h: Delete removed function prototype.

2014-03-23  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/otp.c (process_otp_scanner_input): Don't handle
	SCANNER_PLUGIN_LIST_FPRS anymore. These are not send anymore
	by the OTP Server.
	(scanner_state_t): Remove SCANNER_PLUGIN_LIST_FPRS.

2014-03-21  Matthew Mundell <matthew.mundell@greenbone.net>

	Add alive test "Consider Alive".

	* src/manage.c (send_alive_test_preferences): Add Consider Alive case.

	* src/manage.h (alive_test_t): Add ALIVE_TEST_CONSIDER_ALIVE.

	* src/manage_sql.c (alive_test_from_string)
	(target_iterator_alive_tests): Add Consider Alive.

2014-03-21  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Add --gnutls-priorities option to Manager.

	* src/openvasmd.c (set_gnutls_priority): New function.
	(main): Add option to set GnuTLS priority string. Call new function
	accordingly.

	* doc/openvasmd.8: Update documentation for new option.

2014-03-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (alive_test_from_string): Use | instead of & so that
	the values are combined.

2014-03-20  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage.c (manage_run_wizard): Return successfully with empty
	response if mode does not exist.

	* src/omp.c (xml_handle_end_element): In case CLIENT_RUN_WIZARD
	do not log event messages if wizard is run successfully with
	read_only option.

2014-03-20  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* CMakeLists.txt: Add new wizard quick_task.xml.

	* src/wizards/quick_task.xml: New wizard for creating new tasks
	with additional options compared to quick_first_scan.

2014-03-19  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Report scanner loading progress to client/GSA.

	* src/omp.c (SEND_XML_SERVICE_DOWN): New macro.
	(XML_SERVICE_DOWN): Delete macro.
	(omp_xml_handle_end_element): Replace usage of XML_SERVICE_DOWN and
	SEND_TO_CLIENT_OR_FAIL with new macro.

	* src/otp.h: Export scanner_current_loading and scanner_total_loading.

2014-03-19  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/schema_formats/XML/OMP.xml (run_wizard): Add mode element to
	command.

	* doc/omp.rnc, doc/omp.html: Update from source.

2014-03-19  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Added regex-based parameter validation and support of alternative run
	modes, e.g. an init mode to get resource lists to display in the
	client, to wizards.

	* src/manage.c (manage_run_wizard): Add mode parameter to run steps
	from a "mode" element in the wizard XML instead of the "wizard"
	root element. Add regex-based validation of parameters defined in the
	wizard XML.

	* src/manage.h (manage_run_wizard): Add mode parameter.

	* src/omp.c (run_wizard_data_t, run_wizard_data_reset): Add mode
	parameter.
	(client_state_t): Add CLIENT_RUN_WIZARD_MODE.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Handle new mode element of run_wizard and new
	return value of manage_run_wizard.

2014-03-19  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/otp.c (scanner_is_loading, parse_scanner_loading): New functions.
	(process_otp_scanner_input): Parse SCANNER_LOADING and adjust logging
	for progress accordingly.

2014-03-18  Matthew Mundell <matthew.mundell@greenbone.net>

	Switch the type check on the filters associated with alerts from
	"report" to "result".  Alerts were migrated from "report" to "result"
	in db version 92.

	* src/manage_sql.c (create_alert, modify_alert, modify_filter): Switch
	filter type check.

	* src/omp.c (omp_xml_handle_end_element): Change messages accordingly.

2014-03-18  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/ompd.c (serve_omp): Set scanner_up to 0 if scanner is still
	loading. This prevents actions such as starting task from mistakenly
	trying to send commands to the scanner.

2014-03-18  Benot Allard  <benoit.allard@greenbone.net>

	Post release version bump

	* CMakeLists.txt: Set version to 5.0+beta11

2014-03-18  Benot Allard  <benoit.allard@greenbone.net>

	Preparing the openvas-manager 5.0+beta10 release.

	* CHANGES: Updated

2014-03-17  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/otp.c (message_data_t): Remove unused struct.

2014-03-17  Matthew Mundell <matthew.mundell@greenbone.net>

	Make --migrate succeed when the database has not yet been initialised.

	* src/manage_migrators.c (manage_migrate_needs_timezone): Account for
	error returns in comparison.
	(manage_migrate): Skip migrate when the tables are missing.

	* src/manage_sql.c (manage_db_version): Check if the tables exist.

2014-03-17  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/ompd.c (serve_omp): Do not return early in scanner loading case
	when not in nvt cache rebuilding case.

	* src/otp.c (process_otp_scanner_input): Accept OTP version 2.0 only.

2014-03-17  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/ompd.c (write_to_scanner): Always initialize with OTP 2.0. Send
	NVT_INFO client command in nvt cache mode.

2014-03-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Add compatibility change for
	GET_DEPENDENCIES.

	* doc/omp.html: Update from source.

2014-03-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (run_task): Also set source_iface on report when the
	preference was left empty.

2014-03-15  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/otp.c (process_otp_scanner_input): Use keyword
	"SCANNER_RELOADING" directly instead of including a macro for it.
	Any other keyword is used directly as well and also this way we
	can drop the otp.h from libraries.

2014-03-14  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Remove handling of PLUGINS_DEPENDENCIES OTP command and get_dependencies
	OMP command.

	* doc/omp.html, doc/omp.rnc, src/schema_formats/XML/OMP.xml: Update
	documentation for removal of get_dependencies.

	* src/manage.c (scanner): Adjust initialization.

	* src/manage.h (scanner_t): Remove plugins_dependencies element.

	* src/manage_sql.c (omp_commands): Delete GET_DEPENDENCIES command.

	* src/omp.c (get_dependencies_data_t, get_dependencies_data): Remove
	variables.
	(command_data_t): Remove get_dependencies element;

	(omp_xml_handle_start_element): Remove GET_DEPENDENCIES handling.
	(send_requirement, get_dependencies_data_reset, send_dependency): Remove
	functions.
	(client_state_t, omp_xml_handle_end_element): Remove
	CLIENT_GET_DEPENDENCIES state and its handling case.

	* src/ompd.c: Remove irrelevant dead code.

	* src/otp.c (free_g_slist, current_scanner_plugin_dependency_name)
	(current_scanner_plugin_dependency_dependencies)
	(make_scanner_plugins_dependencies, add_scanner_plugins_dependency)
	(make_current_scanner_plugin_dependency)
	(append_to_current_scanner_plugin_dependency)
	(finish_current_scanner_plugin_dependency)
	(parse_scanner_plugin_dependency_dependency)
	(SCANNER_PLUGIN_DEPENDENCY_NAME, SCANNER_PLUGIN_DEPENDENCY_DEPENDENCY):
	Remove unused functions, variables and scanner states.
	(parse_scanner_server, process_otp_scanner_input): Remove handling of
	PLUGINS_DEPENDENCIES server command and scanner states.

2014-03-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Add scan-time record of slave and source interface to reports.  Hence
	increase database version to 114.  Add database migration from version
	113 to 114.

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

	* src/manage_migrators.c (migrate_113_to_114): New function.
	(database_migrators): Add migrate_113_to_114.

	* src/manage_sql.c (create_tables): Add slave and iface columns to
	reports.
	(report_slave_uuid, report_slave_name, report_slave_host)
	(report_slave_port, report_source_iface, report_set_slave_uuid)
	(report_set_slave_name, report_set_slave_host, report_set_slave_port)
	(report_set_source_iface): New functions.
	(print_report_xml): Add SCAN.

	* src/manage.c (run_slave_task): Store slave info on report.
	(run_task): Store source_iface and slave info on report.

	* src/manage.h: Add headers accordingly.

	* doc/db_postgres.sql (reports): Add new columns.

	* doc/db.png: Update from source.

	* src/schema_formats/XML/OMP.xml (report): Add SCAN.

	* doc/omp.html, doc/omp.rnc: Update from source.

2014-03-14  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/openvasmd.c (update_or_rebuild_nvt_cache): Move switch case 1 down
	as it falls through for cleanup.

2014-03-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Retrieve progress indication lost in last commit.

	* src/openvasmd.c (rebuild_nvt_cache_retry): Add progress arg.  Call
	while waiting for scanner.
	(fork_update_nvt_cache, main): Pass progress arg to
	rebuild_nvt_cache_retry.

2014-03-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Make --rebuild and --update wait for scanner when scanner is busy
	loading NVTs.  This matches the behaviour when rebuild is called via
	SIGHUP.

	* src/openvasmd.c (rebuild_nvt_cache_retry): Add args for rebuild type
	and cleanup.  Add return.
	(fork_update_nvt_cache): Pass rebuild_nvt_cache_retry args.
	(main): Call the forking retry function to do the rebuild.

2014-03-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_user): Add missing SQL quote.

2014-03-13  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/openvasmd.c (spawn_reloader): Rename to rebuild_nvt_cache_retry.

2014-03-13  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/openvasmd.c (spawn_reloader): New function.
	(fork_update_nvt_cache): Rebuild nvt cache by calling new functino.

2014-03-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otp.c (process_otp_scanner_input): Advance buffer positions over
	the OTP_LOADING message after seeing it.

2014-03-13  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/ompd.c (serve_omp): Return 2 in scanner still loading case.

	* sr/openvasmd.c (update_or_rebuild_nvt_cache): Set process title
	accordingly. Handle new serve_omp() return value.
	(main): Handle update_or_rebuild_nvt_cache() return value.

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

	* src/report_formats/CPE/CPE.xsl (report): Get CPEs from host details.

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

	* src/manage.h, src/omp.c: Remove useless includes.

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

	Remove handling of CERTIFICATES otp command.

	* src/manage.c (scanner): Adjust initialization.

	* src/manage.h (scanner_t): Remove certificates element.

	* src/otp.c (init_otp_data): Adjust initialization of scanner.
	(scanner_state_t): Remove scanner states related to CERTIFICATES
	command.
	(current_certificates, current_certificate): Remove variables.
	(parse_scanner_certificate_public_key): Remove function.
	(parse_scanner_server, process_otp_scanner_input): Remove handling of
	CERTIFICATES command.

2014-03-12  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number to openvas-manager-5.0+beta10.

2014-03-12  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 5.0+beta9 release.

	* CHANGES: Updated.

2014-03-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_config_host_discovery.c: Correct description.

2014-03-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Add new predefined config System Discovery.

	* src/manage_sql.c (check_db): Make System Discovery config.
	(delete_config, config_in_use, delete_user): Add System Discovery
	config.

	* src/manage_sql.h (CONFIG_UUID_SYSTEM_DISCOVERY)
	(MANAGE_NVT_SELECTOR_UUID_SYSTEM_DISCOVERY): New defines.

	* src/manage_config_system_discovery.c: New file.

	* src/CMakeLists.txt: Add manage_config_system_discovery.c to manage
	library.
	(C_FILES): Add config source files.

2014-03-11  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/ompd.c (serve_omp): Add check for process_otp_scanner_input()
	return value.

	* src/otp.c (process_otp_scanner_input): Check for OTP_LOADING server
	response.

2014-03-11  Matthew Mundell <matthew.mundell@greenbone.net>

	Increase database version to 113 in order to reset report count cache.
	Add database migration from version 112 to 113.

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

	* src/manage_migrators.c (migrate_112_to_113): New function.
	(database_migrators): Add migrate_112_to_113.

	* doc/db.png: Update for version change.

2014-03-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (report_severity_data): Move comment.  Correct
	indent.

2014-03-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (cache_report_counts): Weight max by a small safe
	value in severity comparison, to prevent floating point errors.

2014-03-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (buffer_notes_xml, buffer_overrides_xml): Use utf8 function
	to truncate text, as strndup could truncate in the middle of a
	character.

2014-03-07  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/openvasmd.c (main): Set process title before and after
	initialization.

2014-03-06  Benot Allard  <benoit.allard@greenbone.net>

	* doc/openvasmd.8: Fix typo reported by lintian

2014-03-06  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number to openvas-manager-5.0+beta9.

2014-03-06  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 5.0+beta8 release.

	* CHANGES: Updated.

2014-03-05  Matthew Mundell <matthew.mundell@greenbone.net>

	Let Host Discovery fall back on more Ping Host defaults.  Hence increase
	database version to 112.  Add database migration from version 111 to 112.

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

	* src/manage_migrators.c (migrate_111_to_112): New function.
	(database_migrators): Add migrate_111_to_112.

	* src/manage_config_host_discovery.c (make_config_host_discovery): Take
	out some Ping Host preferences so that the NVT defaults are used.

	* doc/db.png: Update for version change.

2014-03-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_lsc_credential): Prevent backslash in
	password.

2014-03-05  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c, src/manage.h (manage_scap_update_time): Constify
	returned pointer.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_INFO case,
	remove repeated call to manage_scap_update_time() for every info entry.

2014-03-04  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/lsc_user.c (lsc_user_all_create): Remove unused function.

	* src/manage.c (severity_data_count, request_certificates)
	(manage_cert_update_time): Remove unused functions.

	* src/manage_sql.c (task_user_iterator_task, task_user_iterator_user)
	(task_group_iterator_task, task_group_iterator_group)
	(task_role_iterator_task, task_role_iterator_role, trash_task_count)
	(task_start_time, task_end_time, find_result)
	(prognosis_iterator_cvss_int, result_iterator_nvt_cvss_base_double)
	(manage_report_host_has_results, clear_task_results_cache, find_report)
	(task_file_iterator_length, nvts_size, nvt_family, config_family_count)
	(trash_config_family_count, config_nvt_count, trash_config_nvt_count)
	(init_task_preferences_iterator, task_preference_iterator_task_value)
	(find_agent, agent_name, find_note, find_override)
	(task_schedule_iterator_schedule, set_slave_host)
	(port_range_iterator_exclude, setting_dynamic_severity)
	(find_user_with_permission, find_tag, tag_name_count): Remove unused
	functions.

	* src/otp.c (print_port, port_protocol_name): Remove unused functions
	and code.

	* src/lsc_user.h, src/manage.h: Delete removed functions prototypes.

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

	Remove new style NVT special casing from report formats.  All NVTs are
	expected in the new style now.

	* src/report_formats/CSV_Results/CSV_Results.xsl,
	src/report_formats/NBE/NBE.xsl (openvas:newstyle-nvt): Remove.
	(result): Remove check.

	* src/report_formats/HTML/HTML.xsl,
	src/report_formats/TXT/TXT.xsl (openvas:newstyle-nvt): Remove.
	(result [issue]): Remove check.

	* src/report_formats/LaTeX/latex.xsl (openvas:newstyle-nvt): Remove.
	(result-details-host-port-threat): Remove check.

2014-02-27  Benot Allard  <benoit.allard@greenbone.net>

	Post release version Bump.

	* CMakeLists.txt: Update version to 5.0+beta8

2014-02-27  Benot Allard  <benoit.allard@greenbone.net>

	Preparing the openvas-manager 5.0+beta7 release.

	* CHANGES: Updated.

2014-02-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Add defaults to copy switches,
	for safety.

2014-02-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Skip alerts with ID 0, as a
	convenience for clients when removing alerts.

2014-02-25  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Fix error message.

2014-02-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml: Add GET_TARGETS compatibility change.

	* doc/omp.html: Update from source.

2014-02-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Update OMP version to 5.0.

	* src/schema_formats/XML/OMP.xml (version): Increase to 5.0.

	* doc/omp.html, doc/omp.rnc: Update from source.

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

	* src/omp.c (send_get_common): Include permission type in special case
	for PERMISSIONS, because Admin users have full action to permissions
	that apply to whole commands.

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

	* src/html/XML/OMP.xml (alive_test): New type.
	(report): Add SEVERITY_CLASS.
	(create_target, get_targets, modify_target): Add ALIVE_TESTS,
	REVERSE_LOOKUP_ONLY and REVERSE_LOOKUP_UNIFY.

	* doc/omp.html, doc/omp.rnc: Update from source.

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

	* src/wizards/delete_task_deep.xml: Add optional parameter "ultimate".

	* src/wizards/get_tasks_deep.xml: Add optional "include_report_formats"
	and "include_configs" parameters.

	* src/wizards/quick_auth_scan.xml: Add optional "config_id" parameter.

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

	* src/manage.c (send_alive_test_preferences): Remove erroneous trailing
	colons.

2014-02-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (modify_target): Actually prevent "in use" targets
	from being modified.

	* src/omp.c (omp_xml_handle_end_element): Handle new modify_target
	return.

2014-02-15  Matthew Mundell <matthew.mundell@greenbone.net>

	Remove need for all elements to be given in MODIFY_TARGET.

	* src/manage_sql.c (modify_target): Modify each column separately,
	leaving the column alone if the given value is NULL.  This allows the
	OMP user to modify part of the target in a single command, instead of
	requiring every field to be given.
	(target_writable): Allow "in use" targets to be modified.

	* src/omp.c (omp_xml_handle_start_element): Init MODIFY_TARGET elements,
	so that they have at least the empty string when empty.
	(omp_xml_handle_end_element): Handle new style of modify_target call.

2014-02-16  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number to openvas-manager-5.0+beta7.

2014-02-16  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Preparing the openvas-manager 5.0+beta6 release.

	* CHANGES: Updated.

2014-02-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_migrators.c (migrate_56_to_57): Add note about missing
	case.

2014-02-14  Michael Wiegand <michael.wiegand@greenbone.net>

	* tools/greenbone-certdata-sync, tools/openvas-scapdata-sync.in,
	tools/openvas-certdata-sync.in, tools/greenbone-scapdata-sync: Use the
	"timestamp" file for the "last_update" value instead of the current
	system time. Otherwise actions like "--migrate" would incorrectly
	update the timestamp even though no data was updated.

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

	* src/manage_migrators.c (migrate_110_to_111): Add column to trash table
	too.

	* src/manage_sql.c (delete_target, manage_restore): Add alive_test
	column.

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

	Add modification of target alive tests.

	* src/omp.c (modify_target_data_t, modify_target_data_reset)
	(client_state_t): Add alive test elements.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add
	ALIVE_TESTS to MODIFY_TARGET.

	* src/manage_sql.c (alive_test_from_string): New function.
	(create_target): Use alive_test_from_string.
	(modify_target): Add alive_tests arg.

	* src/manage.h: Update header accordingly.

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

	Add an Alive Test property to Targets, which can override the config
	settings.  Hence increase database version to 111.  Add database
	migration from version 110 to 111.

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

	* src/manage_migrators.c (migrate_110_to_111): New function.
	(database_migrators): Add migrate_110_to_111.

	* src/manage_sql.c (create_tables): Add alive_test to targets tables.
	(add_role_permission, init_manage, set_task_groups, set_task_observers)
	(create_target): Add alive_tests arg.
	(TARGET_ITERATOR_COLUMNS): Add alive_tests column.
	(target_iterator_alive_tests): New accessor.
	(target_alive_test): New function.

	* src/manage.c (send_alive_test_preferences): New function.
	(run_task): Send alive test preferences after others.

	* src/manage.h: Update headers accordingly.
	(alive_test_t): New type.

	* src/omp.c (create_target_data_t, create_target_data_reset)
	(client_state_t): Add alive test fields.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add ALIVE_TEST to CREATE_TARGET.

	* doc/db_postgres.sql (targets): Add alive_test.

	* doc/db.png: Update from source.

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

	* src/manage_sql.c (init_manage_settings, modify_setting): Add User
	Interface Language.

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

	* src/manage_sql.c (init_setting_iterator): Group conditions in SQL else
	precedence is wrong.

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

	* src/manage_sql.c (manage_count_hosts): Call openvas_hosts_new_with_max
	with manage_max_hosts return value instead of openvas_hosts_new.

2014-02-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_start_element)
	(omp_xml_handle_end_element): Read over TRUST when importing report
	formats, to handle the new TIME element.

2014-02-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (send_get_end): Quote keyword value if it was quoted
	in the filter term.

2014-02-10  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Fix various memory leaks and errors. Found using cppchecker.

	* src/manage_sql.c (escalate_2): Use g_free for port variable to match
	the way it was allocated.
	(print_report_xml): Close out stream and free term variable before
	return on error.  Check print_report_errors_xml() return value
	adequately.
	(create_override, modify_override): Free quoted_severity before return
	on error.
	(modify_schedule): Free period_months_string memory leak.

	* src/omp.c (omp_xml_handle_end_element): Call SEND_GET_ELEMENT earlier
	in CLIENT_GET_TASKS to fix memory leaks in case of error. Call g_free()
	for task_schedule_uuid and task_schedule_name to match allocation
	method.

2014-02-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/LaTeX/latex.xsl
	(highest-severity-for-host): Remove.
	(results-overview-table-single-host-row): Put the hostname on a second
	line in the Host cell.
	(results-overview): Remove "Most Severe Result(s)" column.  It's
	redundant, no other formats have it and there's no special indication
	of why it was included.  Make last column heading singular like others.

2014-02-06  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/sql.c (sql_nquote): Small changes to string allocation and parsing
	to improve performance a bit.

2014-02-06  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Remove OTP ERROR command handling as it is not used anymore.

	* src/otp.c (scanner_state_t): Remove SCANNER_ERROR state.
	(parse_scanner_error): Delete function.
	(process_otp_scanner_input): Remove SCANNER_ERROR state and ERROR
	command handling.

2014-02-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (stop_task_internal): Only check if scanner is up when
	scanner is required.

2014-02-06  Timo Pollmeier <timo.pollmeier@greenbone.net>

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

	* src/manage.h (find_trash_task_with_permission): New prototype.

	* src/omp.c (xml_handle_end_element): In cases for CLIENT_MODIFY_NOTE
	and CLIENT_MODIFY_OVERRIDE allow task_id to refer to a task in the
	trashcan.

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

	* src/manage_sql.c (trim_partial_report): Correct SQL keyword.

2014-02-05  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (create_target): Remove default value of port_range.

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

	Add option --list-users.

	* src/manage.h: Add header accordingly.

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

	* src/openvasmd.c (main): Add --list-users.

2014-02-05  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.h: Include base/openvas_networking.h
	(port_protocol_t, struct range): Remove, as they are moved to libraries.

	* src/manage_sql.c (port_range_ranges): Remove function definition.
	Remove extra include.

2014-02-04  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c: Include base/openvas_networking.h
	(validate_port_range): Delete function.

2014-02-04  Michael Wiegand <michael.wiegand@greenbone.net>

	* tools/greenbone-certdata-sync: Move declaration of SCRIPT_NAME up to
	make it available to LOG_CMD.

2014-02-04  Michael Wiegand <michael.wiegand@greenbone.net>

	* tools/greenbone-certdata-sync, tools/greenbone-scapdata-sync: Do not
	check if feed is current when REFRESH_ONLY is set.

2014-02-03  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/CMakeLists.txt: Link against math library. Fixes build on some
	environments.

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

	* src/manage.c (severity_class_xml): New function.
	(print_report_xml): Include severity class.

2014-01-30  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* INSTALL: Add section about static code analysis with CLang.

2014-01-30  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Removed unnecessary
	0-initialization of variable 'fail'.

2014-01-29  Benot Allard  <benoit.allard@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number to openvas-manager-5.0+beta6.

2014-01-29  Benot Allard  <benoit.allard@greenbone.net>

	* ChangeLog: correct authorship of an old patch
	* CHANGES: Prepare 5.0+beta5 release

2014-01-28  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* tools/extra/README: Fixed typos and added note on how
	to enable the functionality.

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

	* src/manage.c (): Add math.h import.
	(severity_data_index): Round before casting to int to avoid problems
	with inexact double values.

	* src/manage_sql.c (print_report_xml): Use result severity level
	instead of type when counting delta results.

2014-01-28  Benot Allard  <benoit.allard@greenbone.net>

	Add xml_split, a utility to split a huge xml into smaller parts. Its
	usage is disabled.

	* tools/openvas-scapdata-sync.ini, tools/greenbone-scapdata-sync: Add
	  possibility to use the xml_split utility.
	* tools/extra/xml_split, tools/extra/README: Add new utility, and
	  explanation.

2014-01-28  Benot Allard  <benoit.allard@greenbone.net>

	Solve issues raised by clang static analyser

	* src/openvasmd.c (load_cas): Null pointer passed as an argument to a
	  'nonnull' parameter
	(handle_sigabrt): Array access results in a null pointer dereference
	* src/manage_sql.c (parse_iso_time, current_offset, delete_user,
	  iso_time_tz, parse_otp_time, filter_clause, time_offset): Null
	  pointer passed as an argument to a 'nonnull' parameter
	  (create_group, print_report_xml): Dereference of null pointer
	* src/manage_migrators.c (migrate_19_to_20): Function call argument is
	  an uninitialized value

2014-01-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* report_formats/verinice-ism/gsm_verinice_ism.xsl (openvas:get-nvt-tag)
	(openvas:newstyle-nvt): New functions.
	(newline, prognostic-description): New templates.
	(vulnerability_details): Add new style NVT sections to description.
	(/): Flush trailing whitespace.

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

	* src/manage_sql.c (check_db_versions, stop_active_tasks): New
	functions.  Bodies from init_manage.
	(init_manage): Move more checks out to functions, for clarity.

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

	* src/manage_sql.c (check_db): New function.  Body from init_manage.
	(init_manage): Move all the database checking out to check_db, for
	clarity.

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

	* src/report_formats/CSV_Results/CSV_Results.xsl (openvas:report): New
	function.
	(newline): New template.
	(openvas:new-style-nvt): Remove.  Renamed to newstyle-nvt to match other
	formats.
	(openvas:newstyle-nvt): New function.  Was new-style-nvt.
	(result): Add description columns for new style NVTs, as well as new
	reference columns.
	(report): Remove spaces for consistency.

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

	* src/omp.c (omp_xml_handle_end_element): In the SYNC ops, set
	current_error to 4 instead of 2 when the child has succeeded, to
	indicate that the process must exit.

	* src/ompd.c (serve_omp): Handle new return 4 from
	process_omp_client_input, by exiting.

2014-01-23  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Call the correct sync script
	when asking the script to do a selftest while getting the description
	for the CERT synchronization script.

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

	* ChangeLog: Cleanup last entry.

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

	* src/report_formats/NBE/NBE.xsl (openvas:get-nvt-tag)
	(openvas:newstyle-nvt): New functions.
	(scan_start, scan_end): Use xsl:text.  Add newline.
	(prognostic-description, ref_cve_list, ref_bid_list, ref_cert_list)
	(ref_xref_list): New templates.
	(result): Add description sections for new style NVTs.
	(report): Use xsl:text.

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

	* src/report_formats/NBE/NBE.xsl (result): Use xsl:text to spread the
	description code out.

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

	* src/report_formats/TXT/TXT.xsl (openvas:get-nvt-tag)
	(openvas:newstyle-nvt): New functions.
	(nvt): Remove.
	(prognostic-description, ref_cve_list, ref_bid_list, ref_cert_list)
	(ref_xref_list): New templates.
	(result [issue]): Add description sections for new style NVTs.

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

	* src/manage_sql.c (resource_count): Exclude reports of hidden tasks
	when counting reports.

2014-01-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_acl.c (where_owned): Let the user inherit report
	permissions from the task, so that observers can see the list of reports
	on a task like they can see the report details.

2014-01-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_delete_user): Set the return value.

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

	* src/manage_sql.c (port_range_port_list_uuid): Correct column in SQL.

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

	* src/omp.c (omp_xml_handle_end_element): Correct MODIFY_GROUP message.

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

	* src/omp.c (omp_xml_handle_end_element): Correct CREATE_GROUP message.

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

	* CMakeLists.txt: Add installation of new files:
	src/wizards/get_tasks_deep.xml, src/wizards/delete_task_deep.xml,
	src/wizards/quick_auth_scan.xml, src/wizards/reset_task.xml.

	* src/wizards/delete_task_deep.xml: New wizard.

	* src/wizards/get_tasks_deep.xml: New wizard.

	* src/wizards/quick_auth_scan.xml: New wizard.

	* src/wizards/quick_first_scan.xml: Add copyright and usage comments.

	* src/wizards/reset_task.xml: New wizard.

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

	* src/omp.c (buffer_notes_xml, buffer_overrides_xml): Send permissions
	too.

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

	* src/openvasmd.c (load_cas): Remove debug messages.

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

	* src/omp.c (omp_xml_handle_end_element): Handle new delete_user return.

	* src/manage_sql.c (delete_user): Refuse to delete current user.

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

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

	* src/manage_sql.h: Add header accordingly.  Format headers like others.

	* src/manage_config_host_discovery.c (check_config_host_discovery): Add
	config cache updating.

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

	* src/manage_sql.c (init_manage): Clean up alignment.

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

	* src/report_formats/HTML/HTML.xsl (result [issue]): Replace GSA class
	with explicit style.

2014-01-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/HTML/HTML.xsl (openvas:get-nvt-tag): Correct
	alignment.

	* src/report_formats/LaTeX/latex.xsl (openvas:get-nvt-tag)
	(openvas:newstyle-nvt): New functions.
	(prognostic-description): New template.
	(result-details-host-port-threat): Add description sections for new style
	NVTs.

2014-01-15  Benot Allard  <benoit.allard@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Change version to 5.0+beta5

2014-01-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/HTML/HTML.xsl (openvas:get-nvt-tag)
	(openvas:newstyle-nvt): New functions.
	(structured-text, ref_cve_list, ref_bid_list, ref_cert_list)
	(ref_xref_list): New templates.
	(nvt): Remove.
	(result [issue]): Add description sections for new style NVTs.

2014-01-15  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_migrators.c (manage_migrate): Change log level of CERT
	database not found messages to message. Count missing SCAP / CERT
	databases as current for the purpose of this function.

2014-01-15  Benot Allard  <benoit.allard@greenbone.net>

	* CHANGES: Add mention of the --migrate behavior change, add date

2014-01-15  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* tools/greenbone-certdata-sync (check_db_version): Delete newlines
	from SQLite response.

	* tools/greenbone-scapdata-sync (check_db_version): Delete newlines
	from SQLite response.

	* tools/openvas-certdata-sync.in: If $CERT_DIR is not set, use value
	of cmake variable OPENVAS_CERT_DATA_DIR.
	(check_db_version) Delete newlines from SQLite response.

	* tools/openvas-scapdata-sync.in: If $SCAP_DIR is not set, use value
	of cmake variable OPENVAS_SCAP_DATA_DIR.
	(check_db_version) Delete newlines from SQLite response.

2014-01-15  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (init_manage): Remove extra calls of g_free in
	SCAP / CERT version checks.

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

	* src/manage.c (openvas_get_sync_script_identification): Skip
	returning the identification string via the parameter "identification"
	if the parameter is NULL.
	(openvas_migrate_secinfo): Remove NVT_FEED option from documentation of
	feed_type parameter. Do not get identification string.

	* src/manage_migrators.c (manage_migrate): Add initialization for
	version_current and scap_version_current. Check old_cert_version if
	CERT database exists.

	* src/manage_sql.c (init_manage): Remove extra initialization of
	cert_db_version. Get version number for correct database in error
	messages.

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

	If SCAP and/or CERT database exists, check version on openvasmd startup
	and migrate them to current version on openvasmd --migrate.

	* CMakeLists.txt (OPENVASMD_SCAP_DATABASE_VERSION)
	(OPENVASMD_CERT_DATABASE_VERSION): New variables.

	* src/CMakeLists.txt (OPENVASMD_SCAP_DATABASE_VERSION)
	(OPENVASMD_CERT_DATABASE_VERSION): New "add_definitions".

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

	* src/manage.h (manage_scap_db_supported_version)
	(manage_scap_db_version, manage_cert_db_supported_version)
	(manage_cert_db_version, openvas_migrate_secinfo): New function
	prototypes.

	* src/manage_migrators.c (manage_migrate): Add migration of SCAP and
	CERT databases in case they exist.

	* src/manage_sql.c (manage_scap_db_supported_version)
	(manage_scap_db_version, manage_cert_db_supported_version)
	(manage_cert_db_version): New functions.
	(init_manage): Check version of SCAP and CERT databases, if they exist.

	* src/openvasmd.c (main): Handle new SCAP and CERT related return
	values of manage_migrate.

	* tools/greenbone-scapdata-sync, tools/greenbone-certdata-sync,
	tools/openvas-scapdata-sync.in, tools/openvas-certdata-sync.in: New
	parameter "--migrate"

2014-01-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* CMakeLists.txt (OPENVAS_CA_DIR): Change to trusted_certs for clarity.

2014-01-13  Matthew Mundell <matthew.mundell@greenbone.net>

	Add NVT and "Strictly unauthenticated" preference to Host Discovery
	config.

	* src/manage_sql.c (init_manage): Call check_config_host_discovery.

	* src/manage_config_host_discovery.c (make_config_host_discovery): Align
	SQL values properly.  Correct -PA value, which is redundant anyway.
	Remove duplicate.
	(NAME): New define.
	(check_config_host_discovery): New function.

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

	* src/openvasmd.c (load_cas): Skip "." and "..".

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

	Trust certificates located in var/lib/openvas/openvasmd/CAs.  This helps
	the Scanner use a self-signed certificate.

	* CMakeLists.txt (OPENVAS_CA_DIR): New variable.

	* src/CMakeLists.txt: Add CA_DIR definition.

	* src/openvasmd.c (load_cas): New function.  Loads CAs.
	(serve_client, update_or_rebuild_nvt_cache): Load the CAs.

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

	* src/otp.c (process_otp_scanner_input): In SCANNER_TIME_SCAN_END stop
	the transaction before calling delete_task_lock, because it also runs
	a transaction.

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

	* src/openvasmd.c (main): Use ellispes in message to match Scanner
	better.  Print \b separately.

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

	Add --progress option, which displays a progress spinner during
	--rebuild and --update.

	* src/openvasmd.c (serve_client): Update serve_omp call.
	(spin_progress): New function.
	(update_or_rebuild_nvt_cache): Add progress arg.  Pass to OMP functions.
	(fork_update_nvt_cache): Update update call.
	(main): Add --progress option.

	* src/manage_sql.c (progress): New variable.
	(create_tables, init_manage_process, insert_nvt_from_nvti)
	(manage_complete_nvt_cache_update): Spin at long ops.
	(init_manage): Add progress arg.

	* src/omp.c (init_omp): Add progress arg.

	* src/otp.c (parse_scanner_preference_value)
	(process_otp_scanner_input): Add progress arg.

	* src/ompd.c (init_ompd, serve_omp): Add progress arg.

	* src/ompd.h, src/omp.h, src/manage.h: Update headers accordingly.

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

	* src/manage_sql.c (report_counts_match): Also check whether the NVT
	exists, in the SQL, otherwise sql_int aborts if the NVT has been removed
	from the feed.

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

	* src/manage_migrators.c (migrate_57_to_58, migrate_62_to_63)
	(migrate_67_to_68, migrate_68_to_69, migrate_71_to_72, migrate_72_to_73)
	(migrate_74_to_75, migrate_79_to_80): Ensure tables exist before using
	them.

2014-01-06  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Preparing the openvas-manager 5.0+beta4 release.

	* CHANGES: Updated. No date set yet.

2013-12-27  Michael Wiegand <michael.wiegand@greenbone.net>

	Add support for compressing large attachements.

	* report_formats/verinice-ism/generate: Add support for compressing
	the attached report if it is over 10 MB in size, updating file name
	and MIME type as required.

	* report_formats/verinice-ism/gsm_verinice_ism.xsl: Handle
	htmlmimetype parameter now that the MIME type is dynamic.

2013-12-27  Michael Wiegand <michael.wiegand@greenbone.net>

	* report_formats/verinice-ism/generate: Use date of scan start instead
	of date of report generation in the file names.

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

	* src/manage.c (severity_in_level): Remove duplicate "high" case for
	the "classic" severity class (which was never reached) and fix valid
	CVSS range for first "high" case.

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

	* src/report_formats/CSV_Results/CSV_Results.xsl (result): Skip protocol
	if port is empty.
	(report): Rename OID to NVT OID.

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

	* src/report_formats/CSV_Hosts/CSV_Hosts.xsl (openvas:max-cvss)
	(openvas:ip-pad): New functions.
	(report): Add Scan End column.  Sort hosts by CVSS then IP then Scan
	Start.

2013-12-17  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/manage_sql.c (init_manage): Made upper limit of ips allow 40000
	instead of 39999.

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

	* src/otp.c (parse_scanner_certificate_public_key)
	(parse_scanner_preference_value, parse_scanner_plugin_list_tags): Use
	message value directly instead of calling messages_value to encode in
	UTF-8 as scanner does it now.
	(process_otp_scanner_input): Adjust code to messages being already UTF-8
	encoded.

	(blank_control_chars, messages_value): Remove unused function.

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

	Add new option --max-ips-per-target.

	* src/manage_sql.c (max_hosts): New variable.
	(init_manage): Add max_ips_per_target arg.
	(manage_max_hosts): New function.
	(create_target, modify_target): Switch to max hosts variable.

	* src/omp.c (omp_xml_handle_end_element): Switch to max hosts function.
	(init_omp): Add max_ips_per_target arg.

	* src/ompd.c (init_ompd): Add max_ips_per_target arg.

	* src/manage.h, src/omp.h, src/ompd.h: Udpate headers accordingly.

	* src/openvasmd.c (update_or_rebuild_nvt_cache): Update init_ompd call.
	(main): Add --max-ips-per-target.  Update init_ompd call.

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

	* src/manage_sql.c (init_manage): Rename CSV Summary to CSV Hosts.

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

	* src/report_formats/CSV_Summary: Actually remove dir.

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

	* src/report_formats/CSV_Hosts/CSV_Summary.xsl: Remove.  Renamed.

	* src/report_formats/CSV_Hosts/CSV_Hosts.xsl: New file.
	Was CSV_Summary.xsl.

	* src/report_formats/CSV_Hosts/generate: Update file name.

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

	* CMakeLists.txt: Rename CSV_Summary to CSV_Hosts.

	* src/report_formats/CSV_Summary,
	src/report_formats/CSV_Summary/CSV_Summary.xsl,
	src/report_formats/CSV_Summary/generate: Remove.  Renamed.

	* src/report_formats/CSV_Hosts: New dir.  Was CSV_Summary.

	* src/report_formats/CSV_Hosts/CSV_Summary.xsl,
	src/report_formats/CSV_Hosts/generate: New files.  From CSV_Summary.

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

	* src/report_formats/CSV_Results/CSV_Summary.xsl (result): Move NVT Name
	and IP.  Add CVSS.

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

	* src/report_formats/CSV_Results/CSV_Results.xsl (result): Move NVT Name
	and Summary forward.
	(report): Rename a few columns.

2013-12-13  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/schema_formats/XML/OMP.xml (run_wizard): Add read_only attribute
	to command.

	* doc/omp.html, doc/omp.rnc: Update from source.

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

	* src/report_formats/CSV_Results/CSV_Results.xsl
	(openvas:new-style-nvt): New function.  From GSA.
	(result): Move Result ID to the end.  Add Detection Result in its place.
	Do quoting in Task Name.
	(report): Move Result ID to the end.  Add Detection Result in its place.

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

	* src/report_formats/CSV_Results/CSV_Results.xsl
	(openvas:get-nvt-tag): New template.
	(quote, two-quotes): New params.
	(results): Add more fields.  Indent normally.  Replace " with "" in
	summary.
	(/report): Add heading.  Indent normally.

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

	Add new predefined report format CSV Results.  Based on the Sourcefire
	report format.

	* src/manage_sql.c (init_manage): Setup CSV Results.
	(report_format_predefined): Add CSV Results.

	* src/report_formats/CSV_Results: New dir.

	* src/report_formats/CSV_Results/CSV_Results.xsl,
	src/report_formats/CSV_Results/generate: New files.

	* CMakeLists.txt: Add CSV Results report format.

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

	Add new predefined report format CSV Summary.  Report format written by
	Henri Doreau.

	* src/manage_sql.c (init_manage): Setup CSV Summary.
	(report_format_predefined): Add CSV Summary.

	* src/report_formats/create_signatures: Replace spaces with underscores in
	name.

	* src/report_formats/CSV_Summary: New dir.

	* src/report_formats/CSV_Summary/CSV_Summary.xsl,
	src/report_formats/CSV_Summary/generate: New files.

	* CMakeLists.txt: Add CSV Summary report format.

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

	* src/manage.c (slave_setup): Request passwords from
	buffer_config_preference_xml.

	* src/omp.c (buffer_config_preference_xml): Add hide_passwords param.
	Update callers.

2013-12-09  Michael Wiegand <michael.wiegand@greenbone.net>

	* report_formats/verinice-ism/gsm_verinice_ism.xsl: Improve support
	for "Info" assets.

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

	* src/manage.c (manage_run_wizard): Add missing check for read_only
	parameter.

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

	* src/manage_sql.c (nvt_preference_iterator_real_name): Duplicate to the
	end of the string, because there's always a trailing zero and the sscanf
	expression may cut the preference name short if it contains special
	characters.

	* src/otp.c (message_value): New function.
	(parse_scanner_certificate_public_key, parse_scanner_preference_value)
	(parse_scanner_plugin_list_tags): Use messages_value to get value, so
	that UTF-8 conversion is done.
	(parse_scanner_plugin_dependency_dependency): Add note about conversion.

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

	Add parameter to disable or enable attaching of the HTML report to the
	verinice ISM report.

	* report_formats/verinice-ism/generate: Generate HTML report only when
	requested.

	* report_formats/verinice-ism/gsm_verinice_ism.xsl: Only include HTML
	report if it was requested.

	* report_formats/verinice-ism/create_report_import: Add support for
	parameters, include HTML report parameter. Add support for inline
	signature. Bump version.

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

	* src/manage.c (manage_run_wizard): Add read_only parameter and check
	wizard XML for a read_only element if it is true.

	* src/manage.h (manage_run_wizard): Add new parameter.

	* src/omp.c (run_wizard_data_t, run_wizard_data_reset): Add read_only
	component.
	(omp_xml_handle_start_element): Add read_only attribute to RUN_WIZARD.
	(omp_xml_handle_end_element): Add parameter and error message for
	read_only check in CLIENT_RUN_WIZARD case.

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

	* src/manage_sql.c (PERMISSION_ITERATOR_FILTER_COLUMNS): Add
	subject_uuid.

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

	* src/manage.c (manage_run_wizard): Return response of last command via
	new ret_response parameter.

	* src/manage.h (manage_run_wizard): Add new parameter.

	* src/omp.c (omp_xml_handle_end_element): Add response of last command
	run by wizard to RUN_WIZARD response.

	* src/schema_formats/XML/OMP.xml (run_wizard): Add response of last
	command to response.

	* doc/omp.html, doc/omp.rnc: Update from source.

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

	* src/manage_migrators.c (migrate_79_to_80): Check if users-remote
	directory exists before trying to remove it.

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

	Add new report format plugin for exporting TLS mapping results into a
	CSV file.

	* report_formats/tls-map/, report_formats/tls-map/tls-map.xsl,
	report_formats/tls-map/create_report_import,
	report_formats/tls-map/generate: New.

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

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

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

	* src/manage_sql.c (REPORT_FORMAT_ITERATOR_COLUMNS): Move the _owner
	selection in the last field to replace the dummy owner selection in the
	usual position.  This was preventing messing up the permissions in
	GET_REPORT_FORMAT.
	(REPORT_FORMAT_ITERATOR_TRASH_COLUMNS): Match to table case.

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

	* src/manage_sql.c (parse_keyword): Only test the number cases when
	there are actually leading digits, otherwise terms like subject=y are
	treated as dates.

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

	* INSTALL: Update option name.

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

	* src/openvasmd.c (main): Add option --delete-user.

	* src/manage_sql.c (manage_delete_user): New function.
	(delete_user): Correct value in doc.

	* src/manage.h: Add header accordingly.

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

	* src/openvasmd.c (main): Rename option --first-user to --create-user.
	Add --role, which allows to set the role with --first-user.

	* src/manage_sql.c (find_resource_by_name): New function.  Body from
	find_user_by_name.
	(find_role_by_name, role_uuid): New functions.
	(manage_first_user): Remove.  Now manage_create_user.
	(manage_create_user): New function.  Was manage_create_user.  Add role
	arg.  Remove storage of username in meta.
	(find_user_by_name): Call find_resource_by_name.

	* src/manage.h: Update headers accordingly.

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

	* src/manage_sql.c (print_report_prognostic_xml): Do the variable inits
	in one place.  Count the hosts being looped over, instead of counting
	all hosts for each report.  Similarly for apps, buffer unique CPE names
	in the loop and count them at the end, instead of counting all CPEs on
	the reports associated with the hosts.

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

	* src/manage_sql.c (manage_first_user): Return the value of create_user,
	so that the exit code is EXIT_FAILURE when there is a problem.

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

	* src/manage_sql.c (init_task_user_iterator): Remove name clause.  Add
	locations.
	(init_task_group_iterator): Add subject location.

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

	* src/manage_sql.c (permissions_set_locations)
	(permissions_set_orphans): Add trash cases.

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

	* src/manage_sql.c (PERMISSION_ITERATOR_COLUMNS)
	(PERMISSION_ITERATOR_TRASH_COLUMNS): Add subject_location checks to
	subject selection.  Add subject_location field.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_end_element): Add TRASH to SUBJECT in
	GET_PERMISSIONS.

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

	Track trash/table location of groups in permissions.  Hence increase
	database version to 110.  Add database migration from version 109 to
	110.

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

	* src/manage_migrators.c (migrate_109_to_110): New function.
	(database_migrators): Add migrate_109_to_110.

	* src/manage_sql.c (create_tables): Add subject_location to permissions
	tables.
	(add_role_permission, init_manage, set_task_groups, set_task_observers)
	(copy_task): Handle subject_location when inserting a permission.
	(delete_group): Delete permissions assigned to group.  When moving to
	trashcan adjust subject in permissions.
	(permissions_set_subjects): New function.
	(create_permission, delete_permission): Handle subject_location when
	inserting a permission.
	(copy_permission): Add subject_location to fields.
	(manage_restore): When restoring group adjust subject in permissions.
	Add subject_location to group insert.

	* doc/db.png: Update for version change.

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

	* src/manage_sql.c (delete_group): Use the trash check when in trashcan.
	(group_in_use): Remove dependence on permission.  This is probably more
	the expected behaviour.
	(delete_user): Delete user's permissions and permissions assigned to
	user.  Remove trailing paren errors that were hidden by the sql function
	error.

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

	* src/omp.c (send_get_common): Add special cases for the permissions of
	the shared types, because their access is determined by the command
	level permissions.

	* src/manage.h: Extern user_can_everything for omp.c.

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

	* src/sql.c (sql): Correct return value in conditional.  This was hiding
	SQL errors.

	* src/manage_sql.c (copy_resource_lock): Add owner value for the admin
	case.
	(create_tables): Add "IF NOT EXISTS" to index SQL.

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

	* src/ompd.c (serve_omp): In more places check client_active before
	closing the client socket.

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

	Mark permissions when the associated resource is deleted.

	* src/manage_sql.c (delete_alert, delete_report_internal)
	(delete_target, delete_config, delete_lsc_credential, delete_agent)
	(delete_note, delete_override, delete_schedule, delete_report_format)
	(delete_slave, delete_port_list, delete_filter, delete_tag): Set
	orphan in permission when ultimately removing resource from db.
	(request_delete_task_uuid): Remove setting of locations.  Better done in
	delete_task.
	(delete_task): Set orphan and location.
	(delete_group): Remove setting of location, as resource permissions are
	prevented on groups.
	(permissions_set_locations): Add missing location clause.
	(permissions_set_orphans): New function.
	(PERMISSION_ITERATOR_COLUMNS, PERMISSION_ITERATOR_TRASH_COLUMNS): Add
	orphan field.  Adjust accessors accordingly.
	(permission_iterator_resource_orphan): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In GET_PERMISSION mark
	resource as deleted if it has been.

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

	Add trash indicator to RESOURCE in GET_PERMISSIONS response.

	* src/manage_sql.c (resource_name): New function.  Body from
	sql_resource_name, with added location arg for trash case.
	(init_manage): Add new resource_name arg.
	(PERMISSION_ITERATOR_COLUMNS, PERMISSION_ITERATOR_TRASH_COLUMNS): Add
	resource location.  Adjust accessors accordingly.
	(permission_iterator_resource_in_trash): New function.
	(TAG_ITERATOR_COLUMNS): Pass location to resource_name.  Cleanup
	formatting.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_end_element): Add trash indicator to
	GET_PERMISSIONS response.

	* src/sql.c (sql_resource_name): Call out to resource_name.
	(sql_severity_in_level): Correct doc typo.

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

	* src/manage_sql.c (delete_alert, request_delete_task_uuid)
	(delete_target, delete_config, delete_lsc_credential, delete_agent)
	(delete_note, delete_override, delete_schedule, delete_report_format)
	(delete_slave, delete_group, delete_port_list, delete_filter)
	(delete_tag): Adjust location in permission when moving to trash.
	(permissions_set_locations): New function.
	(manage_restore): Adjust location in permission.

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

	* src/manage_config_discovery.c (NVT_SELECTOR): Put the column names in,
	at least for clarity.  Use NVT_SELECTOR_TYPE_ALL instead of 2.
	(make_config_discovery): Match transaction SQL to rest of Manager.

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

	Add new predefined config Host Discovery.

	* src/manage_sql.c (init_manage): Make Host Discovery config.
	(delete_config, config_in_use, delete_user): Add Host Discovery config.

	* src/manage.h (CONFIG_UUID_HOST_DISCOVERY)
	(MANAGE_NVT_SELECTOR_UUID_HOST_DISCOVERY): New defines.

	* src/manage_config_host_discovery.c: New file.

	* src/CMakeLists.txt: Add manage_config_host_discovery.c to manage
	library.
	(C_FILES): Add config source files.

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

	* src/manage_sql.c (copy_resource_lock): Refuse to clone other people's
	property, because the permissions on the dependant resources may change.

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

	* src/manage_sql.c (modify_setting): Add Permissions Filter.

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

	Post release version bump.

	* CMakeLists.txt: Updated version number to 5.0+beta4.

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

	Preparing the openvas-manager 5.0+beta3 release.

	* CHANGES: Updated.

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

	Increase database version to 109 to ensure that permission all use full
	command names.  Add database migration from version 108 to 109.

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

	* src/manage_migrators.c (migrate_108_to_109): New function.
	(database_migrators): Add migrate_108_to_109.

	* doc/db.png: Update for version change.

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

	* src/manage_sql.c (modify_permission): Only do the takes_resource check
	when there is a resource, and return an error instead of clearing the
	id, otherwise the permission will be upgraded to a command level
	permission.  Use permission instead of resource when getting command
	name from permission.  Free command after use, instead of before.
	Ensure that the user may grant the permission.  Clear the owner if it's
	a command level permission.

	* src/omp.c (omp_xml_handle_end_element): Handle new modify_permission
	return.

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

	* src/manage_sql.c (copy_resource_lock): Use the current owner in all
	cases.
	(copy_permission): Clear the owner after if it's a command level
	permission.
	(modify_permission): Set resource_type only when there's a resource_id,
	otherwise the permission permission gets a type.

	* src/sql.c (sql_resource_name): Include type in error message.

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

	* src/manage_sql.c (print_report_prognostic_xml): Apply overrides to
	hosts if apply_overrides is true.

	* src/omp.c (omp_xml_handle_start_element): Add attribute
	host_search_phrase to GET_REPORTS.

	* src/schema_formats/XML/OMP.xml (get_reports): Add host_search_phrase
	attribute to command.

	* doc/omp.html, doc/omp.rnc: Update from source.

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

	* src/manage_sql.c (set_task_groups, set_task_observers): Use full
	permission name.

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

	* src/manage_acl.c (user_is_user): New function.

	* src/manage.h: Add header accordingly.

	* src/manage_sql.c (authenticate): Check if user actually has the User
	role.

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

	* src/manage_sql.c (init_manage): Allow observers to get and modify
	their settings.

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

	* src/manage_sql.c (init_prognosis_iterator): Cast CVSS to numeric
	instead of integer to avoid rounding.
	(prognosis_order_by): New function.
	(init_host_prognosis_iterator): Add sorting field and order parameters.
	(prognostic_report_result_count): Remove ORDER BY clauses not needed
	for counting.
	(print_report_prognostic_xml): Add sorting field and order parameters.
	(print_report_xml): Use sorting field and order also for prognostic
	reports.

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

	* src/omp.c (send_get_common): Send user's permissions on the resource.

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

	* src/manage_acl.c (type_is_shared): Remove types, as the operation
	level permissions prevent regular users from even using the associated
	commands anyway.

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

	* src/manage_sql.c (manage_first_user, manage_set_password): Init
	openvas_auth.

	* src/openvasmd.c (main): Check openvas_auth_init_funcs return.

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

	* src/manage_acl.c (USER_MAY): Remove.  Duplicate.
	(user_may): Add more args for USER_MAY update.

	* src/manage_acl.h (USER_MAY): Correct the implied permission case.

	* src/manage_sql.c (init_port_range_iterator): Add more args for
	USER_MAY update.

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

	* src/manage_sql.c (create_permission): Restrict creating upper level
	permissions to users with admin permissions.

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

	* src/manage_sql.c (create_permission): When creating a higher level
	permission, where the resource is 0, make the owner NULL so that the
	permission is shared between the admins, and remains even if the creator
	user is removed.

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

	Add options --user and --new-password.

	* src/manage_sql.c (modify_setting): Use set_password.
	(set_password): New function.  Body from modify_setting.
	(manage_set_password): New function.

	* src/manage.h: Add header accordingly.

	* src/openvasmd.c (main): Add new options.

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

	Set Interfaces and Hosts access "Allow All" to "Deny none". Hence
	increase database version to 108.  Add database migration from version
	107 to 108.

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

	* src/manage_migrators.c (migrate_107_to_108): New function.
	(database_migrators): Add migrate_107_to_108.

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

	* src/manage_sql.c (create_tables): Update comment for host and
	interfaces access.
	(create_user): Don't set hosts_allow value to 2 in "deny none" case.

	* src/omp.c (omp_xml_handle_start_element): Set hosts_allow and
	ifaces_allow default value to 0 in CREATE_USER case.
	(omp_xml_handle_end_element): Don't send hosts_allow and ifaces_allow
	value as 2 when hosts and ifaces values are empty in CLIENT_GET_USERS.

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

	* src/manage_sql.c (create_permission): Prevent resource linked
	permission for users, roles and groups.

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

	Isolate the access control code in an Access Control Layer file.

	* src/manage_sql.c (user_can_everything, user_owns_uuid)
	(user_has_access_uuid, user_owns_result, user_is_admin)
	(user_is_observer, user_may, type_has_permissions, type_is_shared)
	(where_owned): Remove.  Moved to manage_acl.c.
	(USER_MAY): Remove.  Moved to manage_acl.h.
	(credentials_is_admin): Remove.  Out of use.

	* src/omp.c (omp_xml_handle_end_element): Handle new create_permission

	* src/manage_acl.c, src/manage_acl.h: New files.

	* src/CMakeLists.txt: Add manage_acl.c to manage library.
	(C_FILES): Add manage_acl.c.

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

	* src/manage_sql.c (init_manage): Remove GET_VERSION from role
	permissions.  Add HELP to observer permissions.
	(create_permission): Refuse to create permission on GET_VERSION.  It has
	no permission check now, and is available without authentication anyway.
	Return an error if a resource is given for a permission that does not
	take resources, instead of ignoring the resource.

	* src/omp.c (omp_xml_handle_end_element): Handle new create_permission
	return.

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

	* src/omp.c (omp_xml_handle_end_element): In GET_VERSION remove
	permission check so that the command is always available.  Also use
	correct state in condition, otherwise the user is always considered
	authenticated after GET_VERSION.

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

	* src/manage_sql.c (user_can_everything): Move up in file.
	(user_has_access_uuid): Take full command name into account in the
	checks for GET permission.  Use user_can_everything instead of
	credentials_is_admin to check for full permissions, because
	credentials_is_admin just checks the role.
	(init_get_iterator): Clarify permission used in get->id case.
	(report_counts): Use full permission name.

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

	* src/manage_sql.c (USER_MAY): New macro.
	(user_may): Use macro.
	(init_port_range_iterator): Use USER_MAY, so that the port ranges are
	still accessible if the port list is owned by someone else.

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

	* src/manage_sql.c (user_can_everything, type_is_shared): New functions.
	(user_may): Use user_can_everything.
	(where_owned): Add special cases for users, groups and roles, that use
	restrict the "global" resources to users with admin permissions.
	(init_manage_process): Init SQL function user_can_everything.

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

	* src/sql.h: Add header accordingly.

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

	Add resource level permission checking to remaining commands.

	* src/manage.c (run_task): Add permission arg and check.
	(start_task, stop_task, pause_task, resume_paused_task)
	(resume_stopped_task, resume_or_start_task): Add permissions to find
	and run_task calls.
	(init_report_format_file_iterator): Use the owner of the report format
	in the path, instead of assuming that the current user is the owner.

	* src/manage_sql.c (manage_alert): Use permission version of find
	function.
	(make_report): Get the report owner from the task, instead of using the
	current user.
	(verify_agent): Use permission find.  Adjust filter so that iterator
	actually find the report format.  Add warnings.
	(verify_report_format): Use permission find.
	(report_format_owner_uuid): New function.

	* src/manage.h: Add header accordingly.

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

	Add resource level permission checking to MODIFY commands.

	* src/manage_sql.c (modify_alert, modify_report, modify_target)
	(modify_lsc_credential, modify_agent, modify_schedule)
	(modify_report_format, modify_slave, modify_port_list)
	(modify_filter, modify_tag): Use permission version of find function.
	(modify_group, modify_user): Add note about permission check.
	(find_note): Neaten indent.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): Use permission version of
	find function for MODIFY_NOTE and MODIFY_OVERRIDE.

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

	* src/manage_sql.c (ANON_GET_ITERATOR_COLUMNS): Add _owner.
	(REPORT_ITERATOR_FILTER_COLUMNS): Adjust line end marker.
	(REPORT_ITERATOR_COLUMNS, NOTE_ITERATOR_COLUMNS)
	(OVERRIDE_ITERATOR_COLUMNS, REPORT_FORMAT_ITERATOR_COLUMNS): Select
	_owner too.
	(REPORT_FORMAT_ITERATOR_FILTER_COLUMNS): Neaten NULL formatting.

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

	* src/manage_sql.c (print_report_assets_xml): Send report result count
	detail for number of log results.

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

	* src/manage_sql.c (valid_type): Add missing "group" check.  Order
	alphabetically.

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

	Add resource level permission checking to CREATE commands.

	* src/manage_sql.c (type_has_comment): New function.
	(copy_resource_lock): Add old_resource return arg.  Find with the
	permissions function instead of by hand.  Check if the type has
	comments when generating SQL.
	(copy_alert, copy_task, copy_config, copy_report_format, copy_group)
	(copy_port_list, copy_user): Use copy_resource_lock to do most of the
	work.
	(copy_target, copy_tag): Use copy_resource to do the work.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_CONFIG adjust
	for standardised copy_config call.

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

	* src/manage_sql.c (report_port_count): Do not count results and error
	messages with no specific port value set as a distinct port.

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

	* src/ompd.c (serve_omp): Return commented out code removed in previous
	change. Remove maybe_free_scanner_rules call.

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

	* src/manage.c (scanner): Initialize accordingly.
	(run_task): Don't send client rules.

	* src/manage.h (scanner_t): Remove rules and rules_size elements. Delete
	unused prototype.

	* src/manage_sql.c (manage_user_rules): Delete function.
	(make_task_rcfiles): Don't add client side user rules.

	* src/openvasmd.c: Delete dead code.

	* src/otp.c (free_rule, maybe_free_scanner_rules, make_scanner_rules)
	(add_scanner_rule, parse_scanner_rules): Delete functions.
	(init_otp_data): Update initialization.
	(scanner_state_t): Delete SCANNER_RULE state.
	(process_otp_scanner_input): Don't handle SCANNER_RULE and RULES case.

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

	* src/manage.c (finished_hosts_str): New function.
	(send_scanner_preferences): Add finished hosts to exclude_hosts
	preference appropriately.
	(send_user_rules_empty): Delete function.
	(run_task): Remove call to send_user_rules_empty. Adjust call to
	send_scanner_preferences.

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

	* src/manage_sql.c (create_tables, user_ensure_in_db, copy_user): Adjust
	to handle users ifaces and ifaces_allow columns accordingly. Issue
	reported and tracked by Stefan Schwarz.

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

	Add resource level permission checking to DELETE commands.

	* src/manage_sql.c (find_alert_with_permission): New function.
	(delete_alert, delete_report, request_delete_task_uuid): Use permission
	version of find function.
	(find_report_with_permission): Correct doc.
	(find_target_with_permission, find_lsc_credential_with_permission)
	(find_agent_with_permission, find_note_with_permission)
	(find_override_with_permission, find_schedule_with_permission)
	(find_report_format_with_permission, find_slave_with_permission)
	(find_port_list_with_permission, port_range_port_list_uuid)
	(find_port_range_with_permission, find_filter_with_permission)
	(find_user_with_permission, find_tag_with_permission): New functions.
	(delete_target, delete_config, delete_lsc_credential, delete_agent)
	(delete_note, delete_override, delete_schedule, delete_report_format)
	(delete_slave, delete_port_list, delete_port_range, delete_filter)
	(delete_tag): Use permission version of find function.
	(find_port_range): Remove.  Out of use.
	(delete_group, delete_user): Add note about permissions.
	(find_tag): Move up in file.

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

	* src/manage.c (send_ifaces_preferences): Rename to
	send_ifaces_access_preferences.
	(send_hosts_access_preferences): New function used to send users host
	access as hosts_allow and hosts_deny preferences instead of using old
	rules format.
	(send_scanner_preferences): Call new functions.
	(send_user_rules): Delete unused function.

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

	Increase database version to 107 to ensure that all results have a task.
	Add database migration from version 106 to 107.

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

	* src/manage_migrators.c (migrate_106_to_107): New function.
	(database_migrators): Add migrate_106_to_107.

	* doc/db.png: Update for version change.

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

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_RESULTS cleanup
	iterator on error return.

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

	* src/manage_sql.c (create_report): Set the task of the result to the
	actual task instead of to 0, for consistency with normal results.

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

	* src/manage_sql.c (find_resource_with_permission): Add safety check.

	* src/omp.c (omp_xml_handle_end_element): Move GET_RESULTS iterator
	declaration out of GET_REPORTS.  In GET_RESULTS rework the loop so that
	"next" is called before the task check, because the task check may use
	the iterator.

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

	Remove remains of "actions" GET command parameters.

	* src/manage_sql.c (count): Remove actions warning.
	(init_task_user_iterator, init_task_group_iterator)
	(init_task_role_iterator): Remove old actions doc.
	(resource_count): Remove actions.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (get_data_reset, get_data_parse_attributes)
	(get_nvts_data_t, get_nvts_data_reset)
	(omp_xml_handle_start_element): Remove actions.

	* src/schema_formats/XML/OMP.xml: Remove all actions attributes.  Add
	CHANGE accordingly.
	(actions): Remove.

	* doc/omp.html, doc/omp.rnc: Update from source.

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

	* src/manage_sql.c (credential_is_admin): Correct doc.
	(user_has_access_uuid): Remove unused actions arg.  Update all callers.
	(find_resource_with_permission): Add trash arg.  Update all callers.
	(find_resource_for_actions): Remove.  Out of use.
	(init_get_iterator): Switch to permissions version of find function.
	(init_task_iterator): Remove doc ref to actions.

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

	* src/manage_sql.c (find_resource_with_permission): New function.
	(find_task_with_permission,
	(find_task_for_actions, find_report_for_actions)
	(find_target_for_actions, find_config_for_actions)
	(find_lsc_credential_for_actions): Remove.  Replaced with permission
	versions.
	(find_report_with_permission, find_config_with_permission): Use
	find_resource_with_permission.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): Replace actions find calls
	with permissions versions.

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

	* src/manage_sql.c (parse_actions): Remove.  Out of use.
	(user_has_access_uuid): Use only the permissions case, removing the
	type_has_permissions check which has been always true for some time now.

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

	* src/manage_sql.c (user_has_access_uuid): Rename arg resource to type,
	because it's a type.

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

	* src/manage_sql.c (user_has_access_uuid): Check task if type is result.
	(find_result_with_permission): New function.
	(find_result_for_actions): Remove.  Replaced with permission version.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): Replace actions version of
	result finder with permissions version.

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

	* src/manage_sql.c (init_get_iterator): Skip the ownership clause when
	there is a resource, because the owner check is done when finding the
	resource.
	(find_filter_for_actions): Remove.  Out of use.

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

	* src/manage_sql.c (credential_is_admin): New function.
	(user_has_access_uuid): Allow admins to delete/modify/etc other users'
	permissions.
	(where_owned): Use new function.

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

	* src/manage_sql.c (where_owned): Make all permissions visible to
	admins, except those that refer to resources.

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

	* src/manage.c (send_ifaces_preferences, send_scanner_preferences): New
	function.
	(run_task): Refactor code to send_scanner_preferences, and call it
	accordingly.

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

	* src/manage_sql.c (create_permission): For simplicity, refuse to make a
	permission on a permission.

	* src/omp.c (omp_xml_handle_end_element): Handle new return from
	create_permission.

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

	* src/manage_sql.c (init_task_group_iterator)
	(init_task_role_iterator): Make the select distinct in case there are
	multiple permissions for the subject on the task.  Include groups that
	have any type of permission on the task, because all of them can see the
	task.
	(set_task_groups): Remove only the 'get' permissions, because those are
	the ones that this function adds.

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

	* manage_sql.c (USER_ITERATOR_FILTER_COLUMNS, USER_ITERATOR_COLUMNS)
	(USER_ITERATOR_TRASH_COLUMNS): Add ifaces and ifaces_allow columns.
	(user_iterator_ifaces, user_iterator_ifaces_allow): New functions.

	* src/manage.h: Add prototypes accordingly.

	* src/omp.c (omp_xml_handle_end_element): Send ifaces element in
	get_users case.

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

	Add Interface Access for users. Hence increase database version
	to 106.  Add database migration from version 105 to 106.

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

	* src/manage_migrators.c (migrate_105_to_106): New function.
	(database_migrators): Add migrate_105_to_106.

	* src/manage.h: Adjust prototypes accordingly.

	* src/manage_sql.c (manage_first_user, omp_xml_handle_end_element):
	Adjust create_user call.
	(create_user): Add ifaces and ifaces_allow parameters.
	(create_user_data_t, modify_user_data_t): Add ifaces and ifaces_allow
	variables.
	(create_user_data_reset, modify_user_data_reset): Free new variables
	accordingly.
	(client_state_t): Add states for ifaces element in user creation and
	modification.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Handle ifaces element for create_user and
	modify_user cases.

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

	* src/manage.c (filter_clause): Cast slave port to integer when sorting
	so that it sorts as numbers.

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

	* src/openvasmd.c (main): Don't set the process title. Current
	implementation is buggy and should be replaced.
	This reverts revision 15874.

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

	* src/manage.c (manage_schedule): Skip warning correctly.

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

	* src/manage.c (manage_schedule): Skip the iterator init warning if it
	is just due to locking.

	* src/manage_sql.c (cleanup_manage_process): Cleanup prognosis iterator.
	(prognosis_stmt): New global variable.  Was in init_prognosis_iterator.
	(cleanup_prognosis_iterator): New function.
	(init_prognosis_iterator): Use new variable.

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

	* src/manage_sql.c (report_severity): Cleanup iterator.

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

	* src/manage_sql.c (init_result_iterator): Make sorting by vulnerability
	case insensitive.

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

	* src/manage_sql.c (init_result_iterator): Add sorting of results by
	host and vulnerability (NVT name). Use a variable and normal ifs for the
	"ORDER BY" clause instead of nested ternary conditionals to improve
	readability with the added cases.

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

	* src/ompd.c (write_to_scanner): Verify certificate.

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

	Add expiration time for report_counts. Hence increase database version
	to 105.  Add database migration from version 104 to 105.

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

	* src/manage_migrators.c (migrate_104_to_105): New function.
	(database_migrators): Add migrate_104_to_105.

	* src/manage_sql.c (create_tables): Add column end_time to
	report_counts table.
	(report_add_result): Update end_time as new results are added.
	(report_counts_cache_exists, report_counts_from_cache)
	(report_severity): Check end_time of cache.
	(report_cache_counts): Calculate and set end_time of cache.

	* doc/db_postgres.sql (report_counts): Added the table.

	* doc/db.png: Update from source.

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

	* src/manage_sql.c (AGENT_ITERATOR_FILTER_COLUMNS)
	(AGENT_ITERATOR_COLUMNS, AGENT_ITERATOR_TRASH_COLUMNS): Add trust, so
	that at least the GSA sorting works.

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

	* src/manage_sql.c (omp_command_takes_resource): New function.
	(create_permission, modify_permission): Check if permission takes a
	resource using shared function.

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

	* src/manage_sql.c (init_user_get_iterator): Remove.  Out of use.
	(init_user_task_iterator): Init the iterator directly.

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

	* src/manage_sql.c (init_user_get_iterator): Remove resource arg.
	Always 0.  Update caller.
	(init_user_task_iterator): Make static.  Remove task arg.  Always 0.
	Update callers.

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

	* src/manage_sql.c (init_user_target_iterator): Simplify to match single
	caller, removing use of init_user_get_iterator.

	* src/manage.h: Update header accordingly.

	* src/manage.c (slave_setup): Update call.

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

	* src/manage_sql.c (where_owned): Add owner_filter arg.
	(init_get_iterator, count): Move generation of filtered owner clause
	into where owned so that it's in one place only.  The instance in count
	was missing a NULL check.

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

	* src/manage_sql.c (parse_keyword): Add column check to special values
	condition, because it can be NULL for keywords "=value".

2013-10-23  Michael Wiegand <michael.wiegand@greenbone.net>

	* CMakeLists.txt: Revert exclusion of pwpolicy.conf via
	CPACK_SOURCE_IGNORE_FILES since a later install target requires the
	presence of this file.

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

	* src/manage_sql.c (user_has_access_uuid): Free uuid if it was
	allocated.

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

	* src/manage_sql.c (user_has_access_uuid): Combine the two SQL cases for
	getting permissions.  Add missing check to args of other cases.

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

	* src/manage_sql.c (user_has_access_uuid): Free quoted_permission.

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

	* src/manage_sql.c (user_has_access_uuid): Combine two SQL cases.

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

	* src/omp.c (omp_xml_handle_end_element): Add CURRENT_REPORT to
	GET_REPORTS.

	* src/schema_formats/XML/OMP.xml (get_tasks): Add CURRENT_REPORT.

	* doc/omp.html, doc/omp.rnc: Update from source.

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

	* src/manage_sql.c (DB_CHUNK_SIZE): New define.
	(init_manage_process): Set SQLite chunk size, to reduce fragmentation.

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

	* src/manage_sql.c (where_levels_type): Handle false positive results
	so counts will be accurate when FPs occur without overrides (e.g. in
	imported reports).

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

	* src/manage_sql.c (task_severity, init_result_iterator)
	(init_asset_iterator, report_scan_result_count, report_severity_data)
	(filtered_host_count, note_count, init_note_iterator, override_count)
	(init_override_iterator): Use CVSS of NVT for dynamic severity only if
	the original severity of a result is above Log level.
	(report_counts_cache_exists, cache_report_counts): Do not use result
	counts cache when dynamic severity setting is active.

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

	* src/manage.c (send_task_preferences): Send source_iface task
	preference.

	* src/omp.c (omp_xml_handle_end_element): Output Network Source
	Interface task preference in GET_TASKS case.

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

	* src/manage_sql.c (init_get_iterator, count): Add "owned" check to the
	filtering on the owner clause.
	(resource_count): Send owner args only when the type has owners.

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

	* src/manage_sql.c (where_levels_type): Get severity field in case
	all levels are selected.

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

	* src/schema_formats/XML/OMP.xml (report): Add severity to port element.
	(get_reports): Add severity to port element in example.

	* doc/omp.html, doc/omp.rnc: Update from source.

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

	* src/manage_sql.c (init_get_iterator): Add "owner IS NULL" to default
	case in the owner= filtering, to include global rows.

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

	* src/manage_sql.c (compare_ports_severity)
	(compare_ports_severity_desc): Use correct variables for comparison.

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

	Change sorting and XML output of hosts to use severity instead of
	threat or cvss_base and output both numeric severity and threat level.

	* src/manage_sql.c (compare_message_types_desc)
	(compare_message_types_asc, compare_port_threat): Removed. Renamed to
	compare_severity_desc, compare_severity_asc, compare_port_severity.
	(compare_severity_desc, compare_severity_asc, compare_port_severity):
	New functions. Renamed from compare_message_types_desc,
	compare_message_types_asc, compare_port_threat and adjusted to sort by
	severity instead of threat level.
	(add_port, print_host_port, print_host_ports_desc): Use severity
	instead of threat level string.
	(compare_ports_threat, compare_ports_threat_desc)
	(print_host_ports_by_type, print_host_ports_by_type_desc): Removed.
	Renamed to compare_ports_severity, compare_ports_severity_desc,
	print_host_ports_by_severity, print_host_ports_by_severity_desc.
	(compare_ports_severity, compare_ports_severity_desc)
	(print_host_ports_by_severity, print_host_ports_by_severity_desc): New
	functions. Renamed from compare_ports_threat, compare_ports_threat_desc,
	print_host_ports_by_type, print_host_ports_by_type_desc and adjusted
	to sort by severity.
	(print_report_port_xml, print_report_xml): Adjust to sort ports by
	severity instead of threat and output severity and threat elements for
	ports.

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

	* src/manage_sql.c (filter_clause): Skip the SQL in the owner case,
	instead of putting in a placeholder, because the placeholder was acting
	like an OR term.

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

	* src/manage_sql.c (filter_clause): Add owner_filter arg.  For owner=
	keywords append an SQL placeholder, and return the owner to the callers.
	Update callers.
	(init_get_iterator, count): Use the owner= value from filter_clause to
	filter according to the owner in the "owned" clause.  This makes the
	owner= keyword a special filter that is always ANDed with the others,
	similar to permissions.
	(resouce_count): Add owner=any to the filter string, so that the count
	is the maximum possible.

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

	* src/manage_sql.c (delete_port_range): Match return to standard delete
	functions.

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

	* src/omp.c (modify_task_data_t, modify_task_data_reset)
	(client_state_t): Add alterable field.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add ALTERABLE to MODIFY_TASK.

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

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

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_end_element): Also respect ALTERABLE in the
	regular CREATE_TASK case.

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

	* src/manage_sql.c (filter_clause): Sort NVTs of notes and overrides in
	descending order in sort-reverse case.
	(USER_ITERATOR_FILTER_COLUMNS, USER_ITERATOR_COLUMNS): Change column
	"role" to "roles" and add "groups". Get comma-separated lists of
	the roles and groups of the user for these.

2013-10-15  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/report_formats/NBE/NBE.xsl: Generate truncated "subnet" element
	for improved compatibility. Put newline before scan_end for
	consistency.

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

	* src/manage.c (next_time): New function containing the functionality of
	last version schedule_iterator_next_time and additionally uses
	period_months if applicable.

	* src/manage.h (next_time): New function prototype.

	* src/manage_sql.c (init_manage_process): Add SQL function next_time.
	(SCHEDULE_ITERATOR_FILTER_COLUMNS, SCHEDULE_ITERATOR_COLUMNS): Add
	column next_run, add first_run as alias for first_time.
	(schedule_iterator_next_time): Get time from next_run column.
	Calculation moved to next_time.

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

	* src/sql.h (sql_next_time): New function prototype.

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

	* doc/db.png: New file.  This vanished for some reason.

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

	* ChangeLog: Add entry for last commit.

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

	* src/schema_formats/XML/OMP.xml (create_task, get_tasks): Add
	ALTERABLE.

	* doc/omp.html, doc/omp.rnc: Update from source.

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

	Add Alterable Tasks.  Hence increase database version to 104.  Add
	database migration from version 103 to 104.

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

	* src/manage_migrators.c (migrate_103_to_104): New function.
	(database_migrators): Add migrate_103_to_104.

	* src/manage_sql.c (create_tables): Add alterable to tasks.
	(task_alterable): New function.
	(init_manage): Set alterable column in example task.
	(delete_report_internal): Clear alterable if it was the last report.
	(make_task): Set alterable column.
	(copy_task): Add alterable arg.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (create_task_data_t, create_task_data_reset)
	(client_state_t): Add alterable field.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add
	ALTERABLE to GET_TASKS and CREATE_TASK.  In MODIFY_TASK allow
	modification of target and config if alterable.

	* doc/db_postgres.sql (tasks): Add alterable.

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

	* src/omp.c (omp_xml_handle_end_element): Add ID to success case of
	CREATE_USER response.

	* src/manage_sql.c (create_user): Add new_user arg.  Update caller.

	* src/manage.h: Update header accordingly.

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

	Add severity values to log, debug and error messages where they are
	missing like ones without an NVT. Hence increase database version to
	103. Add database migration from version 102 to 103.

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

	* src/manage_migrators.c (migrate_102_to_103): New function.
	(database_migrators): Add migrate_102_to_103.

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

	Remove nvts description from DB. Hence increase database version to 102.
	Add database migration from version 101 to 102.

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

	* src/manage_migrators.c (migrate_101_to_102): New function.
	(database_migrators): Add migrate_101_to_102.

	* doc/db_postgres.sql (nvts): Remove description column.

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

	* src/manage_sql.c (create_tables, NVT_ITERATOR_COLUMNS)
	(NVT_ITERATOR_COLUMNS_NVTS): Remove nvts description column.
	(nvt_iterator_description): Delete unused function.
	(nvt_iterator_copyright, nvt_iterator_cve, nvt_iterator_bid)
	(nvt_iterator_tag, nvt_iterator_xref, nvt_iterator_sign_key_ids)
	(nvt_iterator_family, nvt_iterator_cvss_base): Adjust column number.

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

	* src/otp.c (scanner_state_t): Remove PLUGIN_LIST_DESCRIPTION state.
	(process_otp_scanner_input): Don't handle PLUGIN_LIST_DESCRIPTION state.
	Set Summary state handling after copyright state.

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

	* src/manage_sql.c (where_levels, where_levels_auto)
	(where_levels_type): Exclude error messages if all levels are selected.
	(report_vuln_count): Exclude error message results.

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

	* src/manage_sql.c (where_levels, where_levels_auto)
	(where_levels_type): Exclude error results if levels string is empty or
	null.
	(init_result_iterator): Don't apply autofp to error messages.

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

	* src/manage.c (get_nvti_xml): Don't print nvti xml.

	* src/manage_sql.c (make_nvt_from_nvti): Don't insert nvti description
	value in nvts table.

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

	* src/manage_sql.c (make_result): Set severity value for error messages
	and other non-Alarm results with no NVT. Do not create results with
	invalid types or Alarm results with no NVTs and log a warning.
	Do not allow creation of False Positive results here.

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

	* src/manage_sql.c (report_scan_result_count): Exclude results with
	severity lower than false positive (like error messages) from count.

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

	* src/manage_sql.c (delete_alert): Copy correct rows from data tables
	(alert_condition_data, alert_event_data, alert_method_data).

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

	Change level to severity in alert_condition_data. Hence increase
	database version to 101. Add database migration from version 100 to 101.

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

	* src/manage_migrators.c (migrate_100_to_101): New function.
	(database_migrators): Add migrate_100_to_101.

	* src/manage.c (alert_condition_name, alert_condition_description)
	(alert_condition_from_name): Replace (threat) level with severity.

	* src/manage.h (alert_condition_t): Replace threat level with severity.
	(task_severity_double): New function prototype.

	* src/manage_sql.c (validate_alert_condition_data): New function.
	(create_alert, modify_alert): Replace threat level with severity and
	add verification of condition data.
	(condition_met): Replace threat level with severity.
	(task_previous_threat_level): Removed.
	(task_severity_double): New function.

	* src/omp.c (xml_handle_end_element): In cases for CLIENT_CREATE_ALERT
	and CLIENT_MODIFY_ALERT handle new error codes of create_alert and
	modify_alert.

	* src/schema_formats/XML/OMP.xml (create_alert): Use new condition
	"Severity at least" in example.
	(protocol): Add change documentation of new alert conditions.

	* doc/omp.html: Update from source.

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

	* src/omp.c (omp_xml_handle_end_element): Add ID to success case of
	CREATE_USER response.

	* src/manage_sql.c (create_user): Add new_user arg.  Update caller.

	* src/manage.h: Update header accordingly.

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

	* src/report_formats/NBE/NBE.xsl: Duplicate host value in result output
	in place of subnet to keep the same old format of results.

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

	* src/manage_sql.c (print_report_xml): Clean the filter like the other
	GET commands do, so that duplicate columns like apply_overrides are
	removed.

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

	* src/manage_sql.c (manage_report_filter_controls): If the filter has no
	apply_overrides keyword, set it from the overrides keyword.

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

	* doc/db_postgres.sql (results): Remove subnet column.

	* src/openvasmd.c: Update first user option help.

	* src/schema_formats/XML/OMP.xml, doc/omp.html, doc/db.png, doc/omp.rnc,
	src/report_formats/NBE/NBE.xsl: Update for results subnet value removal.

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

	* src/manage_sql.c (create_tables): Add missing columns when creating
	targets and tasks tables.

2013-10-03  Michael Wiegand <michael.wiegand@greenbone.net>

	* src/manage_sql.c: Fix malformed SQL statement which caused
	initialisation of new databases either to abort or to cause issues with
	results inserted later on.

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

	Remove subnet from report results. Hence increase database version to
	100.  Add database migration from version 99 to 100.

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

	* src/manage_migrators.c (migrate_99_to_100): New function.
	(database_migrators): Add migrate_99_to_100.

	* src/manage.h: Remove result_iterator_subnet prototype.

	* src/manage_sql.c (create_tables): Adjust results table creation.
	(init_result_iterator): Don't query subnet column value.
	(result_iterator_subnet): Delete function.
	(result_iterator_host, result_iterator_port, result_iterator_nvt_oid)
	(result_iterator_original_type, result_iterator_type)
	(result_iterator_descr, result_iterator_task, result_iterator_report)
	(result_iterator_nvt_cvss_base_double, result_iterator_scan_nvt_version)
	(result_iterator_original_severity, result_iterator_severity)
	(result_iterator_severity_double, result_iterator_original_level)
	(result_iterator_level): Adjust column numbers for subnet removal from
	iterator.
	(print_report_prognostic_xml): Remove subnet tag.

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

	* src/manage.c (update_from_slave): Remove result subnet handling.

	* src/manage.h: Update make_result prototype.
	(message_t, create_report_result_t): Remove subnet member.

	* src/manage_sql.c (init_manage): Don't insert empty result subnet value.
	(make_result): Remove subnet parameter. Adjust sql insertion query
	accordingly.
	(create_report): Remove result subnet value insertion.

	* src/omp.c (create_report_data_t): Remove subnet member.
	(create_report_data_reset): Adjust for subnet member removal.
	(client_state_t, omp_xml_handle_start_element)
	(omp_xml_handle_end_element, omp_xml_handle_text): Remove result subnet
	client state in create report and its handling.
	(buffer_results_xml): Don't print subnet value.

	* src/otp.c (make_message, free_message): Adjust for result subnet removal.

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

	* src/manage_sql.c (init_report_errors_iterator): Iterate over error
	messages that has no associated nvt's too.

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

	* src/schema_formats/XML/OMP.xml (get_overrides, modify_override): Add
	missing severity and new_severity elements.

	* doc/omp.rnc, doc/omp.html: Update from source.

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

	* doc/omp.html, src/schema_formats/XML/OMP.xml: Update documentation for
	compatibility changes.

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

	* src/manage_sql.c (TASK_ITERATOR_COLUMNS)
	(TASK_ITERATOR_TRASH_COLUMNS): Add status_text column, for sorting by
	status.

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

	* src/manage.h (report_cache_counts): New function prototype.

	* src/manage_sql.c (set_task_run_status): Do not clear result counts
	cache.
	(report_add_result): Increment cached result counts when adding results.
	(report_counts_id_filt): Cache results regardless of task run status.
	(trim_report, trim_partial_report): Clear and rebuild result counts
	cache for report.

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

	* report_formats/verinice-ism: Bump Version to 1.1.9

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

	* src/manage_sql.c (trim_report): Skip report_results and do not
	check for host in SQL.
	(trim_report): Skip report_results and delete result_host_details
	using result_hosts in SQL.

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

	* src/manage_sql.c (task_severity, init_result_iterator)
	(init_asset_iterator, report_scan_result_count, report_severity_data)
	(filtered_host_count): Cast cvss_base to real for severity SQL,
	otherwise it is text and the comparison with the result severity fails
	even if they're the same.

2013-09-30  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number to 5.0+beta3.

2013-09-30  Michael Wiegand <michael.wiegand@greenbone.net>

	Preparing the openvas-manager 5.0+beta2 release.

	* CHANGES: Updated.

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

	Remove slice_network_addresses and reverse_lookup config preferences.
	Hence increase database version to 99.  Add database migration from
	version 98 to 99.

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

	* src/manage_migrators.c (migrate_98_to_99): New function.
	(database_migrators): Add migrate_98_to_99.

	* src/manage_sql.c (setup_full_config_prefs): Remove reverse_lookup
	config preference.

	* doc/db.png: Update for version changes.

	* doc/db_postgres.sql (tasks, targets, targets_trash): Update for
	previously added columns.

2013-09-27  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Change default "Dynamic Severity" setting to disabled. Hence increase
	database version to 98. Add database migration from version 97 to 98.

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

	* src/manage_migrators.c (migrate_97_to_98): New function.
	(database_migrators): Add migrate_97_to_98.

	* src/manage_sql.c (init_manage_settings): Disable "Dynamic Severity"
	by default.

2013-09-26  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (report_counts_cache_exists): New function prototype.
	(report_scan_result_count): Get count from cache if possible.

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

	* src/manage_sql.c (cache_report_counts): Remove extra arg.

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

	* src/manage_sql.c (report_scan_result_count): Skip report_results in
	SQL.
	(cache_report_counts): Use a dummy severity.

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

	* src/manage.h (clear_task_results_cache): New function prototype.

	* src/manage_sql.c (set_task_run_status): Clear cache of last report.
	(reports_clear_count_cache): Clarify documentation.
	(cache_will_insert): Removed. Obsoleted by caching of empty reports.
	(cache_report_counts): Add cache entries for empty reports.
	(report_counts_id_filt): Use cache for reports with status "New",
	"Paused", "Stopped" and "Internal Error" in addition to "Done".
	(clear_task_results_cache): New function.

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

	* src/ompd.c (serve_omp): Check for retry errors from recv.  Check if
	client is active before trying to free connection.

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

	* src/manage.c (severity_data_level_counts): Fix count output to logs
	parameter.

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

	* src/manage_sql.c (cache_will_insert): New function.
	(report_counts_id_filt): Check if cache_report_counts will do any
	inserts before calling it, otherwise it runs a transaction just to do
	the delete, which is costly on large reports.

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

	* src/omp.c (omp_xml_handle_end_element): In GET_TARGETS, don't send
	port range value when details attribute is not set.

	* doc/omp.html: Add entry for GET_TARGETS change in compatibility
	section.

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

	* src/manage_sql.c (report_severity_data): Skip report_results in results
	SELECT.
	(print_report_xml): Only send port summary when details are requested,
	because the port summary needs to iterate over the results, which can be
	slow.

2013-09-24  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* manage_sql.c (init_manage_process): Add SQL function
	report_severity_count.
	(REPORT_ITERATOR_FILTER_COLUMNS, REPORT_ITERATOR_COLUMNS): Add columns
	false_positive, log, low, medium, high.

	sql.c (report_severity_count, sql_report_severity_count): New functions.

	sql.h (report_severity_count_sql): New function prototype.

2013-09-24  Werner Koch  <wk@gnupg.org>

	* src/manage_sql.c (create_lsc_credential): Encrypt the random
	password and not the unrelated given_password.

2013-09-24  Michael Wiegand <michael.wiegand@greenbone.net>

	Update NBE report format plugin to improve compatibility with third
	party tools.

	* src/report_formats/NBE/NBE.xsl: Put host_start timestamp before the
	results of a host instead of after. Use integer IDs instead of OIDs.
	Ensure Risk Factor, CVSS score and references are in the expected
	places.

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

	* src/manage_sql.c (task_severity): Remove syntax error that was making
	last commit look much faster than it is.

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

	* src/manage_sql.c (task_severity): Align SQL better.  Use max instead
	of ORDER BY to get max, which brings the Task page back to interactive
	speed with a big db.

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

	Cache the task severity so that it is shared between the task_threat and
	task_severity SQL functions when initialising a task iterator.  This
	roughly halves the load time of the Tasks page.

	* src/sql.c (sql_severity_t): New type.
	(cached_task_severity): New function.
	(sql_threat_level): Inline task_threat_level, in order to use
	cached_task_severity.
	(sql_task_severity): Use cached_task_severity.

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

	* src/manage_sql.c (task_severity): Remove use of report_results to
	speed up query slightly, as it is the slowest part of GET_TASKS with a
	large db.  Move the report query to a column, so that the index is used.

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

	* src/ompd.c (serve_omp): Format comments more consistently.  Remove
	redundant test.

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

	* src/ompd.c (serve_omp): Exit if the Scanner goes down when it should
	be up.

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

	* src/manage_sql.c (init_manage_process): Create SQL function
	report_progress.
	(REPORT_ITERATOR_COLUMNS): Append report progress to status_text, so
	that the reports are sorted by progress.

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

	* src/sql.h: Add header accordingly.

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

	* src/manage_sql.c (report_progress): Check if a report was given.
	Always init hosts_xml if given.

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

	Combine the two instances of calculating the report progress into one
	common function, in preparation for having the progress in the report
	iterator.

	* src/manage_sql.c (report_active): Move up in file.
	(report_progress_xml): Remove.
	(report_progress_active): New function.  Mostly does what
	report_progress_xml did.
	(report_progress): New function.  Does common progress calc.
	(print_report_xml): Call report_progress to get progress.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): Call report_progress to get
	the progress.

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

	* src/manage_sql.c (filter_clause): Order by status_text when sorting by
	status, because status_text has more detail.
	(REPORT_ITERATOR_COLUMNS): Add status_text column, with container check.

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

	* src/omp.c (omp_xml_handle_end_element): Include progress of hosts, as
	was the case before using report_progress_xml.

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

	* src/manage.c (run_task): Send task hosts ordering preference.

	* ChangeLog: Update style for previous entries containing database
	migration to match common style.

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

	* src/manage.h (report_severity): Change return type to double.

	* src/manage_sql.c (report_cache_counts): Cache overridden counts.
	(cache_report_counts): Use exclusive transaction.
	(report_severity): Change return type to double. Get severity from
	cache or report_counts_id.

	* src/sql.c (sql_report_severity): Adapt to report_severity returning
	a double value.

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

	* src/manage.c (severity_to_level, severity_to_type)
	(severity_data_index, severity_data_value): Add missing blank lines in
	documentation before parameters and return.

	* src/manage_sql.c (report_severity): Correct documentation.

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

	Add tasks hosts ordering. Hence increase database version to 97.
	Add database migration from version 96 to 97.

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

	* src/manage_migrators.c (migrate_96_to_97): New function.
	(database_migrators): Add migrate_96_to_97.

	* src/manage.h: Add prototypes.

	* src/manage_sql.c (task_hosts_ordering, set_task_hosts_ordering): New
	function.
	(copy_task): Handle hosts_ordering column too.

	* src/omp.c (create_task_data_t, modify_task_data_t): Add new element
	hosts_ordering.
	(create_task_data_reset, modify_task_data_reset): Free hosts_ordering.
	(client_state_t): Add new create and modify task states for
	hosts_ordering element.
	(omp_xml_handle_start_element, omp_xml_handle_text): Handle new states.
	(omp_xml_handle_end_element): Send hosts ordering for GET_TASKS.

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

	* src/manage_sql.c (create_target, modify_target): Interpret non-zero
	reverse lookup options values as 1.

	* src/manage.c (run_task): Interpret non-zero reverse lookup options
	values as yes.

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

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_TARGETS, make
	XML string symmetrical for consistency.

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

	* src/manage_sql.c (report_count): Add SQL for trash check, to match
	init_report_iterator.

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

	* src/manage_sql.c (REPORT_ITERATOR_COLUMNS): Use the date column
	instead of the start_time for filtering by date, because that is what
	GSA displays.

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

	* src/manage_sql.c (init_report_iterator): Add SQL for the trash check.

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

	* src/manage_sql.c (manage_count_hosts): Adjust openvas_hosts_exclude
	call.

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

	* src/manage_sql.c (report_progress_xml): New function.  Body from
	omp.c.
	(report_active): New function.
	(print_report_xml): Include progress with task.

	* src/manage.h: Update header accordingly.

	* src/omp.c (omp_xml_handle_end_element): In GET_REPORTS call
	report_progress_xml to get the progress.

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

	Make reports sortable by task name and severity.

	* src/manage.h (report_severity): New function prototype.

	* src/manage_sql.c (init_manage_process): Add SQL function
	report_severity, rename sql_severity to sql_task_severity.
	(REPORT_ITERATOR_FILTER_COLUMNS): Add columns task and severity.
	(REPORT_ITERATOR_COLUMNS) Add overridesparameter. Add columns task and
	severity.
	(report_count, init_report_iterator): Add overrides parameter.
	(report_severity): New function.

	* src/sql.c (sql_report_severity): New function.
	(sql_severity): Remove. Renamed to sql_task_severity.
	(sql_task_severity): New function. Renamed sql_severity to this. Return
	SEVERITY_MISSING instead of 0.0 in case severity is missing.

	* src/sql.h (sql_report_severity): New function prototype.
	(sql_severity): Remove. Renamed to sql_task_severity.
	(sql_task_severity): New function proto. Renamed sql_severity to this.

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

	Add targets reverse_lookup_only and reverse_lookup_unify. Hence increase
	database version to 96. Add database migration from version 95 to 96.

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

	* src/manage_migrators.c (migrate_95_to_96): New function.
	(database_migrators): Add migrate_95_to_96.

	* src/manage.h: Add and adjust prototypes.

	* src/manage_sql.c (create_target, modify_target, copy_target)
	(delete_target, manage_restore): Handle target reverse lookup options.
	(TARGET_ITERATOR_FILTER_COLUMNS): Add exclude_hosts column.
	(TARGET_ITERATOR_COLUMNS): Add target reverse lookup columns.
	(target_iterator_reverse_lookup_only)
	(target_iterator_reverse_lookup_unify): New functions.
	(target_reverse_lookup_only, target_reverse_lookup_unify): New
	functions.

	* src/manage.c (run_task): Send reverse_lookup_only and
	reverse_lookup_unify preferences.

	* src/omp.c (create_target_data_t, modify_target_data_t): Add target
	reverse lookup elements.
	(create_target_data_reset, modify_target_data_reset): Free target
	reverse lookup elements.
	(client_state_t): Add target reverse lookup states.
	(omp_xml_handle_start_element, omp_xml_handle_start_element)
	(omp_xml_handle_text): Handle new target creation and modification
	states.

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

	Change report_counts schema to cache result counts by severity value
	not per threat level. Hence increase database version to 95.
	Add database migration from version 94 to 95.

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

	* src/manage_migrators.c (migrate_94_to_95): New function.
	(database_migrators): Add migrate_94_to_95.

	* src/manage.c (severity_data_index): Make non-static. Fix param doc.
	(severity_data_value, severity_data_add_count): New functions.

	* src/manage.h (severity_data_index, severity_data_value)
	(severity_data_add_count, reports_clear_count_cache): New function
	prototypes.

	* src/manage_sql.c (create_tables): Change report_counts schema to cache
	result counts by severity value not per threat level.
	(init_manage): Clear cache with reports_clear_count_cache.
	(reports_clear_count_cache): Adapt to new cache schema.
	(report_severity_data): Handle NULL severity_data parameter.
	(try_init_counts_cache): Remove. Obsolete with new caching.
	(report_counts_cache_exists, report_counts_from_cache): New functions.
	(cache_report_counts): Cache using severity_data_t and new schema.
	(report_counts_id_filt): Adapt to new caching and also use cache when
	filter parameters are NULL.

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

	* src/omp.c (omp_xml_handle_end_element): Clean code for
	CLIENT_GET_TARGETS case. Send empty string when target has no
	exclude_hosts value.

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

	* src/manage.c (run_task): Send target exclude_hosts when available as a
	preference to the scanner.

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

	* report_formats/verinice-ism/gsm_verinice_ism.xsl: Add control
	implemented property to mark scanned vulnerabilities.

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

	Add targets exclude_hosts. Hence increase database version to 94. Add
	database migration from version 93 to 94.

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

	* src/manage_migrators.c (migrate_93_to_94): New function.
	(database_migrators): Add migrate_93_to_94.

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

	* src/manage_sql.c (create_tables): Add exclude_hosts column to targets
	and targets_trash tables.
	(init_manage_process): Set max_hosts number of arguments to 2.
	(manage_max_hosts): Rename to manage_count_hosts. Add 2nd argument for
	excluded hosts string.
	(create_target, copy_target, delete_target, modify_target)
	(manage_restore): Handle targets exclude_hosts value.
	(TARGET_ITERATOR_COLUMNS, TARGET_ITERATOR_TRASH_COLUMNS): Iterate over
	exclude_hosts column too.
	(target_iterator_exclude_hosts, target_exclude_hosts)
	(trash_target_exclude_hosts): New functions.
	(create_target_data_reset, modify_target_data_reset): Free
	exclude_hosts.
	(create_target_data_t, modify_target_data_t): Add exclude_hosts element.
	(client_state_t): Add CLIENT_CREATE_TARGET_EXCLUDE_HOSTS and
	CLIENT_MODIFY_TARGET_EXCLUDE_HOSTS state.
	(omp_xml_handle_start_element, omp_xml_handle_text): Handle new states.
	(omp_xml_handle_end_element): Send exclude_hosts in CLIENT_GET_TARGETS
	case. Adjust total target IPs counting.

	* src/sql.c (sql_max_hosts): Adjust for manage_max_hosts change.

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

	* src/manage_sql.c (init_severity_data): Add missing spaces.

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

	* ChangeLog: Fix function name report_count_filtered.

	* src/manage.c (severity_data_index): Fix check for SEVERITY_ERROR.
	(init_severity_data, cleanup_severity_data): Use g_malloc0 and g_free
	instead of malloc and free.
	(LEVEL_COUNT): Remove.
	(severity_data_level_counts): Use severity_data_range_count directly
	instead of LEVEL_COUNT macro.

	* src/manage_sql.c (report_severity_data): Add missing parameter
	documentation. Remove unused nvt variable. Fix indentation.
	(report_counts_id_filt): Enable results cache again.

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

	Add severity_data type for internal handling of severity counts and use
	it for counting results.

	* src/manage.c (level_min_severity, level_max_severity)
	(init_severity_data, cleanup_severity_data, severity_data_add)
	(severity_data_count, severity_data_range_count)
	(severity_data_level_counts): New functions for handling data in the
	new severity_data_t struct.
	(LEVEL_COUNT): New macro to count severities in a given level.

	* src/manage.h (): Create new section for general severity related
	definitions.
	(SEVERITY_MISSING, SEVERITY_UNDEFINED): New severity constants.
	(SEVERITY_MAX, SEVERITY_SUBDIVISIONS): New constants describing the
	format of severity scores.
	(level_min_severity, level_max_severity): New function prototypes.
	(severity_data_t): New typedef struct for severity counts and maxima.
	(init_severity_data, cleanup_severity_data, severity_data_add)
	(severity_data_count, severity_data_range_count)
	(severity_data_level_counts): New function prototypes.

	* src/manage_sql.c (where_autofp, report_severity)
	(report_severity_filtered, report_result_count)
	(report_count_filtered): Remove. Replaced with
	report_severity_data.
	(report_severity_data): New function to gather severity counts and
	maximum severity.
	(report_counts_id_filt): Use new severity_data_t functions to count
	results.

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

	* src/manage_migrators.c (migrate_92_to_93): Remove duplicate SQL.

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

	Remove config preference host_expansion.  Hence increase database
	version to 93.  Add database migration from version 92 to 93.

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

	* src/manage_migrators.c (migrate_92_to_93): New function.
	(database_migrators): Add migrate_92_to_93.

	* src/manage_sql.c (setup_full_config_prefs): Remove host_expansion.

	* doc/db.png: Update for version changes.

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

	* src/schema_formats/XML/OMP.xml: Add first CHANGE element, about a
	compatibility change in GET_REPORTS.

	* src/schema_formats/HTML/HTML.xsl (change, changes): New templates.
	(protocol): Add Compatibility Changes section.

	* doc/omp.html: Update from source.

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

	* src/manage_sql.c (REPORT_ITERATOR_FILTER_COLUMNS)
	(REPORT_ITERATOR_COLUMNS): Add date.

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

	* src/lsc_crypt.c (lsc_crypt_new, lsc_crypt_create_key): Remove void for
	consistency.

	* src/lsc_crypt.h: Update headers accordingly.

	* src/manage.c (run_task): Remove void cast that was for splint.

	* src/manage_sql.c (get_sysconf_gpghome, get_trustedkeys_name): Remove
	void for consistency.

	* src/omp.c (omp_xml_handle_end_element): Remove void cast that was for
	splint.

	* src/otp.c (maybe_free_scanner_rules): Remove void cast that was for
	splint.

	* src/splint.h (g_rand_new): Remove void for consistency.

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

	* src/manage_sql.c (manage_clean_filter_remove): Check length of column
	too, just to be safe.

	* src/omp.c (omp_xml_handle_end_element): Correct the check to see if a
	single result was requested.

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

	Add filter_replace param to GET_REPORTS, so that the client can specify
	the task_id to be used in the filter.

	* src/omp.c (init_get): Add a keyword from the "filter" param to the
	filter when the "filter_replace" param is given.  Free filter.
	(get_data_reset, get_data_parse_attributes): Add replace fields.
	(send_get_end): Use the replacement filter if there is one.

	* src/manage_sql.c (manage_clean_filter_remove): New function.  Based
	on manage_clean_filter, but also removes a given keyword.
	(manage_clean_filter): Call manage_clean_filter_remove to do the work.
	(init_get_iterator): Use replacement filter if there is one.
	(REPORT_ITERATOR_COLUMNS): Add missing task_id.

	* src/manage.h: Update headers accordingly.

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

	* src/manage_sql.c (setup_full_config_prefs): Removed handling
	of "slice_network_addresses", "kb_dont_replay_scanners",
	"kb_dont_replay_denials", "kb_dont_replay_info_gathering",
	"kb_dont_replay_attacks", "kb_max_age", "save_knowledge_base",
	"kb_restore", "only_test_hosts_whose_kb_we_dont_have" and
	"only_test_hosts_whose_kb_we_have".
	All of these settings were removed from the Scanner.

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

	* src/omp.c (omp_xml_handle_start_element): Remove setting of static
	result filter for GET_REPORTS, now done in end handler.
	(omp_xml_handle_end_element): In GET_REPORTS set the simple result
	filter after INIT_GET, making sure to get the override value of the
	report filter from the filt_id param if it's given.

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

	* src/omp.c (INIT_GET): Doc arg.
	(omp_xml_handle_end_element): In GET_REPORTS remove the explicit setup
	of the get_reports_data->get filter because the first INIT_GET case does
	that already, and expand the INIT_GET in the second case in order to
	pass in get_reports_data->report_get.

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

	Rename the old report filtering type and setting, as they are for
	results.  Hence increase database version to 92. Add database migration
	from version 91 to 92.  Also make the GET_REPORTS returned filter depend
	on the context.

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

	* src/manage_migrators.c (migrate_91_to_92): New function.
	(database_migrators): Add migrate_91_to_92.

	* src/manage_sql.c (modify_setting): Add Results Filter.

	* src/omp.c (omp_xml_handle_end_element): In GET_REPORTS, if a specific
	report was requested, put the result filtering in the response,
	otherwise put the report filtering.

	* doc/db.png: Update for version changes.

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

	* src/manage_sql.c (REPORT_ITERATOR_FILTER_COLUMNS)
	(REPORT_ITERATOR_COLUMNS): Add status.

	* src/omp.c (send_get_end): Clean "" filter, so that the defaults are
	applied.

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

	Use base/openvas_hosts api for hosts strings counting and validation.

	* manage_sql.c: Include base/openvas_hosts.h
	(strbchr, contains_alpha, validate_host): Remove unused functions.
	(manage_max_hosts): Remove old code. Replace with openvas_hosts_new and
	openvas_hosts_count to return correct hosts count.

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

	* src/schema_formats/XML/OMP.xml (threat): Reduce backward
	compatibility to import of old reports only in description.

	* doc/omp.html: Update from source.

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

	* src/manage_sql.c (filter_clause): Allow search for empty ..._id
	(e.g. task_id) and include results with empty ..._id if a ..._id
	filter term is given.

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

	* src/schema_formats/XML/OMP.xml (severity, threat): Add info on usage.

	* doc/omp.html, doc/omp.rnc: Update from source.

2013-08-30  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/CMakeLists.txt: Remove handling of oxpd.c.

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

	* src/ompd.c (serve_omp): Remove initial process_omp_client_input call,
	now that read_protocol is gone.

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

	Remove protocol check that was only need for --otp.  Merge the rest of
	oxpd.c back into ompd.c.

	* src/ompd.c: Remove oxpd.h.
	(from_client, from_scanner, from_client_start, from_client_end)
	(from_scanner_end, scanner_address): New variables.  From oxpd.c.

	* src/ompd.h: Update headers accordingly.
	(READ_PROTOCOL_TIMEOUT, FROM_BUFFER_SIZE): New defines.  From oxpd.h.

	* src/openvasmd.c: Remove oxpd.h.
	(serve_client): Just serve OMP, instead of doing a protocol check.

	* src/oxpd.c, src/oxpd.h: Remove.

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

	Remove OTP port forwarding mode, --otp.

	* src/CMakeLists.txt: Remove otpd.c.

	* src/openvasmd.c: Remove mention in mainpage doc.  Remove header.
	(otp): Remove.
	(serve_client): Remove read_protocol OTP case.
	(main): Remove --otp.

	* src/otp.h: Remove otpd.c reference.

	* src/otpd.c, src/otpd.h: Remove.

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

	* src/omp.c (omp_xml_handle_end_element): Add back init of get in
	GET_REPORTS, otherwise the results one is used.

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

	* src/manage_sql.c (backup_db): Silence ls errors, which occur when
	there is no journal.

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

	* src/manage_sql.c (backup_db): Copy any journal style files, instead of
	of expecting a single task.db-journal file.

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

	* src/manage_sql.c (NOTE_ITERATOR_TRASH_COLUMNS): Add missing comma.

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

	Replace threat in notes with severity.  Hence increase database version
	to 91. Add database migration from version 90 to 91.

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

	* src/manage_migrators.c (migrate_90_to_91): New function.
	(database_migrators): Add migrate_90_to_91.

	* src/manage.h (create_note, modify_note): Add parameter.
	(note_iterator_severity): New function prototype.

	* src/manage_sql.c (create_tables): Replace threat with severity in
	notes and notes_trash.
	(create_note, modify_note): Use severity instead of threat column and
	convert threat parameter to severity if there is no severity given.
	(copy_note, delete_note): Use severity instead of threat column.
	(NOTE_ITERATOR_FILTER_COLUMNS, NOTE_ITERATOR_COLUMNS)
	(NOTE_ITERATOR_TRASH_COLUMNS): Add severity column and derive threat
	from that.
	(note_iterator_severity): New iterator function.
	(manage_restore): Use severity instead of threat column for notes.

	* src/omp.c (create_note_data_t, create_note_data_reset): Add severity
	component.
	(client_state_t): Add CLIENT_CREATE_NOTE_SEVERITY and
	CLIENT_MODIFY_NOTE_SEVERITY
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add severity subelement to create_note
	and modify_note.
	(buffer_notes_xml): Add severity to detailed get_notes response.

	* src/schema_formats/XML/OMP.xml (create_note, modify_note): Add
	severity element to command.
	(get_notes): Add severity element to note in response and to result in
	the note subelement.

	* doc/omp.html, doc/omp.rnc: Update from source.

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

	* src/omp.c (omp_xml_handle_end_element): Remove GET_REPORTS init
	already done by INIT_GET.

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

	* src/manage_sql.c (print_report_xml): Cleanup result iterators on error
	return.  Cleanup delta result iterator before normal return.

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

	* src/omp.c (omp_xml_handle_start_element): For GET_REPORTS use a fixed
	result filter when there's a report filter.

2013-08-27  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (OVERRIDE_ITERATOR_FILTER_COLUMNS): Add column
	"active".
	(OVERRIDE_ITERATOR_COLUMNS): Name the "active" column for filtering.

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

	* src/manage_sql.c (REPORT_ITERATOR_FILTER_COLUMNS): Add name for
	sorting.

	* src/omp.c (omp_xml_handle_end_element): In GET_REPORTS use the start
	and end GET macros, check the init_report_iterator return, and send the
	common GET XML for each report.

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

	* manage.h: Remove scanner_plugins_list and insert_plugins_list
	declarations.
	(manage_complete_nvt_cache_update): Adjust prototype.

	* manage_sql.c (insert_nvt_from_nvti): Move up in file.
	(insert_plugins_list): Rename to insert_nvts_list. Move up in file.
	(manage_complete_nvt_cache_update): Add nvts_list parameter. Call
	insert_nvts_list.

	* src/openvasmd.c (update_or_rebuild_nvt_cache): Remove
	insert_plugins_list call.

	* src/otp.c (parse_scanner_plug_list_tags): Update comment.
	(process_otp_scanner_input): Adjust manage_complete_nvt_cache_update
	call.

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

	Make manager rebuilds way faster by grouping NVT inserts in a single
	transactions instead of one transaction/insertion.

	* src/manage_sql.c (insert_plugins_list, insert_nvt_from_nvti): New
	functions.

	* src/manage.h: Add insert_plugins_list prototype. Add
	scanner_plugins_list declaration.

	* src/openvasmd.c (update_or_rebuild_nvt_cache): insert scanner plugins
	list before successful return.

	* src/otp.c (scanner_plugins_list): New global variable.
	(parse_scanner_plugin_list_tags): Don't insert nvti into DB, add to
	scanner_plugins_list instead.

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

	* src/lsc_user.c (lsc_user_keys_create): Remove unused login parameter.

	* src/lsc_user.h, src/manage.h: Adjust headers accordingly.

	* src/manage.c (slave_setup): Adjust init_user_target_iterator call.
	(run_slave_task): Remove unused report_id and from parameters.
	(run_task): Adjust run_slave_task call.

	* src/manage_sql.c (manage_cleanup_process_error): Use signal parameter
	for debug logging.
	(set_task_description): Use length parameter instead of calling strlen.
	(prognostic_report_results_count): Remove unused logs parameter.
	(print_report_assets_xml, print_report_prognostic_xml): Remove unused
	report parameter.
	(print_report_xml, create_lsc_credential): Adjust function calls.
	(init_user_target_iterator): Remove unused first and max parameters.
	(send_get_start, SEND_GET_START): Remove unused get parameter.
	(omp_xml_handle_end_element): Adjust SEND_GET_START macro call.

	* src/openvasmd.c (handle_sigabrt, handle_sigterm, handle_sighup)
	(handle_sighup_update): Use signal parameter for debug logging.

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

	* src/manage_sql.c (init_result_iterator, result_iterator_severity)
	(result_iterator_severity_double): Use SEVERITY_FP (-1.0) as severity
	value for automatic false positives.

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

	* src/schema_formats/XML/OMP.xml (protocol): Add severity type.
	(result_overrides, result, create_override, create_override): Add
	severity and related elements, update text for threat elements.
	(report, get_info, get_results, get_tasks): Use new severity type
	instead of text for severity and related elements.

	* doc/omp.html, doc/omp.rnc: Update from source.

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

	* src/manage_sql.c (manage_report_filter_controls): Add apply_overrides.
	(print_report_xml): Get the apply_override value from the filter if a
	filter is given.

	* src/manage.h: Update headers accordingly.

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

	* src/manage_sql.c (REPORT_ITERATOR_FILTER_COLUMNS): Add task_id.
	(print_report_xml): Skip bulk of report when details flag is 0.
	(manage_report): Set details flag now that it is checked.

	* src/omp.c (omp_xml_handle_start_element): For GET_REPORTS reparse
	the details flag, to keep the default value backward compatible.

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

	* src/manage_sql.c (print_report_prognostic_xml): New function.
	(print_report_xml): Move prognostic case out to new function.

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

	* src/manage_sql.c (ALL_INFO_UNIION_COLUMNS): Query for NVT tag when
	summary is NOSUMMARY which is used for new nvt style plugins.

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

	* src/omp.c (omp_xml_handle_start_element): Use correct global name.

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

	Switch the report iterator to the new style.

	* src/omp.c (get_reports_data_t, get_reports_data_reset): Add report_get.
	(omp_xml_handle_start_element): Parse report_filter and report_filt_id
	for GET_REPORTS.
	(send_reports): Update function name.
	(omp_xml_handle_end_element): Update to new style iterator.

	* src/manage_sql.c (REPORT_ITERATOR_FILTER_COLUMNS)
	(REPORT_ITERATOR_COLUMNS): New defines.
	(report_count): Convert to report counting, to match standard count
	functions.
	(init_report_iterator): Switch to new style.
	(init_report_iterator_task): New function.  Old style for internal
	calls.
	(report_result_count): New function.  Was result_count.  Update callers.

	* src/manage.h: Update headers accordingly.

	* src/manage.c (delete_reports): Update function name.

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

	* src/manage_sql.c (send_get_end): Append to XML with escaping.

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

	* src/manage_sql.c (parse_keyword): Make the keyword a string when
	it is empty, instead of making it an integer.  This brings back the
	NULL and empty string checks in the SQL for keywords like "type=".

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

	* doc/db.png: Update for version changes.

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

	Make Groups, Roles and Users shared between all admins.  Hence increase
	database version to 90.  Add database migration from version 89 to 90.

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

	* src/manage_migrators.c (migrate_89_to_90): New function.
	(database_migrators): Add migrate_89_to_90.

	* src/manage_sql.c (copy_resource_lock): Ensure owner is always NULL for
	groups, roles and users.
	(create_group, create_user): Set owner to NULL.

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

	* INSTALL: Updated reference system from Debian 6 to 7.

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

	* src/omp.c (APPLY_OVERRIDES_DEFAULT): New define.
	(send_get_end): Ensure the apply_overrides term is always present,
	similar to first and rows.
	(omp_xml_handle_end_element): Use APPLY_OVERRIDES_DEFAULT in
	CLIENT_GET_TASKS, to keep it safe.

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

	* src/omp.c (send_get_end): Also send filter broken down into XML
	elements.

	* src/manage_sql.c (keyword_type_t, keyword_relation_t, struct keyword)
	(keyword_t): Move out to manage.h.
	(keyword_relation_symbol): New function.
	(filter_free, split_filter): Export.

	* src/manage.h: Update headers accordingly.

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

	* src/manage.c (message_type_threat): Return "Alarm" for "Alarm" type.
	(severity_to_level): Add mode parameter to return "Alarm" for
	severity > 0.0.

	* src/manage.h (severity_to_level): Add parameter and remove parameter
	names.
	(severity_to_type): Remove parameter name.

	* src/manage_sql.c (init_manage_process): Add SQL function
	severity_to_level with 2 arguments.
	(task_previous_level, task_previous_threat_level)
	(result_iterator_original_level, result_iterator_level): Add mode
	parameter for severity_to_level.
	(OVERRIDE_ITERATOR_COLUMNS, OVERRIDE_ITERATOR_TRASH_COLUMNS): Use
	severity_to_level instead of severity_to_type.
	(override_iterator_threat, override_iterator_new_threat): Get threat
	level directly from SQL column.

	* src/sql.c (sql_severity_to_level): Add optional mode parameter.

2013-08-06  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (parse_keyword): Substitute special severity strings
	with their numeric value.

2013-08-06  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (filter_clause): Cast cvss, cvss_base and max_cvss
	as REAL when sorting like severity.

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

	Add trash case to permission check when getting a single item, so that
	GET_* of a single trash item works correctly.

	* src/manage_sql.c (user_owns_uuid, user_has_access_uuid): Add trash
	arg.  Update callers.
	(find_resource): Add task special case, because task trash is in the
	normal table.
	(find_resource_for_actions): Add trash arg.  Update callers.

2013-08-06  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (keyword_type_t): Replace KEYWORD_TYPE_NUMBER
	with KEYWORD_TYPE_INTEGER and KEYWORD_TYPE_DOUBLE.
	(keyword): Replace number component with integer_value and double_value.
	(parse_keyword): Parse filters with no column name, use new integer type
	for times and dates, add parsing of integers and floating point numbers.
	(filter_clause): Cast integer and double keywords as NUMERIC in the
	SQL queries.

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

	* src/omp.c (omp_xml_handle_end_element): In
	CLIENT_CREATE_REPORT_RR_RESULTS_RESULT remove assertions on result
	fields because these depend on the user input.  There are checks for
	this in create_report in manage_sql.c, so it is safe.  Add NULL check
	for threat case.

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

	* src/manage_sql.c (copy_task): Fail to find hidden tasks, to match
	other resource types.

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

	* src/omp.c (omp_xml_handle_end_element): Add comment to try make delete
	clearer.

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

	* src/sql.c (sql_uniquify): Correct arg count in doc.

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

	* src/manage_sql.c (report_severity_filtered, report_counts_id_filt):
	Remove leftover COLLATE expressions.
	(create_override): Add missing comment for severity parameter. Check
	correct strings for threat and new_threat.
	(override_iterator_threat): Move > 0.0 term to new line.

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

	* src/manage.h: Remove some arg names.

	* src/manage_sql.c (do_encrypt_all_credentials): Remove.  Now
	encrypt_all_credentials.  "encrypt" is already a verb.
	(encrypt_all_credentials): New function.  Was
	do_encrypt_all_credentials.

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

	* src/manage_sql.c (where_levels, where_levels_auto, where_levels_type):
	Reformat levels_sql g_string_new and gstring_append calls in
	severity <= 0.0 cases.

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

	Replace the threat and new_threat columns with severity and new_severity
	in overrides and overrides_trash tables.
	Hence increase database version to 89.  Add database migration from
	version 88 to 89.

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

	* src/manage_migrators.c (migrate_88_to_89): New function.
	(database_migrators): Add migrate_88_to_89.

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

	* src/manage.h (severity_matches_ov): New function prototype.
	(create_override, modify_override): Add parameter.
	(override_iterator_severity): New function prototype.
	(override_iterator_new_severity): Change return type to const char*.

	* src/manage_sql.c (create_tables): Replace the threat and new_threat
	columns with severity and new_severity in overrides and overrides_trash
	tables.
	(init_manage_process): Create severity_matches_ov SQLite function.
	(task_severity, init_result_iterator, init_asset_iterator)
	(report_scan_result_count, report_count, report_severity)
	(report_count_filtered, report_severity_filtered, report_counts_id_filt)
	(filtered_host_count): Match results with overrides' severity and
	replace threat level based sorting.
	(create_override, modify_override): Adjust to use severity column
	as replacement for threat. Use threat / new_threat only as fallback if
	severity / new_severity is missing.
	(copy_override, delete_override, OVERRIDE_ITERATOR_FILTER_COLUMNS)
	(OVERRIDE_ITERATOR_COLUMNS, OVERRIDE_ITERATOR_TRASH_COLUMNS): Use
	severity column as replacement for threat.
	(override_count, init_override_iterator): Match results with overrides'
	severity.
	(override_iterator_threat): Return "Alarm" for severity > 0.0.
	(override_iterator_severity): New function.
	(override_iterator_new_severity): Use DEF_ACCESS to return a string
	and adjust column number.

	* src/omp.c (create_override_data_t, create_override_data_reset)
	(modify_override_data_t, modify_override_data_reset, client_state_t,
	xml_handle_start_element, xml_handle_end_element, xml_handle_text):
	Add handling of severity element in create_override, modify_override.
	component.
	(buffer_overrides_xml): Add severity to and adjust new_severity output.

	* src/sql.c (sql_severity_matches_ov): New function.
	(sql_severity_to_level, sql_severity_to_type): Return NULL if given
	severity is NULL or an empty string.

	* src/sql.h (sql_severity_matches_ov): New function prototype.

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

	* ChangeLog: Replace leading whitespaces with tabs in last own entry.

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

	* src/manage_sql.c (create_note, modify_note): Neaten return doc.
	(create_override): Check that NVT exists.  Match returns to create_note.
	(modify_override): Neaten return doc.

	* src/omp.c (omp_xml_handle_end_element): Handle new create_override
	return.

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

	* src/omp.c (omp_xml_handle_start_element): Init MODIFY_TASK observer
	groups in the MODIFY_TASK handler instead of in the OBSERVERS handler,
	to ensure that groups is always initialised.
	(omp_xml_handle_end_element): Remove the CLIENT_MODIFY_TASK "Too few
	parameters" check because it is safe to run an empty command and this is
	easier to maintain.  Also check the length of groups instead of groups,
	otherwise the groups are cleared when they are left out.  The client
	must pass a group with ID 0 to clear them, as with alerts.

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

	* src/omp.c (client_state_t): Order alphabetically.

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

	For sorting by role, make Admin come first, even if it should come
	later alphabetically.

	* src/manage_sql.c (filter_clause): Add special sorting case for role.
	(collate_role): New collator.
	(init_manage_process): Create collate_role.
	(USER_ITERATOR_FILTER_COLUMNS, USER_ITERATOR_COLUMNS): Add role.

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

	* src/omp.c (log_event, log_event_fail): Fix spacing when no resource ID
	is provided.
	(omp_xml_handle_end_element): Fix event name for log_event wizard call.
	Use wizard name as resource id for log_event and log_event_fail calls.

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

	* src/manage_sql.c (where_levels, where_levels_auto): Test new_severity
	instead of severity and new_threat. Test for special cases like log
	messages by comparing only new_severity.
	(where_levels_type): Test for special cases like log messages by
	comparing only severity.
	(init_asset_iterator, report_scan_result_count, filtered_host_count):
	Adapt by getting new_severity for filtering instead of new_type.

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

	* src/omp.c (omp_xml_handle_end_element): Indent user commands cases
	like rest of module.

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

	* CMakeLists.txt: Install pwpolicy.conf directly from source directory.

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

	* src/manage_sql.c (request_delete_task_uuid): Add permission check.

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

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_PERMISSIONS
	remove the specific resource and subject elements under RESOURCE and
	SUBJECT, to keep the response simpler.  All the info is available
	directly under RESOURCE and SUBJECT anyway.

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

	* CMakeLists.txt: Install pwpolicy.conf.  Add it to
	CPACK_SOURCE_IGNORE_FILES too.

	* src/pwpolicy.conf: New file.

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

	* src/openvasmd.c (main): Warn if the password policy is missing.

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

	* src/omp.c (buffer_overrides_xml): Output threat element not only when
	details flag is set.

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

	* src/manage_sql.c (init_manage): Delete orphaned results and clear
	report counts cache if needed.
	(delete_report_internal): Delete results of report from results table.

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

	* src/manage_sql.c (create_override): Use new_threat only if no
	new_severity is given and no longer store it in the database.
	(modify_override): Use new_threat only if no
	new_severity is given and no longer store it in the database. Return
	3 on error in severity.

	* src/omp.c (xml_handle_end_element): In case CLIENT_CREATE_OVERRIDE
	do not fail if new_threat is missing but new_severity is available.

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

	* src/omp.c (send_get_end): Move filter check outside the printf,
	otherwise the clean filter leaks.

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

	* src/manage_sql.c (copy_user): Set password NULL instead of to
	"changeme".  The admin can manually set the password later.

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

	* src/manage_sql.c (valid_type): Add "user".

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

	* src/omp.c (init_get): If the filter_term is NULL use the default
	filter, because most likely the user has requested a deleted filter.
	(get_next): Make the default error an internal error instead of an
	out of space error, because that's more likely the case.
	(omp_xml_handle_end_element): Correct variable in CLIENT_GET_AGENTS.

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

	* src/manage_sql.c (set_task_schedule, request_delete_task)
	(request_delete_task_uuid): handle "scanner down" return from
	stop_task_internal.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_DELETE_TASK
	handle "scanner down" return from request_delete_task_uuid.

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

	* src/manage_sql.c (delete_user): Delete user's report_counts rows.

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

	* src/openvasmd.c (serve_and_schedule): Adjust manage_schedule test
	for new sql_giveup return.  Forgotten file from r17111 yesterday.

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

	* src/manage.c (manage_schedule): Add warnings on error.

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

	* src/manage_sql.c (init_task_schedule_iterator): Add error return.
	(manage_schedule): Add error return.

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

	* INSTALL: Reorder PKG_CONFIG_PATH export, in case another openvas
	installation is already in existing PKG_CONFIG_PATH.

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

	* src/manage_sql.c (create_tables): Add nvt_cves and nvt_cves_by_oid.
	(refresh_nvt_cves): New function.
	(init_manage): Ensure nvt_cves is initialised.  Run ANALYSE after.
	(manage_complete_nvts_cache_update): Update nvt_cves.  Run ANALYSE.
	(init_nvt_dfn_cert_adv_iterator): Use nvt_cves table for speed.

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

	* src/manage_sql.c (init_task_schedule_iterator): Call BEGIN with
	sql_giveup, in case there is a long operation running.  This prevents
	the scheduling from waiting for long op and blocking the main process.

	* src/manage.c (manage_schedule): Return if task iterator fails to get
	lock.

	* src/sql.c (sql_giveup): Add return so caller can tell when gave up.

	* src/manage.h, src/sql.h: Update header accordingly.

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

	* src/manage_sql.c (result_iterator_scan_nvt_version)
	(result_iterator_original_severity, result_iterator_severity)
	(result_iterator_severity_double, result_iterator_original_severity)
	(result_iterator_severity): Move variable declarations to top.
	Add correct DB column comments.
	(report_scan_result_count, filtered_host_count, init_asset_iterator):
	Neaten indentation of SQL in new_type_sql assignment.

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

	* src/manage_migrators.c (migrate_87_to_88): Remove constraints from
	report_counts table and neaten comments.

	* src/manage_sql.c (create_tables): Remove constraints from
	report_counts table.
	(try_init_counts_cache): Replace OR IGNORE with explicit check and
	use == comparison in existence checks. Neaten comments.

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

	Cache report counts and severity for each user and in a new table and
	remove them from reports table.
	Hence increase database version to 88.  Add database migration from
	version 87 to 88.

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

	* src/manage_migrators.c (migrate_87_to_88): New function.
	(database_migrators): Add migrate_87_to_88.

	* src/manage_sql.c (create_tables): Remove counts and severity scores
	from reports table and add new report_counts table.
	(init_manage): Adjust sample data to new tables.
	(reports_clear_count_cache, make_report, cache_report_counts)
	(report_counts_id_filt, delete_report_internal): Do not use reports for
	result counts and use report_counts instead.
	(try_init_counts_cache): New function.
	(task_trend): Get trend only for authenticated users.

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

	* src/manage_sql.c (cache_report_counts): Put severity param in right
	place.  This gets the caching working again, at least for startup.

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

	* src/manage_sql.c (report_count): In SQL of general case use report in
	result instead of report_results.

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

	* src/manage_sql.c (setting_severity): Use quiet SQL interface, because
	this is called so often that the logs grow very quickly.

	* src/sql.c (sql_x_internal): New function.  Body from sql_x.
	(sql_x): Call sql_x_internal.
	(sql_x_quiet, sql_string_quiet): New functions.

	* src/sql.h: Add header accordingly.

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

	* src/omp.c (omp_xml_handle_end_element): Use log_event and
	log_event_fail instead of g_log.

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

	* ChangeLog: Replace leading whitespaces with tabs in last two entries.

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

	* src/manage_sql.c (task_threat_level): Pass overrides parameter to
	task_severity.

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

	* src/manage_sql.c (make_result): Use special severity values for
	False Positives, Log, Debug and Error messages.

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

	* src/manage.c (severity_to_level, severity_to_type): New functions.

	* src/manage.h (task_severity): Add parameter.
	(severity_to_level, severity_to_type, result_iterator_original_level)
	(result_iterator_level): New function prototypes.

	* src/manage_sql.c (init_manage_process): Add SQLite functions
	severity_to_level, severity_to_type,
	(task_threat_level, task_previous_threat_level): Use task_severity
	to get threat level based on severity score.
	(task_severity): Add offset parameter to allow getting severity from
	next to last report.
	(init_result_iterator): Get only severity from database and calculate
	message type.
	(result_iterator_original_level, result_iterator_level): New iterator
	functions.
	(init_asset_iterator, report_scan_result_count, report_count)
	(report_count_filtered, report_severity_filtered, report_counts_id_filt)
	(filtered_host_count, OVERRIDE_ITERATOR_COLUMNS)
	(OVERRIDE_ITERATOR_TRASH_COLUMNS): Calculate message type from severity.

	* src/omp.c (buffer_results_xml): Use result_iterator_level to get
	threat level.

	* src/sql.c (sql_severity): Add parameter for task_severity.
	(sql_severity_to_level, sql_severity_to_type): New SQLite functions.

	* src/sql.h (sql_severity_to_level, sql_severity_to_type): New function
	prototypes.

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

	* src/omp.c (log_event): Style fix.
	(log_event_fail): New function.
	(CASE_DELETE, omp_xml_handle_end_element): Update g_log calls to use
	log_event_fail and log_event accordingly.

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

	* src/manage.c (severity_matches_type): Space doc.  Remove parens from
	returns and remove redundant else's, for readability.

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

	* src/manage.c (severity_matches_type): Add new threat names.

	* src/manage_sql.c (report_count, report_count_filtered): Remove special
	cases for new names, as this is done in severity_matches_type now.

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

	* src/manage_sql.c (report_count): Switch old Alarm types to threat
	names.  In these cases find the results by severity instead of type.
	(report_count_filtered): Add special case for high, medium and low.
	(report_counts_id_filt): Replace old Alarm types with threat names.

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

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

	* src/manage.h (SEVERITY_LOG, SEVERITY_FP, SEVERITY_DEBUG)
	(SEVERITY_ERROR): New constants for special severity values.
	(severity_matches_type): New function prototype.

	* src/manage_sql.c (init_manage_process): Add severity_matches_type SQL
	function.
	(task_threat_level, task_previous_threat_level, task_severity)
	(init_result_iterator, init_asset_iterator, report_scan_result_count)
	(report_count, report_severity, report_count_filtered)
	(report_severity_filtered, report_counts_id_filt, filtered_host_count)
	(note_count, init_note_iterator, override_count)
	(init_override_iterator): Support dynamic severity and apply overrides
	based on severity.

	* src/sql.c (sql_severity_matches_type): New SQL wrapper function.

	* src/sql.h (sql_severity_matches_type): New function prototype.

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

	* src/manage_migrators.c (migrate_86_to_87): Update severity of old
	results before merging the types, otherwise this information is lost.

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

	Switch to new Scanner type Alarm, which replaces Hole, Warning and Note.
	Hence increase database version to 87.  Add database migration from
	version 86 to 87.

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

	* src/manage_migrators.c (migrate_86_to_87): New function.
	(database_migrators): Add migrate_86_to_87.

	* src/manage_sql.c (init_manage_process): Create severity_in_level.
	(make_result): Switch to Alarm.
	(where_levels, where_levels_auto, where_levels_type): Do comparisons
	according to severity score.
	(report_counts_id_filt): Switch to Alarm.  Use severity to determine
	type.

	* src/manage.c (threat_message_type): Switch to Alarm.
	(message_type_threat): Add Alarm case.
	(severity_in_level): New function.

	* src/manage.h: Add header accordingly.

	* src/otp.c (append_hole_message, append_info_message)
	(append_note_message): Remove.
	(append_alarm_messag): New function.
	(scanner_state_t, process_otp_scanner_input): Remove Hole, Info and Note
	cases.  Add Alarm case.

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

	* src/sql.h: Add header accordingly.

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

	* src/manage_sql.c (create_tables): Add new_severity column to
	overrides_trash.

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

	* src/manage_sql.c (init_manage_settings): Fix existence check of
	"Dynamic Severity" setting.

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

	* src/omp.c (omp_xml_handle_end_element): Use log_event instead of
	g_log.

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

	* src/manage.h (create_report_result_t): Add components
	"scan_nvt_version" and "severity".

	* src/manage_sql.c (create_report): Add scan time NVT version and
	Severity to results.

	* src/omp.c (create_report_data_t, create_report_data_reset): Add
	components "scan_nvt_version" and "severity".
	(client_state_t): Add components
	"CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_ORIGINAL_SEVERITY",
	"CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_SCAN_NVT_VERSION",
	"CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_SEVERITY"
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Handle "original_severity", "scan_nvt_version"
	and "severity" subelements of report in create_report.

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

	* src/omp.c (log_event): New function.
	(CASE_DELETE, omp_xml_handle_end_element): Replace g_log calls for
	resources creation, modification and deletion with adequate log_event
	calls.

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

	* src/manage_sql.c (filter_clause): Cast severity column to REAL to
	ensure sorting by numerical value.

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

	* tools/greenbone-scapdata-sync, tools/greenbone-certdata-sync:
	Simplify test and remove unnecessary stat call.

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

	* src/manage_sql.c (delete_override, manage_restore): Add new_severity
	column for moving overrides from/to trashcan.

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

	* src/manage_sql.c (collate_location): New function.
	(init_manage_process): Create collate_location.
	(init_result_iterator): Collate ports with new collator, so that they
	sort properly.

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

	* src/manage_sql.c (init_result_iterator): Make "location" an alias for
	"port" in the sort field.

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

	* src/manage_sql.c (task_threat_level, task_previous_threat_level)
	(init_asset_iterator, report_scan_result_count, report_count):
	Sort overrides also by creation date.
	(task_severity, init_result_iterator): Use new severity of overrides.
	Additionally sort overrides by creation date.

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

	* src/manage.h (modify_override): Add parameter.

	* src/manage_sql.c (modify_override): Add parameter to set
	"new_severity".

	* src/omp.c (modify_override_data_t, modify_override_data_reset): Add
	"new_severity" component.
	(client_state_t): Add CLIENT_MODIFY_OVERRIDE_NEW_SEVERITY.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Handle new "new_severity" subelement of
	modify_override.

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

	* src/manage_sql.c (OVERRIDE_ITERATOR_TRASH_COLUMNS): Add missing comma.

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

	* src/manage.h (create_override): Add parameter.

	* src/manage_sql.c (create_override): Add parameter to set
	"new_severity".
	(copy_override): Add "new_severity" column.

	* src/omp.c (create_override_data_t, create_override_data_reset): Add
	"new_severity" component.
	(client_state_t): Add CLIENT_CREATE_OVERRIDE_NEW_SEVERITY.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Handle new "new_severity" subelement of
	create_override.

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

	* src/manage_sql.c (print_report_port_xml, print_report_xml): Line up
	indentation.

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

	Add CVSS-based severity to overrides table and get_overrides.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Change to 86.

	* src/manage_migrators.c (migrate_85_to_86): New migrator function.
	(database_migrators): Add migrate_85_to_86.

	* src/manage.h (override_iterator_new_severity): New function prototype.

	* src/manage_sql.c (create_tables): Add column "new_severity" to
	tables "overrides" and "overrides_trash".
	(OVERRIDE_ITERATOR_FILTER_COLUMNS, OVERRIDE_ITERATOR_COLUMNS)
	(OVERRIDE_ITERATOR_TRASH_COLUMNS): Add "new_severity" column.
	(override_iterator_new_severity): New iterator function.

	* src/omp.c (buffer_overrides_xml): Add "new_severity" element.

	* src/schema_formats/XML/OMP.xml (get_overrides): Add "new_severity"
	element to response.

	* doc/omp.html, doc/omp.rnc: Update from source.

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

	* src/manage_migrators.c (migrate_84_to_85): Correct version numbers in
	comments.

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

	* src/manage_sql.c (create_filter, modify_filter): Clean filter term so
	that default keywords are added to it.

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

	Add severity to reports.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Change to 85.

	* src/manage.h (task_trend_counts, report_counts, report_counts_id): Add
	new parameters.
	(task_severity): New function prototype.

	* src/manage_migrators.c (migrate_84_to_85): New migrator function.
	(database_migrators): Add migrate_84_to_85.

	* src/manage_sql.c (create_tables): Add columns "severity",
	"override_severity" to table "reports".
	(TASK_ITERATOR_FILTER_COLUMNS, TASK_ITERATOR_COLUMNS): Add column
	"severity".
	(init_manage_process): Add creation of MySQL function "task_severity".
	(task_severity): New function to get the maximum severity of a task.
	(report_cache_counts): Add severity_parameter.
	(report_severity, report_severity_filtered): New functions to get
	the maximum severity of a report.
	(report_counts, cache_report_counts, report_counts_id_filt,
	report_counts_id): Add severity_parameter(s).
	(print_report_assets_xml, print_report_port_xml): Adjust calls of
	report_counts_id, report_counts_id_filt.
	(print_report_xml): Add severity to response.
	(task_trend_calc, task_trend_counts, task_trend): Take severity into
	account when comparing levels.

	* src/omp.c (send_reports)
	(omp_xml_handle_end_element [CLIENT_GET_REPORTS]): Output maximum
	severities of reports.

	* src/sql.c (sql_severity): New SQLite function to get the severity
	of a task.

	* src/sql.h (sql_severity): New function prototype.

	* src/schema_formats/XML/OMP.xml (get_reports): Add "severity" element
	to response.

	* doc/omp.html, doc/omp.rnc: Update from source.

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

	* src/manage_sql.c (print_report_assets_xml): Cleanup iterator in same
	block it was initialised in.

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

	* src/manage_sql.c: Remove old migrator documentation.

	* src/manage_migrators.c: Add updated migrator documentation.

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

	* src/manage_sql.c (init_result_iterator): Cast severity to REAL in
	ORDER BY to ensure that it is sorted by its numerical value.

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

	* src/manage.h (setting_dynamic_severity, setting_dynamic_severity_int):
	New function prototypes.

	* src/manage_sql.c (init_manage_settings): Add new setting
	"Dynamic Severity".
	(init_result_iterator): Rename current_nvt to dynamic_severity
	and get value from setting.
	(setting_dynamic_severity, setting_dynamic_severity_int): New functions
	for getting the "Dynamic Severity" setting.
	(modify_setting): Accept UUID of "Dynamic Severity" setting.

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

	* src/manage_sql.c (init_result_iterator): Always use 0.0 severity
	for automatic false positives in ORDER BY clause.

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

	* src/manage_sql.c (result_iterator_scan_nvt_version)
	(result_iterator_severity, result_iterator_original_severity)
	(result_cmp): Fix comments.

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

	* src/manage_sql.c (init_report_iterator): Replace cvss_base in ORDER BY
	with severity and make it higher priority than message type.
	(result_iterator_severity_double): New iterator function.
	(result_cmp): Replace NVT cvss_base with severity and raise priority
	above message type.

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

	* src/manage_sql.c (init_report_errors_iterator): Add columns
	"nvt_version" and "severity".
	(report_errors_iterator_scan_nvt_version)
	(report_errors_iterator_severity): New iterator functions.
	(PRINT_REPORT_ERROR): Add elements "scan_nvt_version" and "severity".

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

	* tools/greenbone-scapdata-sync, tools/greenbone-certdata-sync: Add
	detection of feed freshness and database integrity to the sync scripts
	for CERT and SCAP data.

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

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Change to 84.

	* src/manage.h (result_iterator_scan_nvt_version)
	(result_iterator_original_severity, result_iterator_severity): New
	function prototypes.

	* src/manage_migrators.c (migrate_83_to_84): New migrator that adds
	columns "nvt_version" and "severity" to results.
	(database_migrators): Add migrate_83_to_84;

	* src/manage_sql.c (create_tables): Add columns "nvt_version" and
	"severity" to results.
	(make_result): Add nvt_version and severity to results if possible.
	(result_iterator_scan_nvt_version, result_iterator_original_severity)
	(result_iterator_severity): New iterator functions.

	* src/omp.c (buffer_results_xml): Add elements "scan_nvt_version",
	"severity", "original_severity".

	* src/schema_formats/XML/OMP.xml (get_results): Add elements
	"scan_nvt_version", "severity", "original_severity" to response.

	* doc/omp.html, doc/omp.rnc: Update from source.

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

	* src/manage_sql.c (print_report_port_xml): Send matching port cvss
	instead of threat string.

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

	Add regular expression searching to powerfilter columns, using syntax
	"column:regexp".

	* src/manage_sql.c (keyword_relation_t): Add regexp element.
	(split_filter, manage_clean_filter, filter_clause): Handle regexp case.

2013-06-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Add regular expression searching to powerfilter, using new RE or REGEXP
	keyword.

	* src/manage_sql.c (filter_clause): Support regexps.
	(init_manage_process): Create SQL function regexp.

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

	* src/sql.h: Add header accordingly.

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

	* CMakeLists.txt: Make SVN revision in version string available again
	for out-of-source build.

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

	Post release version bump.

	* CMakeLists.txt: Updated version number to 5.0+beta2.

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

	Preparing the openvas-manager 5.0+beta1 release.

	* CHANGES: Updated.

	* INSTALL: Updated, added section on credential encryption key
	migration.

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

	* README: Dropped mentioning of special user "om" as it
	does not exist this way anymore.

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

	* src/manage_sql.c (validate_results_port): Also try to validate results
	in old format "foo (123/bar)"

2013-06-24  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	* src/report_formats/Topology/hostvisdot-summary.xsl (): Update
	copyright and author data.
	(report): Get traceroute and ports directly from host detail.
	(result [trace]): Removed. Replaced by detail [trace].
	(detail [trace]): New template, adapted result [trace] to use traceroute
	from host detail element.

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

	* src/manage_sql.c (delete_group): Handle move group to trashcan case.
	Check whether a group is in use by a permission. Move group users too.
	(group_in_use): Check for permissions using the group.
	(manage_restore): Handle restoring a group from trashcan.
	(manage_empty_trashcan): Empty groups_trash and group_users_trash too.

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

	* src/manage_sql.c (create_tables): Create groups_trash and
	group_users_trash tables.
	(GROUP_ITERATOR_TRASH_COLUMNS): New define.
	(group_count, init_group_iterator): Add trash columns.

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

	* src/manage_sql.c (omp_xml_handle_end_element): Add log for successful
	creation in CREATE_NOTE and CREATE_OVERRIDE.

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

	* src/manage_sql.c (filter_clause, print_report_xml): Neaten formatting.

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

	* src/manage_sql.c (filter_clause): Always use AND for the special
	owner=any keyword, because this keyword is for the ownership clause
	and using OR makes everything match the filter.  Also add the NOT case,
	for completeness.

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

	* src/manage_sql.c (copy_tag): Remove redundant null pointer check.

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

	* src/manage_sql.c (info_name_count): Quote name for SQL query.
	(copy_tag): Free name and ID correctly when failing to find tag.
	(init_resource_tag_iterator, resource_tag_count): Quote resource ID
	for SQL query.

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

	* src/manage_sql.c, src/manage.h: Rename manage_set_setting to
	modify_setting for consistency with other modify commands.

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

	* src/manage.h (all_info_iterator_severity): New function prototype.

	* src/manage_sql.c (ALL_INFO_ITERATOR_FILTER_COLUMNS)
	(ALL_INFO_UNION_COLUMNS): Add column "severity".
	(all_info_iterator_severity): New iterator function.

	* src/omp.c (omp_xml_handle_end_element): In case CLIENT_GET_INFO,
	add "severity" element for allinfo.

	* src/schema_formats/XML/OMP.xml (get_info): Add "severity" element to
	response.

	* doc/omp.html, doc/omp.rnc: Update from source.

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

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

	* src/manage.h: Add modify_report_format header.

	* src/manage_sql.c (omp_xml_handle_end_element): Convert
	MODIFY_REPORT_FORMAT case to use modify_report_format and new
	consistent style for modify commands.

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

	* src/manage_sql.c, src/manage.h (set_report_parameter): Remove unused
	function.

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

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

	* src/manage.h: Add modify_report header.

	* src/manage_sql.c (omp_xml_handle_end_element): Convert MODIFY_REPORT
	case to use modify_report and new consistent style for modify commands.

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

	* src/manage_sql.c (NVT_ITERATOR_COLUMNS)
	(NVT_ITERATOR_COLUMNS_NVTS): Add name to dummy owner column, in case it
	appears in filtering.

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

	* src/manage_sql.c (where_owned): Use defines for locations.

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

	Get trashcan working.

	* src/manage_sql.c (where_owned): Add check for task, because the trash
	is in the regular table.
	(count): Add trash_columns arg for trash case, because the owner column
	accesses the table by name, so using the normal column causes an error.
	Update all callers.  Also add checks for task, as above.
	(ALERT_ITERATOR_TRASH_COLUMNS, NOTE_ITERATOR_TRASH_COLUMNS)
	(OVERRIDE_ITERATOR_TRASH_COLUMNS): Correct table name.
	(trash_report_format_writable): Use trash specific function to get
	global state.
	(trash_report_format_global): New function.
	(PERMISSION_ITERATOR_TRASH_COLUMNS): New define.
	(TAG_ITERATOR_COLUMNS): Line up \.
	(TAG_ITERATOR_TRASH_COLUMNS): Correct table name.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_end_element): Call trash specific function
	to get global state in trash case in GET_REPORT_FORMATS.

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

	* src/manage_sql.c (CPE_INFO_ITERATOR_FILTER_COLUMNS)
	(CPE_INFO_ITERATOR_COLUMNS, OVALDEF_INFO_ITERATOR_FILTER_COLUMNS)
	(OVALDEF_INFO_ITERATOR_COLUMNS)
	(DFN_CERT_ADV_INFO_ITERATOR_FILTER_COLUMNS)
	(DFN_CERT_ADV_INFO_ITERATOR_COLUMNS): Add "severity" alias for max_cvss.

	* tools/greenbone-certdata-sync, tools/greenbone-scapdata-sync,
	tools/openvas-certdata-sync.in, tools/openvas-scapdata-sync.in
	(update_cvss): Change max_cvss for no CVEs to empty string.

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

	* src/manage_sql.c (modify_lsc_credential): Allow setting certain
	parameters only instead of overwriting with empty string.

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

	Adjust version identification string for protocol version switch.

	* src/ompd.c (write_to_scanner): Replace 1.x with 2.xbeta1 to match
	changes in openvas-scanner.

	* src/otp.c (process_otp_scanner_input): Replace 1.x with 2.xbeta1 to match
	changes in openvas-scanner. Adjust string lengths.

	* src/oxpd.c: Adjust OTP initialisation strings.

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

	* src/manage_sql.c (AGENT_ITERATOR_TRASH_COLUMNS): Specify columns
	explicitly so that agents_trash is used in users check instead of
	agents.

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

	* src/sql.c (sql_resource_exists, sql_resource_name): Alway finalize
	stmt, otherwise there are open statements when closing the db.

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

	* src/omp.c (omp_xml_handle_end_element): Switch the response on task
	control ops and RESTORE from Internal Error to Syntax Error.

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

	* src/manage_sql.c (user_has_access_uuid): Enable role check in result
	case.

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

	* src/manage_sql.c (user_has_access_uuid): Add missing arg.

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

	* src/manage_sql.c (omp_commands): Order alphabetically.

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

	* doc/db_postgres.sql (nvts): Remove nvt risk_factor.

	* doc/db.png: Update for version changes.

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

	Remove NVT risk_factor column. Migrate DB to version 83.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Bump to 83.

	* src/manage_migrators.c (migrate_82_to_83): New function.
	(database_migrators): Add migrate_82_to_83.

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

	* src/manage_sql.c (NVT_ITERATOR_COLUMNS_NVT): Add aliases for cvss_base
	to match NVT_ITERATOR_COLUMNS.

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

	Remove NVT risk factor.

	* src/manage.c (get_nvti_xml): Remove risk_factor element.

	* src/manage.h: Remove result_iterator_nvt_risk_factor and
	nvt_iterator_risk_factor headers.

	* src/manage_sql.c (create_tables): Don't create nvt table with
	risk_factor column.
	(result_iterator_risk_factor, report_errors_iterator_nvt_threat)
	(nvt_iterator_risk_factor): Delete functions.
	(init_report_errors_iterator): Adjust query for nvt
	risk_factor
	removal.
	(PRINT_REPORT_ERROR): Remove nvt threat.
	(make_nvt_from_nvti): Adjust for risk_factor column removal.
	(NVT_INFO_ITERATOR_FILTER_COLUMNS, NVT_ITERATOR_COLUMNS)
	(NVT_ITERATOR_COLUMNS_NVTS): Remove nvt risk_factor column.

	* src/omp.c (client_state_t, omp_xml_handle_start_element)
	(omp_xml_handle_end_element): Remove nvt risk_factor state and its
	handling.
	(buffer_results_xml): Don't send nvt risk_factor.

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

	* src/manage_sql.c (CVE_INFO_ITERATOR_FILTER_COLUMNS)
	(CVE_ITERATOR_COLUMNS): Add severity alias for cvss column.

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

	* src/manage_sql.c (NVT_INFO_ITERATOR_FILTER_COLUMNS)
	(NVT_ITERATOR_COLUMNS): Add cvss alias for cvss_base column.

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

	* src/manage_sql.c (NVT_INFO_ITERATOR_FILTER_COLUMNS)
	(NVT_ITERATOR_COLUMNS): Add severity alias for cvss_base column.

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

	* src/manage_sql.c (create_permission): Require a subject.

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

	* src/manage_sql.c (create_permission): Leave resource as 0 if ID is ""
	or "0".

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

	* src/manage_sql.c (user_has_access_uuid): Add special case for checking
	the permission on permissions, because a user has read access to
	permission that mention the user.

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

	* src/manage_sql.c (user_has_access_uuid): Enable role checks.

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

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

	* src/manage.h: Add modify_lsc_credential prototype.

	* src/omp.c (omp_xml_handle_end_element): Adapt MODIFY_LSC_CREDENTIAL
	to use new modify style.

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

	* src/manage_sql.c (REPORT_FORMAT_ITERATOR_COLUMNS)
	(REPORT_FORMAT_ITERATOR_TRASH_COLUMNS): Add dummy owner column.

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

	* src/omp.c (omp_xml_handle_end_element): In GET_REPORT_FORMATS send
	TRUST and ACTIVE in details case too.  Details cases should always
	include everything from the simple case.

2013-06-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (filter_clause): Add support for owner=any, now that
	there is actually an owner column in the GET selections.

2013-06-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Remove OWNER from GET_TASKS,
	because SEND_GET_COMMON sends it now.

2013-06-15  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OWNER to standard GET response.

	* src/manage_sql.c (GET_ITERATOR_FILTER_COLUMNS): Add owner to filter
	columns.
	(GET_ITERATOR_COLUMNS): Add owner column.  Add table arg to support owner
	column.  Add new arg to all callers.
	(GET_ITERATOR_COLUMN_COUNT): Increment for new column.
	(NVT_ITERATOR_COLUMNS): Use GET_ITERATOR_COLUMN_PREFIX, and add dummy
	owner.
	(NVT_ITERATOR_COLUMNS_NVTS): Add dummy owner.
	(get_iterator_owner_name): New function.
	(NOTE_ITERATOR_COLUMNS, NOTE_ITERATOR_TRASH_COLUMNS)
	(OVERRIDE_ITERATOR_COLUMNS, OVERRIDE_ITERATOR_TRASH_COLUMNS): Add owner
	column by hand.
	(CVE_INFO_ITERATOR_COLUMNS): Add dummy owner column.
	(CPE_INFO_ITERATOR_COLUMNS, OVALDEF_INFO_ITERATOR_COLUMNS)
	(DFN_CERT_ADV_INFO_ITERATOR_COLUMNS, ALL_INFO_UNION_COLUMNS): Use
	GET_ITERATOR_COLUMN_PREFIX, and add dummy owner.
	(init_all_info_iterator): Add owner to SQL.

	* src/manage.h: Add header accordingly.

	* src/omp.c (send_get_common): Send owner too.
	(buffer_notes_xml, buffer_overrides_xml): Send owner by hand.

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

	* src/manage_sql.c (resource_count): Use permission "any" instead of a
	specific GET command.

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

	* src/manage_sql.c (where_owned): New function.  Body init_get_iterator.
	(init_get_iterator): Call where_owned to get the owner clause.
	(count): Call where_owned to get the full owner owner clause.
	(resource_count): Add permission keyword to the filter, so that the
	count includes observed resources.

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

	* src/manage_sql.c (CASE_DELETE): Use actual resource type in error
	in "permission denied" error message.

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

	* src/manage.h: Remove manage_migrators.h include. Add
	manage_migrate_needs_timezone header.

	* src/manage_migrators.c: Remove manage_migrators.h include. Add
	migrator_t typedef and move down database_migrators array.

	* src/manage_migrators.h: Remove file.

	* src/manage_sql.c: Remove manage_migrators.h include.

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

	* src/manage_sql.c: Remove migrator related functions, types and
	definitions.

	* src/manage_migrators.c: Add migrator related functions and definitions
	from manage_sql.c. Add openvas_logging.h include.

	* src/manage_migrators.h: Add function prototypes. Add migrator_t struct
	definition. Add glib include.

	* src/manage.h: Include manage_migrators.h. Remove redundant
	manage_migrate_needs_timezone header.

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

	* src/manage_sql.c (init_get_iterator): Explain permission case.
	(count): Add special case for owner clause of permissions.

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

	* src/manage_migrators.h: Add missing license and copyright at start of
	file.

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

	3nd patch, move migrators functions.

	* src/manage.h, src/manage_sql.c: Remove some preprocessor defintions
	and variables. Moed to manage_sql.h

	* src/manage_sql.h: Add preprocessor definitions from manage.h and
	manage_sql.c

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

	2nd patch, move migrators functions.

	* src/manage_migrators.h: New file. Add migrate_x_to_y prototypes.

	* src/manage_sql.c: Remove migrate_x_to_y prototypes. Include
	manage_migrators.h

	* src/manage_migrators.c: Fix documentation. Include header.

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

	Move migrators functions to manage_migrators.c

	* src/CMakeLists.txt: Add manage_migrators.c file.

	* src/manage.h: Add internal types, preprocessor defintions and external
	variables needed by manage_migrators.c from manage_sql.c. Add
	set_db_version header.

	* src/manage_sql.c: Remove internal types, preprocessor definitions and
	external variables needed by manage_migrators.c (See manage.h)
	Remove migrator functions, add their headers.

	* src/manage_migrators.c: New file. Add migrator functions from
	manage_sql.c

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

	* src/manage_sql.c (validate_results_port): New function.
	(create_note, modify_note, create_override, modify_override): Validate
	port value.

	* src/omp.c (omp_xml_handle_end_element): Handle invalid port case for
	create_note, create_override, modify_note, modify_override calls.

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

	* src/manage_sql.c (where_search_phrase): Apply search on nvt cve value
	too.

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

	* INSTALL: Update section about creating first user.

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

	* src/manage_sql.c (PERMISSION_ITERATOR_COLUMNS): Replace hardcoded
	tasks query with call to resource_name.

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_PERMISSIONS add
	id and NAME to RESOURCE, similar to SUBJECT.

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

	* src/manage_sql.c (type_has_permissions): Enable all types, so that the
	GET iterator uses permissions for all types.

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

	* src/manage_sql.c (migrate_56_to_57): Ensure new tables exist.

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

	* src/manage_sql.c (MIGRATE_55_TO_56_RANGE): New macro.
	(migrate_55_to_56_ensure_predefined_port_lists_exist): New function.
	(migrate_55_to_56): Call dedicated port list function, as the normal one
	has changed.

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

	* src/manage_sql.c (copy_resource_lock): Return with error if the
	insert ID was 0.
	(copy_permission): Correct column name.

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

	* src/manage_sql.c (OVERRIDE_ITERATOR_COLUMNS): Shorten overlong lines.

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

	* src/manage_sql.c (ANON_GET_ITERATOR_COLUMNS): Remove for now.  The
	only callers need special casing anyway.
	(NOTE_ITERATOR_COLUMNS, OVERRIDE_ITERATOR_COLUMNS): Remove
	ANON_GET_ITERATOR_COLUMNS comment.

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

	Remove OTP PORT handling.

	* src/manage_sql.c (init_result_iterator, column_auth_type)
	(report_counts_autofp_match): Adjust open port comment.
	(append_task_open_port): Remove.

	* src/otp.c (scanner_state_t): Remove PORT states.
	(process_otp_scanner_input): Remove PORT handling.

2013-06-12  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/omp.c (buffer_config_preference_xml): Add default value element
	"default" to response.
	(omp_xml_handle_end_element): In case CLIENT_GET_PREFERENCES
	remove special case for missing config, which is now handled by
	buffer_config_preference_xml.

	* src/schema_formats/XML/OMP.xml (get_nvts, get_preferences): Add
	response element "default" and update examples accordingly.

	* doc/omp.html, doc/omp.rnc: Update from source.

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

	* src/manage_sql.c (where_search_phrase): Apply search phrase matching
	based on nvt tags content too.

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

	* src/manage_sql.c (init_get, omp_xml_handle_end_element): Apply
	default filters only when filt_id value is set to -2.
	This fixes bugs where a command is called from pages other than main
	page (Filters in settings page, Filters in filter box etc,.) while
	having a default filter that limits its results.

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

	* src/manage_sql.c (setting_filter): Make documentation clearer about
	passed resource value.

	* src/omp.c (INIT_GET): Append 's' to init_get settings_name parameter.
	Fixes issue with default filter not applied as the name doesn't match in
	DB.
	(omp_xml_handle_element): make INIT_GET call consistent for get_groups
	case.

2013-06-11  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/schema_formats/XML/OMP.xml (get_nvts): Remove text about
	preferences requiring a config and add a paragraph about default
	preference values instead.

	* doc/omp.html: Update from source.

2013-06-11  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In case CLIENT_GET_NVTS,
	allow preferences attribute without config_id.

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

	* src/ompd.c (write_to_scanner, serve_omp): Remove user/password scanner
	init states.  Also remove SCANNER_INIT_GOT_VERSION which was needed
	while waiting for "User:".

	* src/otp.c (process_otp_scanner_input): After sending version go
	directly to SCANNER_INIT_DONE.  Remove user/password states.  In
	SCANNER_NVT_INFO check for SCANNER_INIT_DONE instead of
	SCANNER_INIT_SENT_PASSWORD.

	* src/otp.h: Update header accordingly.

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

	* src/manage_sql.c, src/omp.c: Revert revision 16518 for Note port
	value validation.

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

	* src/manage_sql.c (report_ssl_cert_count): New function
	(print_report_xml): print report ssl certs total count.

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

	* src/manage_sql.c (note_count, init_note_iterator, override_count)
	(init_override_iterator): Use the task in the results table, instead of
	looking up the task via the report.  This drastically improves
	performance of GET_NOTES when given a task, which was making the GSA Task
	Details page load very slowly for big databases.

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

	* src/manage_sql.c (print_report_xml): Cleanup report host iterator in
	prognostic report case.

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

	* src/omp.c (create_permission_data_t, create_permission_data_reset)
	(client_state_t, omp_xml_handle_start_element)
	(omp_xml_handle_end_element, omp_xml_handle_text): Remove RESOURCE/TYPE
	from CREATE_PERMISSION.

	* src/manage_sql.c (omp_command_type): Allocate the return, in order to
	remove the trailing S on GET commands.
	(create_permission): Handle memory returned from omp_command_type.
	(strdown): New function.
	(modify_permission): Remove resource_type arg.  Get type from command
	name.

	* src/manage.h: Update header accordingly.

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

	* src/manage_sql.c (create_permission): Ensure name is store lower case.
	Invert name check.

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

	* src/manage_sql.c (print_report_xml): Allocate delta_states dynamically
	when no value is provided as free'ing the static memory causes glibc
	to abort.
	(report_filter_term): Default delta_states value to cgns when none is
	provided to match report printing behaviour.

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

	* src/omp.c (create_permission_data_t, create_permission_data_reset)
	(client_state_t, omp_xml_handle_start_element)
	(omp_xml_handle_end_element, omp_xml_handle_text): Remove RESOURCE/TYPE
	from CREATE_PERMISSION.

	* src/manage_sql.c (omp_command_type): New function.
	(create_permission): Get resource type from command name instead of from
	an argument.

	* src/manage.h: Update header accordingly.

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

	* src/manage_sql.c (create_permission): Instead of accepting a list of
	special names, accept any command name.

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

	* src/omp.c (omp_xml_handle_end_element): In the CLIENT_HELP XML brief
	case send only the commands that the user has permission to run.

	* src/manage_sql.c (valid_omp_command): New function.
	(user_may): Lowercase the command name.
	(modify_permission): Instead of accepting a list of special names,
	accept any command name.

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

	* src/openvasmd.c (main): Move --disable-password-policy check up so
	that it affects --first-user too.

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

	* src/omp.c (omp_xml_handle_end_element): Add permission checks to all
	remaining GET commands.

	* src/manage_sql.c (init_system_report_type_iterator): Add permission
	check.

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

	* src/manage_sql.c (manage_user_set_rules): Remove.  Rules now only
	available on database side.

	* src/manage.h: Remove header accordingly.

	* src/openvasmd.c (main): Remove rules arg from openvas_auth_init_funcs.

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

	* src/manage_sql.c (manage_set_setting): Update user modification time
	when changing timezone or password.

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

	* src/manage_sql.c (modify_user): Update modification time.

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

	* src/manage_sql.c (user_ensure_in_db, set_task_observers)
	(group_add_users, create_user): Set times when creating user.

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

	* src/omp.c (omp_xml_handle_end_element): Handle new return from
	delete_user.

	* src/manage_sql.c (delete_user): Fail if the user has active tasks.
	This is far easier than trying to stop the tasks.  Remove all tasks
	and related resources when removing user.

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

	* src/manage_sql.c (print_report_xml): Add
	prognostic_report_result_total's result to result_total instead of
	setting it up as there may be multiple report_host values to iterate
	over.

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

	* src/sql.c (sqlv): Return on error instead of aborting.
	(sql): Abort accordingly now that sqlv returns.
	(sql_error): New function.  Like sql, but returns error state to caller.

	* src/sql.h: Add header accordingly.

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

	* src/manage_sql.c (init_manage_process): Keep going if SCAP or CERT db
	fails to load.
	(manage_scap_loaded, manage_cert_loaded): Run a test statement first to
	prevent an abort when there's an problem with the database.

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

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

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

	* src/manage.c (run_slave_task): Give up if connection succeeds but
	login fails.

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

	* src/manage_sql.c (copy_task): Copy permissions too.

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

	* src/manage_sql.c (copy_task): Copy alerts too.

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

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_TASKS use
	INIT_GET.

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

	* src/manage_sql.c (prognostic_host_port_count): New function.
	(host_iterator_report): Fix return type.
	(print_report_xml): Add port count for each report host in prognostic
	type case. Add total host count. Fix total app count.
	(prognostic_app_count): Remove function.

2013-06-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_TAGS correct
	symbol names probably left over from copy and paste long ago.

2013-06-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Use INIT_GET for GET_TAGS.

2013-06-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Rework GET_TAGS to be like all
	the other GET cases.

2013-06-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Correct DESCRIBE command names
	in permission checks.  In GET_REPORTS add permission check and add
	missing spaces.

2013-06-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Correct GET_ROLES INIT_GET
	type.

2013-06-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Use INIT_GET for most of the
	GET commands that have filters.  This brings permission checks to these
	commands.

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

	* src/manage_sql.c (prognostic_app_count): New function.
	(print_report_xml): Print prognostic report apps count.

2013-06-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Use INIT_GET for GET_ROLES.

2013-06-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (INIT_GET): New macro.
	(omp_xml_handle_end_element): Call init_get via a macro because the
	return checks make it a bit long and it is always the same.

2013-06-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage): Exclude GSA Administration menu items
	from Observer permissions.

2013-06-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (init_get): Add permission check.
	(omp_xml_handle_end_element): Add GET_TARGETS to handle init_get
	permission return.  In GET_USERS replace common setup code with call to
	init_get.

2013-06-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (init_get): New function.  Collects common setup steps from
	GET_TARGETS case in omp_xml_handle_end_element.
	(get_next): Improve comments.  Skip the checks when there is a named
	filter.  They were always producing the original empty set anyway.
	(omp_xml_handle_end_element): Remove comment from GET_PERMISSIONS and
	GET_TARGETS setup step, to make them the same as the other GET cases.
	Replace setup steps in GET_TARGETS with call to init_get.

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

	* src/omp.c (omp_xml_handle_end_element): Move GET cases together, and
	into alphabetical order.

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

	* src/omp.c (omp_xml_handle_end_element): Add permission result or check
	to remaining MODIFY commands.

	* src/manage_sql.c (manage_set_setting, modify_user): Add permission
	check.

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

	* src/manage_sql.c (create_note, modify_note, create_override)
	(modify_override): Validate port before writing in DB. Return adequate
	error code when validation fails.

	* src/omp.c (omp_xml_handle_end_element): Adequately Handle new return
	codes for invalid port in create_note, create_override, modify_note and
	modify_override.

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

	* src/omp.c (omp_xml_handle_end_element): Group MODIFY cases together
	and alphabetically.

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

	* src/omp.c (omp_xml_handle_end_element): Add permission case to
	RUN_WIZARD.

	* src/manage.c (manage_run_wizard): Add permission check.

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

	Add permission checks to verify commands, sync commands and TEST_ALERT.

	* src/manage.c (openvas_sync_feed): Add permission check.

	* src/manage_sql.c (manage_alert, verify_agent): Switch arguments to
	UUIDs.  Add permission check.
	(init_manage): Update verify calls.
	(verify_report_format_internal): New function.  Body from
	verify_report_format.
	(verify_report_format): Switch to UUID arg.  Add permission check.  Call
	through to internal function to do the work.
	(report_format_verify): New function.  Verifies given a ROWID, for init.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): Switch test_alert and
	verify_agent arguments to UUID, adding permission case.  Add permission
	case to verify and sync commands.

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

	* src/manage_sql.c (print_report_port_xml): New function.
	(print_report_xml): Refactor code for port summary into
	print_rpeort_port_xml.

2013-05-29  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (prognostic_report_result_total): New function.
	(print_report_xml): Send correct total result count instead of what was
	in result_count variable from before.

2013-05-29  Matthew Mundell <matthew.mundell@greenbone.net>

	Add permission checks to describe commands, task control commands and
	RESTORE.

	* src/manage_sql.c: Rename stop_task calls to stop_task_internal.
	(manage_restore): Add permission check.

	* src/manage.h: Add header accordingly.

	* src/manage.c (run_task): Switch task argument to task_id.
	(start_task, pause_task, resume_paused_task, resume_stopped_task)
	(resume_or_start_task): Switch task argument to task_id.  Add permission
	check.
	(stop_task_internal): New function.  Body from stop_task.
	(stop_task): Switch task argument to task_id.  Add permission check.
	Call through to stop_task_internal.

	* src/omp.c (omp_xml_handle_end_element): Add permission checks to the
	describe commands and RESTORE.  In task control commands move task
	finding into handler function and handle permission denied case.

2013-05-28  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	* manage_sql.c (migrate_81_to_82): Remove creation of Topology format.

2013-05-28  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	* CMakeLists.txt: Set OPENVASMD_DATABASE_VERSION to 82. Add
	installation of new topology report format.

	* manage_sql.c (migrate_81_to_82, database_migrators): Add migration
	that adds predefined Topology report format.
	(init_manage): Add predefined Topology report format.
	(report_format_predefined): Add new Topology report format.

	* src/report_formats/Topology/generate,
	src/report_formats/Topology/hostvisdot-summary.xsl: New report format
	scripts (copied from report_formats/simple_topo_plot).

2013-05-27  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (print_report_assets_xml): New function.
	(print_report_xml): Refactor code for assets type into
	new function.

2013-05-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage): Remove automatic user creation.
	(manage_first_user): New function.

	* src/manage.h: Add header accordingly.

	* src/openvasmd.c (main): Add --first-user option.

2013-05-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (user_may): Allow dummy init_manage user to do
	anything.
	(manage_empty_trashcan): Add permission check.

	* src/omp.c (omp_xml_handle_end_element): Add permission case to
	EMPTY_TRASHCAN.

2013-05-27  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (PRINT_REPORT_HOST_DETAILS): Print empty extra tag
	value if none was provided.

2013-05-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Correct MODIFY_ALERT event
	logs.

2013-05-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Capitalise MODIFY_AGENT event
	logs for consistency.

2013-05-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Add event logs to all
	permission denied return cases where the other cases also have logs.
	Clean up some of the log indenting.  Correct the name in the
	CREATE_CONFIG permission denied message.

2013-05-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_target, delete_config, delete_lsc_credential)
	(delete_agent, delete_note, delete_override, delete_schedule)
	(delete_report_format, delete_slave, delete_group, delete_permission)
	(delete_port_list, delete_port_range, delete_user, delete_tag): Add
	permission check.

2013-05-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (delete_report_data_t): Add dummy ultimate field.
	(omp_xml_handle_end_element): Move all the delete cases up into
	alphabetical order.

	* src/manage_sql.c (delete_report): Update function name.

2013-05-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Replace more delete cases with
	macro call.  This adds the permission denied check to these cases.  Add
	the check to DELETE_TASK and DELETE_USER too.

	* src/manage_sql.c (delete_report_internal): New function.  Was
	delete_report.
	(manage_delete_report): Remove.  Now delete_report.
	(delete_report): New function.  Was delete_report.  Adjust to take ID
	and ultimate flag like other delete functions.

	* src/manage.c (delete_reports): Update function name.

	* src/manage_sql.h, src/manage.h: Update header accordingly.

2013-05-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (delete_port_range_data_t): Add dummy ultimate field.
	(CASE_DELETE): New macro.
	(omp_xml_handle_end_element): Replace most delete cases with macro call.
	This adds the permission denied check to these cases.

	* src/manage_sql.c (delete_port_range): Add dummy ultimate arg.
	(delete_filter): Add permission check.
	(delete_tag): Make return value same as other delete functions.

	* src/manage.h: Update header accordingly.

2013-05-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_alert, create_user): Add permission checks.

	* src/omp.c (omp_xml_handle_end_element): Add permission case to
	DELETE_ALERT and CREATE_USER switches.

2013-05-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage): Set credential UUID because create_user
	needs that.  Delete any old admin meta rows, just to be sure.

2013-05-24  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (setting_severity): New function.

	* src/manage.h: Add setting_severity prototype.

	* src/omp.c (omp_xml_handle_end_element): Send user severity class in
	authenticate response.

2013-05-24  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage): Ensure there is at least one user.

2013-05-24  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* tools/openvas-scapdata-sync.in (): Remove command line parameter
	for setting SCAP dir.
	(do_help): Remove accordingly in help text.

2013-05-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In DELETE_TAG and MODIFY_TAG
	neaten some indenting.

2013-05-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (modify_tag): Remove declaration indent.  Move name
	init down or it leaks.  Add space before paren.

2013-05-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_port_range): Correct user_may command name.

2013-05-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_tag): Move declarations to top of block.  Add
	transaction.  Add space before paren.  Move quoted_name definition down
	otherwise it leaks.  Free lc_attach_type on error.

2013-05-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_TAG clean up
	some indenting and correct error message names.

2013-05-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Replace explicit observer checks in XML handler with general permission
	checks in the command functions.

	* src/manage_sql.c (modify_alert, modify_target, modify_agent)
	(modify_schedule, modify_slave, create_permission, modify_permission)
	(modify_port_list, modify_filter, modify_tag): Add user_may check.

	* src/omp.c (omp_xml_handle_end_element): Remove all user_is_observer
	checks, and add "permission denied" return cases in their place.

2013-05-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (user_is_observer): Correct UUID.

2013-05-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Use predefined permissions to restrict the commands available to Users
	and Observers.

	* src/omp.c (command_t, omp_commands): Remove.  Now in manage.h and
	manage_sql.c.

	* src/manage_sql.c (omp_commands): New variable.
	(user_may): Replace the explicit observer check with checking based on
	the permission table.
	(add_role_permission): New function.
	(init_manage): Add predefined command-level permissions for User and
	Observer roles.

	* src/manage.h (command_t): New type.
	(omp_commands): New header.

2013-05-23  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* INSTALL: Updated section "Certificate Generation" to match
	the recent changes in OpenVAS Scanner and its helper script
	openvas-mkcert-client.

2013-05-23  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (init_manage_settings): New function.
	(init_manage): Refactor settings and severity class
	setting initialization code into init_manage_settings.
	(manage_set_settings): Check for severity class uuid too.

2013-05-23  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (print_report_xml, print_report_errors_xml): Send all
	resources count as count element instead of total attribute.
	(init_report_errors_iterator): Use full table names.

2013-05-23  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (init_report_errors_iterator): Optimize sql query.
	Get nvt risk factor too.
	(report_errors_iterator_nvt_threat): New function.
	(report_errors_iterator_desc, report_errors_iterator_nvt_name)
	(report_errors_iterator_nvt_cvss): Readjust ordering.
	(PRINT_REPORT_ERROR): Send nvt threat too.

2013-05-23  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (report_error_count): New function.
	(print_report_errors_xml): Use new function for calculating error
	messages total.

2013-05-22  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* INSTALL, CMakeLists.txt: Updated dependencies
	(openvas-libraries to 7.0.0).

2013-05-22  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* CMakeLists.txt, src/CMakeLists.txt: Removed handling of
	OPENVAS_USERS_DIR.

	* src/manage_sql.c (migrate_9_to_10_user_uuid, migrate_79_to_80):
	Replaced OPENVAS_USERS_DIR by path via OPENVAS_STATE_DIR.

	src/omp.c (omp_xml_handle_end_element): Renamed
	OPENVAS_USERS_DIR/.auth.conf to OPENVAS_STATE_DIR/auth.conf.

2013-05-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (empty_trashcan): Delete permissions too.

2013-05-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_user): Remove some of user's resources too.

2013-05-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (user_is_admin, user_is_observer): Check user_roles
	table insead of old roles column.
	(user_may): Check for Everything permission, instead of for admin role.
	Admin always has this permission.

2013-05-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (PERMISSION_UUID_ADMIN_EVERYTHING): New define.
	(init_manage): Ensure Admin role has the Everything permission.
	(permission_is_predefined): New function.
	(permission_writable): Add Admin Everything check.
	(PERMISSION_ITERATOR_COLUMNS): Add role checks, so new Admin permission
	show up right in GSA.
	(delete_permission): Prevent Admin Everything from being deleted.

2013-05-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage): Ensure predefined roles exist.

2013-05-22  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* tools/greenbone-certdata-sync, tools/openvas-certdata-sync.in
	(db_migrate_4): Fix version number update.

2013-05-22  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (init_dfn_cert_adv_info_iterator): Remove filter for
	selection by ID.

2013-05-22  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Add max_cvss to DFN-CERT advisories.

	* doc/omp.html, doc/omp.rnc: Update from source.

	* src/manage.h (dfn_cert_adv_info_iterator_max_cvss): New function
	prototype.

	* src/manage_sql.c (DFN_CERT_ADV_INFO_ITERATOR_FILTER_COLUMNS)
	(DFN_CERT_ADV_INFO_ITERATOR_FILTER_COLUMNS): Add column max_cvss.
	(dfn_cert_adv_info_iterator_max_cvss): New iterator column function.

	* src/omp.c (xml_handle_end_element): In case CLIENT_GET_INFO add
	max_cvss element to response for dfn_cert_adv.

	* src/schema_formats/XML/OMP.xml (get_info): Add max_cvss to response
	for dfn_cert_adv.

	* tools/cert_db_update (meta): Set DB version to 4.
	(dfn_cert_advs): Add column "max_cvss".

	* tools/greenbone-certdata-sync (SCAP_DIR, SCAP_DB): New variables,
	set to SCAP dir / db file paths.
	(db_migrate_4, check_db_version): New migrator to version 4.
	(update_cvss): New function, updates CVSS for DFN-CERT.
	(update_cert_db): Add updated_dfn and check. Add update_cvss call.

	* tools/openvas-certdata-sync.in (SCAP_DIR, SCAP_DB): New variables,
	set to SCAP dir / db file paths.
	(db_migrate_4, check_db_version): New migrator to version 4.
	(update_cvss): New function, updates CVSS for DFN-CERT.
	(update_sec_db): Add updated_dfn and check. Add update_cvss call.

2013-05-21  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (modify_permission_data_t): Remove user, because subject has
	been used instead.

2013-05-21  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP CREATE_PERMISSION.

	* src/omp.c (create_permission_data_t)
	(create_permission_data_reset): Adjust fields.
	(client_state_t): Add CREATE_PERMISSION resource and subject states.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add CREATE_PERMISSION.

	* src/manage_sql.c (create_permission): New function.

	* src/manage.h: Add header accordingly.

2013-05-21  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (init_report_errors_iterator)
	(report_errors_iterator_host, report_errors_iterator_port)
	(report_errors_iterator_nvt_oid, report_errors_iterator_nvt_name)
	(report_errors_iterator_desc, PRINT_REPORT_ERROR,
	(print_report_errors_xml): New functions.
	(print_report_xml): Print report error messages too.
	(PRINT_REPORT_HOST_DETAILS): Rename to PRINT_REPORT_HOST_DETAILS.

	* src/manage.h: Add function prototype accordingly.

2013-05-21  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Fix call (user_is_observer
	instead of openvas_is_user_observer). Probaly a remains of
	old administrator code.

2013-05-21  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* tools/greenbone-scapdata-sync, tools/openvas-scapdata-sync.in
	(list_oval_files_sortable): Add character class brackets to egrep regex.

2013-05-21  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (report_app_count): New function.
	(print_report_xml): Output count of detected Apps.

2013-05-21  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (print_report_host_details_xml): New function.
	(PRINT_REPORT_HOST_DETAILS): New macro.
	(print_report_xml): Clean code. Refactor code into new functions.

2013-05-21  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (init_report_host_details_iterator): Add extra field,
	send nvt cvss base in closed cve case.
	(report_host_details_iterator_extra): New function.
	(print_report_xml): Send host details extra field too.

2013-05-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Remove resource and name
	checks from MODIFY_PERMISSION.

	* src/manage_sql.c (modify_permission): Modify the fields one at a time.
	Only modify a field if it is given, otherwise leave the existing value.

2013-05-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (modify_permission): Leave resource_location alone.

2013-05-20  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (buffer_cve): Remove function
	(print_report_xml): Remove unused cve buffering code.

2013-05-20  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP MODIFY_PERMISSION.

	* src/omp.c (omp_commands, command_data_t,client_state_t): Add
	MODIFY_PERMISSION elements.
	(modify_permission_data_t): New type.
	(modify_permission_data_reset): New function.
	(modify_permission_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add
	MODIFY_PERMISSION.

	* src/manage_sql.c (modify_permission): New function.

	* src/manage.h: Add header accordingly.

2013-05-19  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (report_host_count): Optimize sql query.

2013-05-17  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Apply new logging method to greenbone-certdata-sync and make logging
	more consistent for both Greenbone scripts. Fix self test.

	* tools/greenbone-certdata-sync (): Remove variables LOGDIR, LOGFILE,
	and associated test. Replace with LOG_CMD (New variable for logger
	command). Move up variables RSYNC, SQLITE and move tests to
	do_self_test. Use new log functions. Add do_self_test to check
	availability of tools. Add SELFTEST_STDERR in case for --selftest arg.
	(log_write): Removed. Replaced by log_debug, log_info, log_notice,
	log_warning, log_err.
	(log_debug, log_info, log_notice, log_warning, log_err): New logging
	functions using logger.
	(reinit, update_cert_db, sync_certdata): Use new logging. Make log
	messages and levels more consistent by removing "Warning:" and "Error:"
	prefixes.
	(do_self_test): Add SQLITE, RSYNC and BASE_SYNC_DIR tests.
	Test if directory BASE_SYNC_DIR exists. Use new logging and print
	to stderr if SELFTEST_STDERR is set.

	* tools/greenbone-scapdata-sync (): Remove variables LOGDIR, LOGFILE.
	Change log_write to new log functions. Move up variables RSYNC, SQLITE
	and move tests to do_self_test. Add do_self_test to check
	availability of tools. Add SELFTEST_STDERR in case for --selftest arg.
	(log_debug): Move to make consistent with greenbone-certdata-sync.
	(log_write): Removed. Replaced by log_info and log_notice.
	(log_info, log_notice, log_warning): New logging functions.
	(reinit, db_migrate_9, db_migrate_10, db_migrate_11, db_migrate_12)
	(db_migrate_13, init_scap_db_update, update_cvss)
	(update_scap_db_private, update_scap_db, sync_scapdata): Change
	log_write to log_info or log_notice as appropriate. Make log messages
	and levels more consistent by removing "Warning:" and "Error:" prefixes.
	(do_self_test): Add SQLITE, RSYNC and BASE_SYNC_DIR tests.
	Test if directory BASE_SYNC_DIR exists. Use new logging and print
	to stderr if SELFTEST_STDERR is set.

2013-05-17  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (buffer_results_xml): Add default value for cvss when
	no value is provided and there is no nvt.

2013-05-17  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (report_os_count): Count OS by cpe instead of txt.

2013-05-16  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_user, modify_user): Convert "Deny none" to
	"Allow All".

	* src/omp.c (omp_xml_handle_end_element): Convert "Deny none" to
	"Allow All".

2013-05-16  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (report_os_count): New function.
	(print_report_xml): Send report's total number of detected Operating
	Systems.

2013-05-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (openvas_admin_add_user): Remove.  Now create_user.
	(openvas_admin_modify_user): Remove.  Now modify_user.
	(create_user, modify_user): New functions.  From openvas_admin versions.

	* src/manage.h: Update headers accordingly.  Remove old header.

	* src/omp.c (omp_xml_handle_start_element)
	(omp_xml_handle_end_element): Update function names.

2013-05-15  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (report_vuln_count): New function.
	(print_report_xml): Send report total number of vulnerabilities.

2013-05-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (user_iterator_role): Remove.  Column was removed
	earlier.
	(user_iterator_method, user_iterator_hosts)
	(user_iterator_hosts_allow): Update offsets for removed role column.

2013-05-15  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (migrate_79_to_80): Ensure more tables that would be
	missing in older dbs exist.

2013-05-15  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* tools/scap_db_init.sql: Add DROP TABLE statements for
	ovalfiles, affected_ovaldefs.

2013-05-15  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (filter_clause): Require tags to be active for
	filtering by tag.

2013-05-15  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Add max_cvss and CVE count to OVAL definitions.

	* doc/omp.html, doc/omp.rnc: Update from source

	* src/manage.h (ovaldef_info_iterator_max_cvss)
	(ovaldef_info_iterator_cve_refs): New function prototypes.

	* src/manage_sql.c (OVALDEF_INFO_ITERATOR_FILTER_COLUMNS)
	(OVALDEF_INFO_ITERATOR_FILTER_COLUMNS): Add columns max_cvss, cves.
	(ovaldef_info_iterator_max_cvss, ovaldef_info_iterator_cve_refs): New
	iterator column functions.

	* src/omp.c (xml_handle_end_element): In case CLIENT_GET_INFO add
	max_cvss and cve_refs elements to response for ovaldef.

	* src/schema_formats/XML/OMP.xml (get_info): Add max_cvss and cve_refs
	to response for ovaldef.

	* tools/greenbone-scapdata-sync (db_migrate_14): New migrator function.
	(check_db_version): Add migration to version 14.
	(init_scap_db_update): Add initialisation of variables
	updated_cpes, updated_cves, updated_ovaldefs.
	(update_cvss): New function to update CVSS data if info was updated.
	(update_scap_db_private): Set updated_ovaldefs to 1 on OVAL update.
	(update_scap_db): Set updated_cpes to 1 on CPE update.
	Change warning for missing CPE dictionary to log_write.
	Remove initialisation of updated_cves. Remove update of CVSS - replaced
	by update_cvss call.

	* tools/openvas-scapdata-sync.in (db_migrate_14): New migrator function.
	(check_db_version): Add migration to version 14.
	(init_sec_db_update): Add initialisation of variables
	updated_cpes, updated_cves, updated_ovaldefs.
	(update_cvss): New function to update CVSS data if info was updated.
	(update_sec_db_private): Set updated_ovaldefs to 1 on OVAL update.
	(update_sec_db): Set updated_cpes to 1 on CPE update.
	Remove initialisation of updated_cves. Remove update of CVSS - replaced
	by update_cvss call.
	(do_refresh_private): Add update_cvss call.

	* tools/oval_update.xsl (oval_definitions:definition): Add updating of
	max_cvss and cve_refs columns. Add insert for affected_ovaldefs.

	* tools/scap_db_init.sql (meta): Set version to 14.
	(ovaldefs): Add columns max_cvss and cve_refs.
	(affected_ovaldefs): New table.
	(aff_ovaldefs_def_idx, aff_ovaldefs_cve_idx): New indexes.
	(cves_delete): Delete entries from affected_ovaldefs.
	(affected_ovaldefs_delete): New deletion trigger.

2013-05-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_set_setting): Remove big redundant
	comparison.

2013-05-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_set_setting): Add Roles Filter.

2013-05-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Make MODIFY_USER handle multiple roles too.

	* src/manage_sql.c (openvas_admin_add_user): Correct return doc.
	(openvas_admin_modify_user): Replace role arg with array args.  Set the
	roles from the array.

	* src/manage.h: Update header accordingly.

	* src/omp.c (modify_user_data_t, modify_user_data_reset): Replace role
	with roles.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Allow multiple roles in MODIFY_USER.

2013-05-14  Matthew Mundell <matthew.mundell@greenbone.net>

	Add user_id attribute to MODIFY_USER, to match other commands.

	* src/manage_sql.c (openvas_admin_modify_user): Add user_id arg.  Make
	name arg a pointer.  Find user by user_id if given.  Return name in name
	arg in certain cases.  Indicate gain and loss of admin in return.

	* src/manage.h: Update header accordingly.

	* src/omp.c (modify_user_data_t, modify_user_data_reset): Add user_id.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Handle
	user_id in MODIFY_USER.

2013-05-14  Michael Wiegand <michael.wiegand@greenbone.net>

	* tools/greenbone-scapdata-sync: Switch logging to use "logger"
	consistently, differentiate between log levels.

2013-05-13  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In case CLIENT_MODIFY_TASK
	allow observers for container tasks.

2013-05-13  Michael Wiegand <michael.wiegand@greenbone.net>

	First step towards consolidation of logging.

	* tools/greenbone-scapdata-sync, tools/greenbone-certdata-sync: Remove
	verbose error messages to stdout as the scripts are no longer intended
	to be called interactively.

2013-05-13  Michael Wiegand <michael.wiegand@greenbone.net>

	* tools/greenbone-scapdata-sync, tools/greenbone-certdata-sync: Add
	compression to rsync options.

2013-05-13  Michael Wiegand <michael.wiegand@greenbone.net>

	* tools/greenbone-scapdata-sync, tools/greenbone-certdata-sync: Factor
	out ssh options to simplify rsync call.

2013-05-10  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (init_result_iterator): Order by host/ip after
	ordering by port and threat.

2013-05-10  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (report_closed_cves_count): Fix counting query.

2013-05-10  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	* doc/omp.html, doc/omp.rnc: Update from source.

	* src/manage.h (cpe_info_iterator_nvd_id): New function prototype.

	* src/manage_sql.c (CPE_INFO_ITERATOR_FILTER_COLUMNS)
	(CPE_INFO_ITERATOR_COLUMNS): Add column nvd_id.
	(cpe_info_iterator_nvd_id): New function to get NVD ID.

	* src/omp.c (xml_handle_end_element): In case CLIENT_GET_INFO add
	element nvd_id to response for CPEs.

	* src/schema_formats (get_info): Add element nvd_id to cpe element
	in response.

	* tools/cpe_update: Use name as ID, put NVD ID in separate field.

	* tools/cve_update: Use name as ID for CPEs to avoid null IDs.

	* tools/greenbone-scapdata-sync (db_migrate_13, check_db_version): Add
	migration to SCAP database version 13.

	* tools/openvas-scapdata-sync.in (db_migrate_13, check_db_version): Add
	migration to SCAP database version 13.

	* tools/scap_db_init.sql (meta): Set version to 13.
	(cpes): Add column nvd_id.

2013-05-09  Matthew Mundell <matthew.mundell@greenbone.net>

	Copy groups and roles when cloning users.

	* src/manage_sql.c (copy_user): Copy groups and roles too.

2013-05-09  Matthew Mundell <matthew.mundell@greenbone.net>

	Enable multiple roles per user.

	* src/manage_sql.c (find_role): New function.
	(openvas_admin_add_user): Replace role arg with roles args.  Add roles
	from array instead of single role.
	(copy_user): Remove role from copy fields.

	* src/manage.h: Update header accordingly.

	* src/omp.c (create_user_data_t, create_user_data_reset): Replace role
	with roles.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Allow multiple roles in CREATE_USER.

2013-05-09  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (print_report_xml): Remove unused duplicate code for
	closed cves.
	(compare_strings): Remove declared but unused function causing compiler
	warning.

2013-05-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Add roles to observers in
	GET_TASKS.

	* src/manage_sql.c (init_task_role_iterator, task_role_iterator_task)
	(task_role_iterator_role, task_role_iterator_name)
	(task_role_iterator_uuid): New functions.

	* src/manage.h: Add headers accordingly.

2013-05-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (user_may, init_get_iterator): Enable checks on
	permissions granted to roles.

2013-05-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (RULES_HEADER): Remove duplicate definition.

2013-05-08  Matthew Mundell <matthew.mundell@greenbone.net>

	Just list users in GET_ROLES, as with GET_GROUPS.

	* src/manage_sql.c (role_users): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_xml_handle_end_element): Enable sending users in
	GET_ROLES.

2013-05-08  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP GET_ROLES.

	* src/manage_sql.c (valid_type, type_pretty_name, type_db_name): Add
	role.
	(role_writable, trash_role_writable, role_in_use)
	(trash_role_in_use): New function.
	(ROLE_ITERATOR_FILTER_COLUMNS, ROLE_ITERATOR_COLUMNS): New defines.
	(role_count, init_role_iterator): New functions.

	* src/manage.h: Add headers accordingly.
	(role_t): New type.

	* src/omp.c (omp_commands, command_data_t,client_state_t): Add GET_ROLES
	elements.
	(get_roles_data_t): New type.
	(get_roles_data_reset): New functions.
	(get_roles_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add
	GET_ROLES.

2013-05-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_filter): Put the type NULL check before the
	type_db_name too, because it indicates an error from type_db_name.  Move
	the "" check up too, because it's simpler there.

2013-05-08  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (manage_set_setting): Base64 decode filters values.

2013-05-08  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	* src/manage.h (init_tag_name_iterator, tag_name_iterator_name)
	(tag_name_count): New function prototypes.

	* src/manage_sql.c (TAG_NAME_ITERATOR_FILTER_COLUMNS)
	(TAG_NAME_ITERATOR_COLUMNS): New column #defines.
	(init_tag_name_iterator, tag_name_iterator_name, tag_name_count): New
	functions for iterating over distinct tag names.

	* src/omp.c (get_tags_data_t): Add member names_only.
	(omp_xml_handle_start_element): In case for GET_TAGS, parse new
	attribute names_only.
	(omp_xml_handle_end_element): In case CLIENT_GET_TAGS, handle new
	parameter names_only which selects only distinct names of tags.

	* src/schema_formats/XML/OMP.xml (get_tags): Add attribute names_only
	to command, change tag element in response to either contain just name
	or all elements of a tag.

	* doc/omp.html, doc/omp.rnc: Update from source.

2013-05-08  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (escalate_2, escalate_1, print_report_xml,
	(manage_report, manage_send_report): Remove unused show_closed_cves
	parameter.

	* src/omp.c: Adjust function calls accordingly.

	* src/manage.h: Adjust function prototypes.

2013-05-08  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (print_report_xml): Remove unused duplicate code for
	closed cves.

2013-05-08  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (report_host_count, report_port_count)
	(report_closed_cve_count): New functions.
	(print_report_xml): Send report total number of ports, hosts and closed
	cves adequately.

2013-05-07  Matthew Mundell <matthew.mundell@greenbone.net>

	Move user roles to a dedicated table.  Hence increase database version
	to 81.  Add database migration from version 80 to 81.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 81.

	* src/manage_sql.c (ROLE_UUID_ADMIN, ROLE_UUID_USER)
	(ROLE_UUID_OBSERVER): New defines.
	(create_tables): Add roles and role_users.  Remove role from users.
	(migrate_80_to_81): New function.
	(database_migrators): Add migrate_80_to_81.
	(manage_set_user_role, openvas_admin_add_user): Set role in new table.
	(USER_ITERATOR_FILTER_COLUMNS, USER_ITERATOR_COLUMNS)
	(USER_ITERATOR_TRASH_COLUMNS): Remove role.
	(init_user_role_iterator, user_role_iterator_uuid)
	(user_role_iterator_name): New function.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): In GET_USERS get roles with
	iterator.

	* doc/db.png: Update for version changes.

2013-05-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (migrate_79_to_80): Ensure recently added tables
	exist.

2013-05-07  Matthew Mundell <matthew.mundell@greenbone.net>

	* CMakeLists.txt: Remove OPENVAS_SYNC_SCRIPT_DIR.

	* src/CMakeLists.txt: Add SBINDIR instead of OPENVAS_SYNC_SCRIPT_DIR.

	* src/omp.c (sync_script, scap_script, cert_script): Use SBINDIR instead
	of OPENVAS_SYNC_SCRIPT_DIR.

2013-05-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* README: Remove reference to tests.

2013-05-06  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (manage_set_setting): Always free value.

2013-05-06  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage.h (result_iterator_task, result_iterator_report): New
	function prototypes.

	* src/manage_sql.c (init_result_iterator): Add selection of task and
	report from database.
	(result_iterator_task): New function to get the task of a result.
	(result_iterator_report): New function to get the report of a result.
	(buffer_results_xml): Add details parameter to header (see omp.c).
	(compare_and_buffer_results, print_report_xml): Add details parameter to
	buffer_results_xml calls.

	* src/omp.c (buffer_results_xml): Add details parameter to header.
	(get_results_data_t): Add "details".
	(omp_xml_handle_start_element): In case for "GET_RESULTS" add attribute
	"details".
	(buffer_notes_xml, buffer_overrides_xml): Add details parameter to
	buffer_results_xml calls.
	(buffer_results_xml): Add parameter "include_details". Select task from
	database if task parameter is NULL and details are included. Add
	report and task data to response if include_details != 0.
	(omp_xml_handle_end_element): In case CLIENT_GET_RESULTS,
	buffer_results_xml call clarify comment on tags parameter,
	add details parameter.

	* src/schema_formats/XML/OMP.xml (result): Add report and task elements.
	(get_results): Add details attribute to command, add report and task
	elements to response.

	* doc/omp.html, doc/omp.rnc: Update from source.

2013-05-06  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage.c (get_nvti_xml): Escape xrefs too as characters like
	ampersand may be included in URLs.

2013-05-03  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (buffer_results_xml): Add two parameters
	to match changes in omp.c.
	(compare_and_buffer_results): Add parameters to buffer_results_xml
	calls: Don't show tags for comparisons.
	(print_report_xml): Add user tags for report. Add parameters to
	buffer_results_xml calls: print tags for normal scan reports but not
	delta reports.

	* src/omp.c (): Add parameters to buffer_results_xml header.
	(buffer_notes_xml, buffer_overrides_xml): Add parameters to
	buffer_results_xml call: Don't add result tags.
	(buffer_results_xml): Add parameters include_tags, include_tags_details,
	Write tag count / details of result to buffer if requested.
	(xml_handle_end_element): In case CLIENT_GET_RESULTS add parameters
	to buffer_results_xml call (counts, tags list for details).

	* src/sql.c (sql_resource_name): In else if case "report" add output
	"N/A" instead of date if end_time is 0. Add else if case for "result".

	* src/schema_formats/XML/OMP.xml (get_reports, get_results): Add user
	tags elements to result elements in responses and report element in
	response.

	* doc/omp.html, doc/omp.rnc: Update from source.

2013-05-03  Andre Heinecke <andre.heinecke@greenbone.net>

	* report_formats/verinice-ism/create_report_import:
	Increase Version to 1.1.8

2013-05-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Add DESCRIBE_CERT, DESCRIBE_FEED, DESCRIBE_SCAP, SYNC_CERT, SYNC_FEED
	and SYNC_SCAP to OMP.  These are direct copies from OAP in Administrator
	with some slight changes to fit in Manager, mostly formatting.

	* CMakeLists.txt (OPENVAS_SYNC_SCRIPT_DIR): New variable

	* src/CMakeLists.txt: Add OPENVAS_SYNC_SCRIPT_DIR to definitions.

	* src/manage.c (openvas_sync_script_perform_selftest)
	(openvas_get_sync_script_identification)
	(openvas_get_sync_script_description, openvas_current_sync)
	(openvas_get_sync_script_feed_version, openvas_sync_feed): New
	functions.

	* src/manage.h: Add headers accordingly.
	(NVT_FEED, SCAP_FEED, CERT_FEED): New defines.

	* src/omp.c (omp_commands, client_state_t): Add new commands.
	(sync_script, scap_script, cert_script): New variables.
	(XML_ERROR_BUSY): New macro.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add handling
	of new commands.

2013-05-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (openvas_admin_add_user)
	(openvas_admin_modify_user): Clean hosts, to ensure that there are
	spaces between the hosts.

2013-05-02  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (send_user_rules): Get rules with new function.

	* src/manage_sql.c (manage_user_rules): New function.  Get rules from
	db.

	* src/manage.h: Add header accordingly.

2013-05-01  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (user_has_access_uuid): Get the result case working
	by adding a check on the permission and correcting some names and parens
	in the SQL.

2013-04-30  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Use get_next to get the next
	task in GET_TASKS, so that it resets first when off the end of the page.

2013-04-30  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/omp.c (xml_handle_end_element): In case CLIENT_CREATE_CONFIG
	check if copy parameter is NULL before calculating its string length.

2013-04-30  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* doc/omp.html, doc/omp.rnc, src/manage.h, src/manage_sql.c,
	src/omp.c, src/schema_formats/XML/OMP.xml: Revert changes adding
	attach_type and attach_id attributes to get_tags.

2013-04-30  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* doc/omp.html, doc/omp.rnc: Update from source.

	* src/manage.h (init_tag_iterator, tag_count): Add parameters
	(see manage_sql.c).

	* src/manage_sql.c (init_tag_iterator, tag_count): Add parameters
	attach_type, attach_id to only include tags attached to the given
	resource type / ID in the results.

	* src/omp.c (get_tags_data_t, get_tags_data_reset): Add elements
	attach_type, attach_id.
	(xml_handle_start_element): In case CLIENT_GET_TAGS add append_attribute
	for attach_type, attach_id.
	(xml_handle_end_element): In case CLIENT_GET_TAGS add handling of
	attach_type and attach_id to only include tags attached to the given
	resource type / ID in the results.

	* src/schema_formats/XML/OMP.xml (get_tags): Add attributes attach_type
	and attach_id to command.

2013-04-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): Add TIMESTAMP along SCAN_START in
	REPORT.

2013-04-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (scan_end_time_uuid): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (send_reports, omp_xml_handle_end_element): Add SCAN_END
	alongside TIMESTAMP in OMP REPORT excerpts.

2013-04-29  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/omp.c (buffer_overrides_xml): Remove extra override xml tag in include
	results case.

2013-04-29  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (buffer_notes_xml): Remove extra note xml tag in include
	results case.

2013-04-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_filter): Delete any personal filter settings

2013-04-29  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (delete_filter): Delete any personal filter settings
	using the filter.

2013-04-29  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (filter_clause): Add tag keyword and criteria.
	(ALL_INFO_UNION_COLUMNS): Add "AS allinfo".
	(total_info_count, init_all_info_iterator): Change type parameter value
	for filter_clause from "nvt" to "allinfo".

2013-04-26  Werner Koch  <wk@gnupg.org>

	* src/manage_sql.c (get_sysconf_gpghome, get_trustedkeys_name): New.
	(verify_signature): Change to use gpgv.
	* src/openvasmd.c (main): Remove setting of GNUPGHOME.

2013-04-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (migrate_79_to_80): Ensure tables exist.

2013-04-26  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Remove set but unused variable
	user_name in CLIENT_GET_USERS case.

2013-04-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (migrate_79_to_80): Correct column name.

2013-04-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (migrate_79_to_80): Remove g_file_get_contents len
	args.

2013-04-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_start_element): In CLIENT_GET_USERS pass user
	instead of username to init_user_group_iterator.

	* src/manage_sql.c (init_user_group_iterator): Replace username arg with
	user.

	* src/manage.h: Update header accordingly.

2013-04-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* ChangeLog: Correct name of database_migrators in previous logs.

2013-04-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* doc/db_postgres.sql (users): Add method.

	* doc/db.png: Update from source.

2013-04-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_start_element): In CLIENT_AUTHENTIC_COMMANDS
	CREATE_USER case, init hosts_allow so that the default is allow all
	instead of deny.

2013-04-25  Matthew Mundell <matthew.mundell@greenbone.net>

	Allow users called "om", now that Manager and Scanner users are
	separate.

	* src/manage_sql.c (authenticate): Allow users named "om" to login.
	(openvas_admin_add_user): Allow creation of users called "om".

2013-04-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (strcmp_desc, openvas_admin_list_users): Remove.  Out of
	use.

	* src/manage_sql.c (init_manage_process): Remove user_uuid SQL init.

	* src/sql.c (sql_user_uuid): Remove.  Out of use.

	* src/sql.h: Remove header accordingly.

2013-04-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (handle_sigabrt): Check for recursion before printing
	backtrace.

2013-04-25  Matthew Mundell <matthew.mundell@greenbone.net>

	Move user management from disk into the database.  Hence increase
	database version to 80.  Add database migration from version 79 to 80.

	Migration will remove all ldap and ads users, and their db resources.
	All orphaned users in the database will also be removed, with their db
	resources.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 80.

	* src/manage.c (openvas_admin_user_access): Remove.  Info now in db.

	* src/manage_sql.c (user_is_admin, user_is_observer): New functions.
	(user_may): Switch to new role functions.
	(copy_resource_lock): New function.  Body from copy_resource, without
	locking.
	(copy_resource): Call through to copy_resource_lock.
	(create_tables): Add method to users.
	(migrate_9_to_10_user_uuid): New function.
	(migrate_9_to_10): Call migrate_9_to_10_user_uuid instead of the library
	function, because it accesses the disk.
	(MIGRATE_79_to_80_DELETE): New macro.
	(migrate_79_to_80_remove_users, migrate_79_to_80_user_access)
	(migrate_79_to_80): New function.
	(database_migrators): Add migrate_79_to_80.
	(copy_user, user_uuid): New functions.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): Switch to new role functions.
	Remove directory args that were for disk users. In MODIFY_USER remove
	duplicate array terminate, add new return case and correct errror
	message.  In CREATE_USER add new return case.  In GET_USERS switch to
	user iterator and standard GET facilities.

	* src/openvasmd.c (main): Init auth with new funcs function.

2013-04-25  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	* src/omp.c (xml_handle_end_element): In cases CLIENT_CREATE_TAG,
	CLIENT_MODIFY_TAG fix preconditions for testing resource ID.

2013-04-25  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	* ChangeLog: Fix file name typo in last entry.

2013-04-25  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	* src/manage.h (resource_id_exists): New function prototype.

	* src/manage_sql.c (resource_id_exists): New function. Tests if a
	resource with a given ID exists.
	(create_tag): Add code 99 (permission denied) to comment.
	Add check if attach_type is valid. Make attach_id optional.
	(modify_tag): Add check if attach_type is valid.

	* src/omp.c (xml_handle_end_element): In cases CLIENT_CREATE_TAG,
	CLIENT_MODIFY_TAG make attach_id optional and check if it refers to
	an existing resource when it is not empty.

	* src/schema_formats/XML/OMP.xml (create_tag, modify_tag): Make element
	attach/id in command optional and change description to require
	an existing resource id.

	* doc/omp.html, doc/omp.rnc: Update from source.

2013-04-24  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (migrate_77_to_78): Add check if database version
	is correct and add comments.

2013-04-24  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	* src/manage.c (valid_db_resource_type): Return 0 when tested type is
	NULL.

	* src/omp.c (xml_handle_end_element): Change CLIENT_CREATE_TAG_ATTACH
	and CLIENT_MODIFY_TAG_ATTACH to use CLOSE macro. In CLIENT_MODIFY_TAG,
	add check if resource type is NULL before validating it.

2013-04-24  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	* src/omp.c (send_get_common): Remove debug output left from testing.

2013-04-23  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	Add tag data (count and individual tags) to most OMP GET responses.

	* src/manage.c (get_nvti_xml): Add tag data to returned XML.

	* src/manage.h (init_resource_tag_iterator, resource_tag_iterator_uuid)
	(resource_tag_iterator_name, resource_tag_iterator_value)
	(resource_tag_iterator_comment, resource_tag_iterator_active)
	(resource_tag_count): New iterator function prototypes for tags
	attached to a resource.

	* src/manage_sql.c (tag_count): Fix comment saying "targets" instead of
	tags.
	(init_resource_tag_iterator, resource_tag_iterator_uuid)
	(resource_tag_iterator_name, resource_tag_iterator_value)
	(resource_tag_iterator_comment, resource_tag_iterator_active): New
	iterator functions for tags attached to a resource.
	(resource_tag_count): New function for counting tags attached to a
	resource.

	* src/omp.c (): Add buffer_xml_append_printf static header.
	(send_get_common, buffer_notes_xml, buffer_overrides_xml): Add tag data
	to returned XML.
	(xml_handle_end_element): In case CLIENT_GET_USERS, add tag data to
	returned XML.

	* src/schema_formats/XML/OMP.xml (get_agents, get_configs, get_alerts)
	(get_filters, get_info, get_lsc_credentials, get_notes, get_nvts)
	(get_overrides, get_report_formats, get_schedules, get_slaves)
	(get_targets, get_tasks, get_users): Add "user_tags" element
	and subelements to response. Fix incorrectly named element "agent".

	* doc/omp.html, doc/omp.rnc: Update from source.

2013-04-23  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (migrate_78_to_79): Follow same structure as previous
	migrators.

2013-04-23  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (manage_report_filter_controls, report_filter_term)
	(print_report_xml): Remove show_closed_cves parameter.

	* src/manage.h: Adapt manage_report_filter_controls header.

	* src/omp.c (get_reports_data_t, omp_xml_handle_start_element)
	(omp_xml_handle_end_element): Remove show_closed_cves element. Adapt
	manage_send_report function calls.

2013-04-22  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_config_discovery.c (make_config_discovery): Add preference
	for "Services" nvt to test SSL based services.

	* src/manage_sql.c (migrate_78_to_79): Add preference for "Services"
	nvt.

2013-04-22  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Migrate DB to set some preferences for "Ping Host" nvt and remove "tcp
	timestamps" nvt for Discovery Scan Config.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Set to 79.

	* src/manage_sql.c (migrate_78_to_79): New function.
	(database_migrators): Add migrate_78_to_79.

2013-04-22  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_config_discovery.c (make_config_discovery): Set ping host
	nvt preferences "Mark unrechable Hosts as dead (not scanning)" and
	"Report about unrechable Hosts" to yes. Create the new config within the
	transaction.

	* src/manage_sql.c (init_manage): Let the make_config_discovery add the
	discovery config to the configs table.

2013-04-19  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (port_name_formatted): New function.

	* src/manage.h: Add port_name_formatted declaration.

	* src/otp.c (process_otp_scanner_input): Use port_name_formatted for
	SCANNER_PORT_NUMBER, SCANNER_ERRMSG_NUMBER, SCANNER_HOLE_NUMBER,
	SCANNER_LOG_NUMBER, SCANNER_INFO_NUMBER, SCANNER_NOTE_NUMBER cases.

2013-04-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (copy_task): Copy all preferences from existing task.
	This includes the "Add to Assets" flag and the Scan Intensity settings.

2013-04-17  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/sql.c (sql_resource_exists, sql_resource_name): Change SQL
	function to return null when at least one of the parameters is null
	instead of treating it as an error, which caused problems with empty
	tables.

2013-04-16  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage.c (parse_tags): Change comment to "Scanner Tags".
	(valid_db_resource_type): New function to test if a string is a valid
	resource type.

	* src/manage.h (tag_iterator_attach_name, tag_iterator_orphaned): New
	iterator function prototypes.
	(valid_db_resource_type): New function prototype.

	* src/manage_sql.c (init_manage_process): Add creation of SQLite
	functions resource_exists, resource_name.
	(TAG_ITERATOR_FILTER_COLUMNS, TAG_ITERATOR_COLUMNS): Add columns
	"orphaned" and "attach_name".
	(tag_iterator_orphaned, tag_iterator_attach_name): New iterator
	functions.

	* src/omp.c (omp_xml_handle_end_element): In case CLIENT_GET_TAGS,
	add "name" element to "attach", add "orphaned" element to "tag" to
	response.
	In case CLIENT_CREATE_TAG, remove a superfluous whitespace.
	In cases CLIENT_CREATE_TAG, CLIENT_MODIFY_TAG add validation of
	attach_type using valid_db_resource_type.

	* src/sql.c (sql_resource_exists): New SQLite function to test if a
	resource of arbitrary type exists.
	(sql_resource_name): New SQLite function to get the name of a resource
	or construct one from various info.

	* src/sql.h (sql_resource_exists, sql_resource_name): New SQLite
	function prototypes.

	* src/schema_formats/XML/OMP.xml (get_tags): Add response elements
	attach/name and orphaned and update example to include these.

	* doc/omp.html, doc/omp.rnc: Update from source.

2013-04-15  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (valid_type, type_pretty_name, type_db_name):
	Add new resource type "Tag" for filters.

2013-04-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (modify_task_data_t, modify_task_data_reset)
	(client_state_t): Add target_id and config_id entries.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Allow config
	and target editing in MODIFY_TASK when the task status is New.

2013-04-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (delete_user): Add user_id and ultimate
	attribs.
	(get_users): Add user_id attrib.  Add USER/@id to response.

	* doc/omp.html, doc/omp.rnc: Update from source.

2013-04-11  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage.h (copy_tag): New function prototype.

	* src/manage_sql.c (copy_tag): New function to create copies of existing
	tags.

	* src/omp.c (create_tag_data_t, create_tag_data_reset): Add field
	"copy".
	(client_state_t): Add new state CLIENT_CREATE_TAG_COPY.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add handling of new create_tag subelement "copy".

	* src/schema_formats/XML/OMP.xml, doc/omp.html, doc/omp.rnc
	(create_tag): Add optional subelement "copy" to command.

2013-04-11  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (manage_empty_trashcan): Also clear tags_trash
	table when trashcan is emptied.

2013-04-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (create_user, delete_user)
	(describe_auth, get_users, modify_auth, modify_user): New commands.
	From OAP schema in Administrator.
	(help): Update to match help text.

	* doc/omp.html, doc/omp.rnc: Update from source.

2013-04-11  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/schema_formats/XML/OMP.xml (create_user, delete_user)
	(describe_auth, get_users, modify_auth, modify_user): New commands.
	From OAP schema in Administrator.
	(help): Update to match help text.

	* doc/omp.html, doc/omp.rnc: Update from source.

2013-04-11  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (modify_tag): Fix "value" parameter changing
	name instead of value.

2013-04-10  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_MODIFY_AUTH align
	comment and remove FIX that was already covered.

2013-04-10  Matthew Mundell <matthew.mundell@greenbone.net>

	Cleanup the MODIFY_AUTH implementation.

	* src/omp.c (modify_auth_data_t, modify_auth_data_reset): Remove
	curr_group_name.
	(omp_xml_handle_start_element): Remove MODIFY_AUTH doc, this will be in
	the OMP doc.  Remove TODO, this is a general feature that applies to all
	commands.  Reformat CLIENT_MODIFY_AUTH to match others, using
	ELSE_ERROR.  In CLIENT_MODIFY_AUTH allocate the group instead of storing
	the name separately.  Remove FIX on
	CLIENT_MODIFY_AUTH_GROUP_AUTHCONFSETTING because it's basically what the
	the others do.
	(omp_xml_handle_end_element): In CLIENT_MODIFY_AUTH add group name check
	and move key_file declaration to top of block.  In
	CLIENT_MODIFY_AUTH_GROUP just add the settings, and leave the name
	checking to the end handler.

2013-04-10  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* INSTALL: Adjusted formatting.

	* tools/openvas-portnames-update.in: Use cmake variable instead of
	fixed path to allow individual installation prefix.
	Also added output of number of processed items.

2013-04-10  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (manage_set_setting): Add Tags Filter.

	* src/omp.c (omp_xml_handle_end_element): In case CLIENT_GET_TAGS,
	add support for default filter (filt_id = -2) and ensure that generation
	of normal response is only run if iterator is created correctly.

2013-04-10  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c: Remove make_port_names prototype.
	(init_manage): Don't check and update port_names as it is done
	externally now.

	* src/manage_port_names.c: Remove file as it is not needed anymore.

	* CMakeLists.txt: Remove reference to manage_port_names.c

	* INSTALL: Update for steps to import port names from IANA service names
	list.

2013-04-10  Matthew Mundell <matthew.mundell@greenbone.net>

	Add MODIFY_AUTH to OMP.  This is a direct copy from OAP in Administrator
	with some slight changes to fit in Manager, mostly formatting.

	* src/omp.c (auth_conf_setting_t): New type.
	(auth_conf_setting_from_xml): New function.
	(omp_commands): Add MODIFY_AUTH.
	(auth_group_t, modify_auth_data_t): New types.
	(modify_auth_data_reset): New function.
	(command_data_t, client_state_t): Add MODIFY_AUTH entries.
	(modify_auth_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add
	MODIFY_AUTH handling.

2013-04-10  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage.h (tag_in_use, trash_tag_in_use, tag_writable)
	(trash_tag_writable): New function prototypes.

	* src/manage_sql.c (tag_in_use, trash_tag_in_use): New functions
	for compatibility with SEND_GET_COMMON macro.
	(tag_writable, trash_tag_writable): New functions for compatibility with
	SEND_GET_COMMON macro.

	* src/omp.c (omp_xml_handle_end_element): In case CLIENT_GET_TAGS,
	change to use SEND_GET_COMMON macro instead of send_get_common function.

2013-04-10  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/omp.c (create_tag_data_t, modify_tag_data_t): Add attach_count.
	Add missing periods in comment.
	(omp_xml_handle_start_element): In cases CLIENT_MODIFY_TAG,
	CLIENT_CREATE_TAG add incrementation of attach_count.
	(omp_xml_handle_end_element): In case CLIENT_GET_TAGS fix indentation,
	change to use send_get_common for common get elements.
	In case CLIENT_DELETE_TAG, fix parameters of send_find_error_to_client.
	In cases CLIENT_MODIFY_TAG, CLIENT_CREATE_TAG add new checks for attach
	subelement and clarify error messages.
	In cases CLIENT_MODIFY_TAG_ATTACH, CLIENT_CREATE_TAG_ATTACH remove value
	checks, now handled by CLIENT_MODIFY_TAG and CLIENT_CREATE_TAG.

	* src/schema_formats/XML/OMP.xml, doc/omp.html, doc/omp.rnc (get_tags):
	Add writable and in_use elements in response.

2013-04-10  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Order iteration over families
	descendingly in CLIENT_GET_CONFIGS case.

2013-04-10  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (create_tables, create_tables_version_4): Reformat
	SQL queries so lines are 80 or less characters long.
	Move tag-related queries so they fit into the alphabetical order.

2013-04-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (create_schedule): Neaten formatting.
	(create_tag, modify_tag): Format overhangs of ternaries like others.

2013-04-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_USERS free uuid
	from openvas_user_uuid.

2013-04-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (openvas_admin_modify_user): Leave groups alone if
	groups arg is NULL.  If setting groups then clear before, otherwise the
	old groups may remain.

	* src/omp.c (omp_xml_handle_start_element): Init the MODIFY_USER groups
	array only when a GROUPS element is given, so that the client has a way
	to preserve the existing groups.

2013-04-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Use CLOSE for MODIFY_USER
	states.

2013-04-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_USER correct
	log message, and add logs to all cases.

2013-04-09  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (openvas_admin_add_user): Add args for groups.

	* src/omp.c (modify_user_data_t, client_state_t): Add groups entries.
	(modify_user_data_reset): Free groups
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add GROUPS
	to MODIFY_USER.

	* src/manage.h: Update header accordingly.

2013-04-09  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (create_schedule): Clean up spacing and
	braces/indentation.

2013-04-09  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (create_schedule): Fix timezone default overwriting
	existing value. Remove superfluous "!= 0" and braces.

2013-04-09  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Set to 78.

	* src/manage_sql.c (migrate_77_to_78): New function. Change duration
	and period of schedules to 0 if they were -1.
	(database_migrators): Add migrate_77_to_78.

	* src/omp.c (omp_xml_handle_end_element): In cases
	CLIENT_CREATE_SCHEDULE and CLIENT_MODIFY_SCHEDULE set period and
	duration to 0 instead of -1 if they are not specified.

2013-04-09  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/html/XML/OMP.xml, doc/omp.html, doc/omp.rnc (create_schedule): Add
	timezone element. Mark all elements other than name as optional to make
	consistent with actual behavior.

2013-04-09  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage.h, src/manage_sql.c (create_schedule): Add timezone
	parameter.

	* src/omp.c (create_schedule_data_t, create_schedule_data_reset): Add
	timezone.
	(client_state_t): New state CLIENT_CREATE_SCHEDULE_TIMEZONE.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add timezone element to create_schedule.

2013-04-08  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Add tag management OMP commands (create_tag, delete_tag, get_tags,
	modify_tag).

	* src/manage.h (tag_t): New typedef.
	(tag_uuid, create_tag, delete_tag, find_tag, modify_tag)
	(init_tag_iterator, tag_count, tag_iterator_attach_type)
	(tag_iterator_attach_id, tag_iterator_active, tag_iterator_active)
	(tag_iterator_value): New function prototypes. See manage_sql.c.

	* src/manage_sql.c (create_tables): Add definition of tables "tags" and
	"tags_trash" as well as indexes.
	(tag_uuid): New function, gets the UUID of a tag.
	(manage_restore): Add restore of tags in trashcan.
	(create_tag, delete_tag, find_tag, modify_tag): New functions for tag
	management.
	(TAG_ITERATOR_FILTER_COLUMNS, TAG_ITERATOR_COLUMNS)
	(TAG_ITERATOR_TRASH_COLUMNS): New #defines for tag iterator columns.
	(init_tag_iterator, tag_count, tag_iterator_attach_type)
	(tag_iterator_attach_id, tag_iterator_active, tag_iterator_active)
	(tag_iterator_value): New iterator functions for tags.

	* src/omp.c (omp_commands): Add help text for new tag commands.
	(create_tag_data_t, delete_tag_data_t, get_tags_data_t)
	(modify_tag_data_t): New structs for command data of tag commands.
	(create_tag_data_reset, delete_tag_data_reset, get_tags_data_reset)
	(modify_tag_data_reset): New functions that reset tag command data.
	(command_data_t): Add new command data types.
	(create_tag_data, delete_tag_data, get_tags_data, modify_tag_data): New
	variables for tag command data.
	(client_state_t): Add new tag command client states.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add handling of tag-related XML elements.

	* src/schema_formats/XML/OMP.xml, doc/omp.html, doc/omp.rnc: Add
	documentation of new commands (create_tag, delete_tag, get_tags,
	modify_tag).

2013-04-08  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Add script to update DB port names data from a port names xml file list.
	Currently supports IANA service names official list.

	* tools/openvas-portnames-update.in: New script to update

	* tools/portnames_update.xsl: New template to generate SQL queries for
	DB port names data creation.

	* CMakeLists.txt: Install tools/portnames_update.xsl and
	tools/openvas-portnames-update files.

2013-04-08  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_SCHEDULES use
	"UTC" when the timezone is NULL, else "(null)" ends up in the response.

2013-04-07  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/manage_sql.c (setup_full_config_prefs): Remove handling
	of "silent_dependencies".

2013-04-05  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_config_discovery.c (make_config_discovery): Remove tcp
	timestamps from default discovery config scan as it has a cvss > 0.0.

2013-04-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (set_task_observers, group_add_users): Free
	openvas_user_uuid return.

2013-04-04  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (copy_user): Add NULL check on role for now, to keep
	it working.

2013-04-04  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Add port_names to resolve Network services names and load content from
	official IANA list.

	* src/manage_port_names.c: New file.

	* src/CMakeLists.txt: Add manage_port_names.c.

	* src/manage_sql.c: Declare make_port_names prototype.
	(create_tables): Create port_names table.
	(manage_port_name): Return service name value from port_names table.
	(init_manage): Call make_port_names if port_names table has few entries.

2013-04-03  Matthew Mundell <matthew.mundell@greenbone.net>

	Add name attribute to DELETE_USER, to be compatible with Administrator.

	* src/manage_sql.c (delete_user): Add name arg.  Delete by name if given
	user ID is NULL.

	* src/manage.h: Update header accordingly.

	* src/omp.c (delete_user_data_t, delete_user_data_reset): Add name.
	(omp_xml_handle_start_element): Parse DELETE_USER name attribute.
	(omp_xml_handle_end_element): In CLIENT_DELETE_USER pass name to delete
	function.

2013-04-03  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/otp.c (process_otp_scanner_input): Get the length for g_convert
	with strlen, because the strip and compress functions can change the
	string length.  Thanks to Rodolfo Gouveia and Stefan Sperling for
	spotting this.

2013-04-03  Werner Koch  <wk@gnupg.org>

	* src/ompd.c (serve_omp): Check for pending TLS records before the
	main select.

2013-04-03  Matthew Mundell <matthew.mundell@greenbone.net>

	Add MODIFY_USER to OMP.  This is a direct copy from OAP in Administrator
	with some slight changes to fit in Manager, mostly formatting.

	* src/manage_sql.c (openvas_admin_modify_user): New function.  From
	Administrator.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_commands, command_data_t, client_state_t): Add
	MODIFY_USER entries.
	(modify_user_data_t): New type.
	(modify_user_data_reset): New function.
	(modify_user_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Handle MODIFY_USER.

2013-04-03  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/otp.c (process_otp_scanner_input): In SCANNER_HOLE_NUMBER,
	SCANNER_INFO_NUMBER, SCANNER_NOTE_NUMBER, SCANNER_LOG_NUMBER,
	SCANNER_ERRMSG_NUMBER cases, fix port number and protocol
	extraction format string to match scanner changes and use
	manage_port_name function to get port number associated name.

	* src/manage_sql.c (manage_port_name): New function.

	* src/manage.h: Add manage_port_name header.

2013-04-03  Matthew Mundell <matthew.mundell@greenbone.net>

	Add DELETE_USER.  This is the same command as in Administrator, but it
	takes a uuid parameter instead of a name.  Name parameter will follow,
	for backward compatibility.

	* src/manage_sql.c (find_user): Switch to finding by UUID like other
	find functions.
	(find_user_by_name): New function.  Body from old find_user.  Update
	find_user callers to use this.
	(openvas_admin_remove_user): New function.  From Administrator.
	(delete_user): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_commands, client_state_t, command_data_t): Add
	DELETE_USER entries.
	(delete_user_data_t): New type.
	(delete_user_data_reset): New function.
	(delete_user_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Handle
	DELETE_USER.

2013-04-02  Matthew Mundell <matthew.mundell@greenbone.net>

	Add CREATE_USER/COPY for cloning, including new user columns.  Hence
	increase database version to 77.  Add database migration from version 76
	to 77.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 77.

	* src/manage_sql.c (user_t): Remove.  Now in manage.h.
	(copy_resource): Use underscore instead of space in name for users.
	(create_tables): Add standard columns.  Add placeholder columns for info
	stored on disk.
	(migrate_76_to_77): New function.
	(database_migrators): Add migrate_76_to_77.
	(init_manage): Remove creationg of "om" user.  Now only needed on scanner
	side.
	(manage_user_hash, manage_user_uuid, user_ensure_in_db)
	(manage_user_set_role, manage_user_set_rules, manage_user_exists): New
	functions.
	(authenticate): Authenticate with the method function, to get the method,
	and because user UUIDs are in db now.  Get UUID from db.  Switch to new
	role functions.  Call user_ensure_in_db to ensure user exists in db.
	(manage_set_settings): Set password in db instead of with library.
	(openvas_admin_add_user): Remove directory arg.  Add user to db instead
	of disk.
	(copy_user): Set generic password instead of copying from other user.
	Remove call to add user on disk.
	(openvas_admin_remove_user): Remove.  Was doing the disk removal.
	(delete_user): Remove disk part.
	(openvas_admin_modify_user): Modify in db instead of on disk.
	(user_in_use, trash_user_in_use, user_writable)
	(trash_user_writable): New function.
	(USER_ITERATOR_FILTER_COLUMNS, USER_ITERATOR_COLUMNS)
	(USER_ITERATOR_TRASH_COLUMNS): New defines.
	(user_count, init_user_iterator, user_iterator_role)
	(user_iterator_method, user_iterator_hosts)
	(user_iterator_hosts_allow): New functions.
	(init_user_group_iterator): Get user ID by name now that users are in
	db only.
	(RULES_HEADER): New define.

	* src/manage.h: Add headers accordingly.
	(user_t): New type.  From manage_sql.c.

	* src/omp.c (create_user_data_t, client_state_t): Add copy field.
	(create_user_data_reset): Free copy.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add COPY to CREATE_USER.

	* src/sql.c (sql_uniquify): Use underscore instead of space in name for
	users.

	* doc/db_postgres.sql (users): Add new columns.

	* doc/db.png: Update from source.

2013-03-29  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* 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: Wrap the insertions
	bulks in sql transactions.

2013-03-29  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (init_manage, config_in_use): Check empty scan config
	by uuid instead of by name.

2013-03-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (escalate_1): Include note and override details, else
	text element is truncated.

2013-03-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage.c (openvas_admin_list_users): Add uuid arg.  Return
	matching user if uuid given, as for name.

	* src/manage.h: Update header accordingly.

	* src/omp.c (get_users_data_t): Add get field.  Doc name.
	(get_users_data_reset): Reset get.
	(omp_xml_handle_start_element): Parse GET_USERS GET attributes.
	(omp_xml_handle_end_element): In CLIENT_GET_USERS find user by ID if
	given, and add USER/@id.

2013-03-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage_process): Add SQL function user_uuid.
	(init_user_group_iterator): Get the user via the UUID instead of via the
	name, because the name is ambiguous in the db.

	* src/sql.c (sql_user_uuid): New function.

	* src/sql.h: Add header accordingly.

2013-03-28  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (print_report_xml): Cleanup report_hosts iterator in
	assets case, otherwise the db is closed with open statements.

2013-03-28  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_config_discovery (make_config_discovery): Add uuid function
	parameter. Use it instead of the fixed 'Discovery' name value.

	* src/manage_sql.c: Adjust make_config_discovery prototype.
	(init_manage, config_in_use): Check for default Discovery config with
	uuid instead of name.

2013-03-28  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/openvasmd.c: Include misc/proctitle.h
	(main.c): Set process title when initializing.

2013-03-28  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (delete_config, config_in_use): Check for 'Discovery'
	predefined scan configuration too.

2013-03-28  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Add default "Discovery" scan configuration.

	* src/manage_sql.c: Add make_config_discovery prototype.
	(CONFIG_UUID_DISCOVERY, MANAGE_NVT_SELECTOR_DISCOVERY): New defines.
	(init_manage): Create Discovery scan configuration if not found.
	(nvt_selector_nvt_count): Remove static qualifier.

	* src/manage.h: Add nvt_selector_family_count prototype.

	* src/manage_config_discovery.c: New file. Contains function to create
	Discovery Scan configuration.

	* src/CMakeLists.txt: Add manage_config_discovery.c

2013-03-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Use CLOSE for CREATE_USER
	states.

2013-03-27  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_user_group_iterator): Order by name.

2013-03-27  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage_sql.c (lsc_credential_iterator_rpm)
	(lsc_credential_iterator_deb, lsc_credential_iterator_exe): Change
	creation of packages to use login instead of name, which caused
	problems, for example when the credential name contained whitespaces.

2013-03-27  Matthew Mundell <matthew.mundell@greenbone.net>

	Add groups to CREATE_USER.

	* src/manage_sql.c (openvas_admin_add_user): Add groups args.  Add user
	to given groups.  Add user to database.

	* src/manage.h: Update header accordingly.

	* src/omp.c (client_state_t): Add CREATE_USER group states.
	(create_user_data_t): Add groups
	(create_user_data_reset): Free groups.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add
	CREATE_USER groups.

2013-03-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Add CREATE_USER to OMP.  This is a direct copy from OAP in Administrator
	with some slight changes to fit in Manager, mostly formatting.

	* src/manage.c (validate_username): New function.

	* src/manage_sql.c (openvas_admin_add_user): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_commands, client_state_t): Add new command.
	(create_user_data_t): New type.
	(create_user_data_reset): New function.
	(create_user_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Handle new command.

2013-03-26  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_user_group_iterator, user_group_iterator_uuid)
	(user_group_iterator_name): New functions.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (omp_xml_handle_end_element): In GET_USERS add GROUPS.

2013-03-26  Matthew Mundell <matthew.mundell@greenbone.net>

	Add DESCRIBE_AUTH and GET_USERS to OMP.  These are direct copies from
	OAP in Administrator with some slight changes to fit in Manager, mostly
	formatting.

	* src/manage.c (strcmp_desc, openvas_admin_list_users): New functions.
	(RULES_HEADER): New define.
	(openvas_admin_user_access, keyfile_to_auth_conf_settings_xml): New
	functions.

	* src/manage.h: Add headers accordingly.

	* src/omp.c (omp_commands, client_state_t): Add new commands.
	(get_users_data_t): New type.
	(get_users_data_reset): New function.
	(get_users_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Handle new
	commands.

2013-03-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (PERMISSION_ITERATOR_FILTER_COLUMNS): Match columns
	to GSA.
	(PERMISSION_ITERATOR_COLUMNS): Match columns to GSA, using underscore to
	shadow existing column names.  Remove resource and subject until they
	are actually needed.  Adjust accessor functions accordingly.

2013-03-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (vector_find_filter, underscore_sql_quote): New
	functions.
	(filter_clause): Use vector_find_filter instead of vector_find_string.
	When a keyword matched a filter column with a leading underscore, then
	add the underscore in the SQL.  This allows a filter column to have a
	name that is used by some other column in the table.
	(filter_term_value): Add underscore check.

2013-03-25  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (total_info_count): Code refactor.
	(ALL_INFO_UNION_COLUMNS): Use UNION ALL instead of UNION as there are no
	duplicate entries to remove.

2013-03-25  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* doc/omp.html, doc/omp.rnc, src/schema_formats/XML/OMP.xml:
	Rename def_class to class, xml_file to file for OVAL definitions.

	* src/manage.h (ovaldef_info_iterator_def_class): Removed, renamed to
	ovaldef_info_iterator_class.
	(ovaldef_info_iterator_class): New. Renamed
	ovaldef_info_iterator_def_class.
	(ovaldef_info_iterator_xml_file): Removed, renamed to
	ovaldef_info_iterator_file.
	(ovaldef_info_iterator_file): New. Renamed
	ovaldef_info_iterator_xml_file.

	* src/manage_sql.c (OVALDEF_INFO_ITERATOR_FILTER_COLUMNS)
	(OVALDEF_INFO_ITERATOR_COLUMNS): Rename def_class to class,
	xml_file to file.
	(ovaldef_info_iterator_def_class): Removed. Renamed to
	ovaldef_info_iterator_class.
	(ovaldef_info_iterator_class): New. Renamed
	ovaldef_info_iterator_def_class.
	(ovaldef_info_iterator_xml_file): Removed. Renamed to
	ovaldef_info_iterator_file.
	(ovaldef_info_iterator_file): New. Renamed
	ovaldef_info_iterator_xml_file.

	* src/omp.c (xml_handle_end_element): In case CLIENT_GET_INFO,
	rename element def_class to class, xml_file to file.

2013-03-23  Matthew Mundell <matthew.mundell@greenbone.net>

	Add permissions trashcan.

	* src/manage_sql.c (create_tables): Add permissions_trash.
	(delete_permission): Add trash case.
	(manage_restore): Add permission restore.

2013-03-23  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_INFO format
	ternary conditional like others.

2013-03-22  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_manage_process, manage_scap_loaded)
	(manage_cert_loaded): Use access instead of stat to check for SCAP and
	CERT databases.  Just put a warning instead of aborting when the access
	fails.  Remove redundant manage_scap_loaded and  manage_cert_loaded
	calls.

2013-03-21  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* tools/greenbone-scapdata-sync, tools/openvas-scapdata-sync.in: Make
	formatting of log messages more consistent.

2013-03-21  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* tools/greenbone-scapdata-sync (db_migrate_12, check_db_version): New
	migration to SCAP database version 12.
	(update_scap_db_private): Remove OVAL duplicate checks.

	* tools/openvas-scapdata-sync.in (db_migrate_12, check_db_version): New
	migration to SCAP database version 12.
	(update_sec_db_private): Remove OVAL duplicate checks.

	* tools/oval_update.xsl: Add file number suffix to uuids.
	Add xml file name to table "ovalfiles".

	* tools/scap_db_init.sql (ovaldefs, ovaldefs_idx): Remove UNIQUE
	constraint for name.
	(ovalfiles): New table for OVAL file names.
	(ovalfiles_delete): New deletion trigger on ovalfiles.

2013-03-21  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In case CLIENT_GET_INFO,
	output xml_file for OVALDEF even if details are not requested.

	* src/schema_formats/XML/OMP.xml, doc/omp.html, doc/omp.rnc (get_info):
	Move status and xml_file to reflect their real positions in OMP output.
	Change xml_file to non-optional.

2013-03-21  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Handle non-unique "name" and unique selection by "info_id" for get_info.

	* src/manage.c (get_ovaldef_filename): Rename parameter from oval_id
	to item_id and change comment to make clear that the OVAL ID with suffix
	is to be passed as parameter.
	(manage_read_info): New parameter uid (unique identifier), used to
	look up files for CVE, OVALDEF, and DFN_CERT_ADV.

	* src/manage.h (manage_read_info): Change prototype.
	(info_name_count): New function prototype.

	* src/manage_sql.c (info_name_count): New function, counts get_info
	items with a given name by name.
	(init_cpe_info_iterator, init_cve_info_iterator)
	(init_ovaldef_info_iterator, init_dfn_cert_adv_info_iterator): Add
	removal of filter if ID is supplies, as is done for name.
	(get_ovaldef_short_filename): Rename parameter from oval_id
	to item_id and change comment to make clear that the OVAL ID with suffix
	is to be passed as parameter.

	* src/omp.c (omp_xml_handle_end_element): In case CLIENT_GET_INFO,
	pass ID to manage_read_info in addition to name.
	Use info_count instead of assuming 1 when counting info selected by
	name.

2013-03-20  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* INSTALL: Increased dependency note for gnutls to 2.8
	and removed notes on openvas-adduser which is going
	to be removed anyway.

2013-03-20  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP MODIFY_GROUP.

	* src/manage_sql.c (group_add_users): New function.  Body from
	create_group.
	(create_group): Call group_add_users to add users.
	(modify_group): New function.

	* src/manage.h: Add header accordingly.

	* src/omp.c (omp_commands, command_data_t, client_state_t): Add
	MODIFY_GROUP entries.
	(modify_group_data_t): New type.
	(modify_group_data_reset): New function.
	(modify_group_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Add MODIFY_GROUP.

2013-03-20  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (valid_type, type_pretty_name, type_db_name): Add
	permissions, so that creating permission filters works.

2013-03-20  Matthew Mundell <matthew.mundell@greenbone.net>

	Add the copy part of OMP CREATE_PERMISSION, for cloning.

	* src/manage_sql.c (copy_resource): Add make_name_unique flag arg.
	Add to all callers.
	(copy_permission): New function.

	* src/omp.c (omp_commands): Add new command.
	(create_permission_data_t): New type.
	(create_permission_data_reset): New functions.
	(command_data_t, client_state_t): Add new permission entries.
	(create_permission_data): New variable.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add new
	command.

2013-03-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Add OMP DELETE_PERMISSION and GET_PERMISSIONS.

	* src/manage_sql.c (permission_uuid, permission_in_use)
	(trash_permission_in_use, permission_writable)
	(trash_permission_writable): New functions.
	(PERMISSION_ITERATOR_FILTER_COLUMNS, PERMISSION_ITERATOR_COLUMNS): New
	defines.
	(permission_count, init_permission_iterator)
	(permission_iterator_resource_type, permission_iterator_resource_uuid)
	(permission_iterator_resource_name, permission_iterator_subject_type)
	(permission_iterator_subject_uuid, permission_iterator_subject_name)
	(find_permission_with_permission, delete_permission)
	(find_permission): New

	* src/manage.h: Add headers accordingly.
	(permission_t): New type.

	* src/omp.c (omp_commands): Add new commands.
	(delete_permission_data_t, get_permissions_data_t): New types.
	(delete_permission_data_reset, get_permissions_data_reset): New
	functions.
	(command_data_t, client_state_t): Add new permission entries.
	(delete_permission_data, get_permissions_data): New variables.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add new
	commands.

2013-03-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_task_user_iterator)
	(init_task_group_iterator): Correct doc brief.

2013-03-19  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (set_task_observers): Delete only user permissions,
	so that group permissions can be left the same.

	* src/omp.c (omp_xml_handle_start_element): Move MODIFY_TASK groups init
	into observers.
	(omp_xml_handle_end_element): In MODIFY_TASK check groups existence
	instead of length, to make it possible to remove all observer groups
	from the task.  Free owner after last use, instead of before.

2013-03-19  Matthew Mundell <matthew.mundell@greenbone.net>

	Add observer groups to CREATE_TASK.

	* src/omp.c (create_task_data_t, create_task_data_reset): Add groups.
	(client_state_t): Add observer group state.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add observer
	groups.

2013-03-18  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (user_has_access_uuid, user_may)
	(init_get_iterator): Enable group permission checks.

2013-03-18  Matthew Mundell <matthew.mundell@greenbone.net>

	Add observer groups to MODIFY_TASK and GET_TASKS.

	* src/manage_sql.c (init_task_group_iterator, task_group_iterator_task)
	(task_group_iterator_group, task_group_iterator_name)
	(task_group_iterator_uuid, set_task_groups): New functions.

	* src/manage.h: Update headers accordingly.

	* src/omp.c (modify_task_data_t, modify_task_data_reset): Add groups.
	(client_state_t): Add observer group state.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Add observer
	groups.

2013-03-18  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* CMakeLists.txt: Increased dependency to gnutls from 2.2 to 2.8.

2013-03-14  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Migrate DB to version 76 for md5 checksum to feed version changes.

	* src/manage_sql.c (migrate_75_to_76): New function. delete leftover
	nvts_checksum value and rename nvts_md5sum to nvts_feed_version.
	(database_migrators): Add migrate_75_to_76.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 76.

2013-03-14  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	* tools/greenbone-scapdata-sync, tools/openvas-scapdata-sync.in
	(do_help): Add help text for --verbose option.

2013-03-14  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_group_iterator): Name variable more sensibly.

2013-03-14  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	* tools/greenbone-scapdata-sync (): Add --verbose option.
	(update_scap_db): Add output of duplicate IDs in verbose mode.

	* tools/openvas-scapdata-sync.in (): Add --verbose option.
	(update_sec_db): Add output of duplicate IDs in verbose mode.

2013-03-14  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/schema_formats/XML/OMP.xml, doc/proto_postgres.sql, doc/omp.html,
	doc/omp.rnc: Update documentation for get_nvt_feed_version.

2013-03-14  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Change Plugins MD5 Checksum to Feed version.

	* src/manage.c (acknowledge_md5sum_info): Change function to
	acknowledge_feed_version_info.

	* src/manage.h: Update function headers accordingly.
	(scanner_t): Rename plugins_md5 element to plugins_feed_version.

	* src/manage_sql.c (init_manage_process): Remove unused delete
	references to nvts_checksum.
	(init_manage): Rename main.meta value name nvts_md5sum to
	nvts_feed_version.
	(nvts_md5sum, set_nvts_md5sum): Rename and update for feed version
	changes.

	* src/omp.c (command_t): Rename GET_NVT_FEED_CHECKSUM to
	GET_NVT_FEED_VERSION.
	(get_nvt_feed_checksum_data_t, get_nvt_feed_checksum_data_reset)
	(get_nvt_feed_checksum_data): Remove as unused.
	(client_state_t): Rename CLIENT_GET_NVT_FEED_CHECKSUM to
	CLIENT_GET_NVT_FEED_VERSION.
	(omp_xml_handle_start_element, omp_xml_handle_end_element): Update for
	feed version changes.

	* src/ompd.c (write_to_scanner, serve_omp): Update scanner init state
	names.

	* src/otp.c (init_otp_data, process_otp_scanner_input): Update function
	and variables names and documentation accordingly.

	* src/otp.h (scanner_init_state_t): Rename SCANNER_INIT_GOT_FEED_MD5SUM
	to SCANNER_INIT_GOT_FEED_VERSION.

2013-03-14  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (init_all_info_iterator): Clean code. Add order
	clause in no filter clause case. Free allocated gchar's.

2013-03-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/ompd.c (serve_omp): In cache update/rebuild mode, exit if
	connecting to the scanner fails.

	* src/openvasmd.c (update_or_rebuild_nvt_cache): Log when connecting to
	scanner fails.

2013-03-13  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/openvasmd.c (handle_sigabrt): Print backtrace when compiled with
	debugging.

2013-03-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (init_get_iterator): Remove used_by arg.  Recursive
	access will be handled by explicit permissions.  Update callers.

2013-03-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (migrate_74_to_75): Ensure table exists.

2013-03-12  Matthew Mundell <matthew.mundell@greenbone.net>

	Add permissions table.  Manage task observers via permissions instead of
	via the task_users table.  Hence increase database version to 75.  Add
	database migration from version 74 to 75.

	* CMakeLists.txt (OPENVASMD_DATABASE_VERSION): Increase to 75.

	* src/manage_sql.c (user_has_access_uuid): Add permission arg.  If type
	has permissions support (currently task and report) then do the check
	using the new permissions table.  Remove special case check for
	lsc_credential because recursive access via task access will be removed
	with the new permission system.  Update callers.
	(vector_find_filter, underscore_sql_quote): New functions.  Helpers.
	(user_may): Add #if 0 around already disabled code, for consistency.
	(filter_clause): Add permissions arg.  Return with array of permissions
	filter terms, if arg given.  Update callers.
	(type_has_users): Remove.
	(type_has_permissions): New function.
	(init_get_iterator): Remove task_users based filtering.  Add permission
	based filtering, which affects only tasks and reports.
	(count): Remove special case based on actions parameter.  This was used
	to control which tasks where visible.  Now done via permissions
	parameter.
	(create_tables): Add permissions.  Remove task_users.
	(migrate_74_to_75): New function.  Converts task_users to permissions.
	(database_migrators): Add migrate_74_to_75.
	(init_task_user_iterator): Remove action arg.  Iterator over permissions
	table instead of task_users.
	(task_user_iterator_actions): Remove.  Adjust name position accordingly.
	(set_task_observer): Use new table.
	(report_counts): Use permission version of find function.
	(find_report_with_permission): New function.

2013-03-12  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (filter_clause): Correct SQL typo.

2013-03-12  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	* tools/oval_timestamp.xsl, tools/oval_verify.xsl: Add recognition of
	OVAL root elements oval_variables, oval_system_charactersistics and
	oval_results. Variables files are now considered valid.

	* tools/oval_update.xsl: Add compatibility with oval_variables files.

2013-03-12  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	* src/schema_formats/XML/OMP.xml, doc/omp.html, doc/omp.rnc: Add
	OVAL definitions "status" element to get_info documentation.
	Change documentation of "deprecated" element in OVALDEF to boolean type.

2013-03-12  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (send_get_end): Don't printf filt_id when null.

2013-03-12  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/schema_formats/XML/OMP.xml, doc/omp.html, doc/omp.rnc: Update
	get_info documentation.

2013-03-12  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (ALL_INFO_ITERATOR_FILTER_COLUMNS)
	(ALL_INFO_UNION_COLUMNS, init_all_info_iterator): Add extra column
	(all_info_iterator_extra): New function.

	* src/omp.c (omp_xml_handle_end_element): Send allinfo extra element in
	CLIENT_GET_INFO case.

	* src/manage.h: Add all_info_iterator_extra header.

2013-03-11  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	* tools/greenbone-scapdata-sync (update_scap_db_private)
	(update_scap_db): Fix skipping of OVAL timestamp filter for cases when
	REBUILD_OVAL is set to 1. Add default value for REBUILD_OVAL.

	* tools/openvas-scapdata-sync (update_sec_db_private)
	(update_sec_db): Fixes analogous to Greenbone version.

2013-03-11  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	* tools/greenbone-certdata-sync (sync_certdata): Remove skipping of
	rsync with previously nonexistent feed.

2013-03-11  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (manage_set_setting): Add All SecInfo default filter
	setting.

	* src/omp.c (omp_xml_handle_end_element): Use All SecInfo as default
	filter name instead of ALLINFO in CLIENT_GET_INFO case.

2013-03-11  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* CMakeLists.txt: Install greenbone-certdata-sync.

2013-03-11  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	Add "status" column to OVAL definitions in SCAP database.

	* src/manage.h (ovaldef_info_iterator_status): New prototype.

	* src/manage_sql.c (OVALDEF_INFO_ITERATOR_FILTER_COLUMNS)
	(OVALDEF_INFO_ITERATOR_COLUMNS): Add "status" column.
	(ovaldef_info_iterator_status): New function to get "status" from an
	OVAL definition iterator.

	* src/omp.c (omp_xml_handle_end_element): In ovaldef else if section,
	add "status" to OMP output.

	* tools/greenbone-scapdata-sync (db_migrate_11): New function to
	migrate SCAP database to version 11.
	(check_db_version): Add migration to version 11.
	(update_scap_db_private, update_scap_db): Add selective rebuild of OVAL
	data.

	* tools/openvas-scapdata-sync.in (db_migrate_11, check_db_version): See
	greenbone-scapdata-sync.
	(update_sec_db_private, update_sec_db): See update_scap_db_private,
	update_scap_db in greenbone-scapdata-sync.
	(do_refresh_private): Set variable REFRESH_PRIVATE_ONLY to 1.

	* tools/oval_update.xsl: Add insert of "status" data into SCAP database.

	* tools/scap_db_init.sql (meta): Set version to 11.
	(ovaldefs): Add column "status".

2013-03-11  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/sql.c (cleanup_iterator): Check iterator pointer before
	dereferencing it.

2013-03-11  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	Add search All SecInfo feature.

	* src/manage_sql (all_info_count, total_info_count)
	(init_all_info_iterator, all_info_iterator_type): New functions.
	(ALL_INFO_ITERATOR_FILTER_COLUMNS, ALL_INFO_UNION_COLUMNS): New define.
	(omp_xml_handle_end_element): Add allinfo handling in CLIENT_GET_INFO
	case.

	* src/manage.h: Add all_info_count, total_info_count,
	init_all_info_iterator and all_info_iterator_type headers.

2013-03-07  Matthew Mundell <matthew.mundell@greenbone.net>

	Move the observer checks for CREATE operations into the functions that
	do the operations.  This opens the way for controlling these permissions
	via the database.

	* src/manage_sql.c (user_may): New function.
	(copy_resource, create_alert, copy_alert, create_report, copy_task)
	(create_target, copy_target, create_config, create_config_rc)
	(copy_config, create_lsc_credential, create_agent, create_note)
	(create_override, create_report_format, copy_report_format, copy_group)
	(create_group, create_port_list, copy_port_list, modify_port_list)
	(create_port_range, create_filter): Add permission check.

	* src/omp.c (omp_xml_handle_end_element): Handle permission return in
	all CREATE commands.

2013-03-07  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* doc/user-scap-data-HOWTO: Slightly improved.

2013-03-06  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	* doc/user-scap-data-HOWTO: New file, documentation for user defined
	SCAP data.

2013-03-06  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	Add updating of user (OVAL) data to greenbone-scapdata-sync.

	* tools/greenbone-scapdata-sync (REFRESH_PRIVATE_ONLY): New variable.
	(list_oval_files_sortable, list_oval_files_sorted): Change to output
	only files with timestamps and use parameter for directory to search.
	(do_help): Add help for new --refresh-private option.
	(init_scap_db_update): New function to initialize database variables.
	(update_scap_db_private): New function to update user data.
	(update_scap_db): Change to support updating user data.
	(): Add command line option --refresh-private.

2013-03-06  Timo Pollmeier  <timo.pollmeier@greenbone.net>

	* tools/greenbone-scapdata-sync (sync_scapdata),
	tools/greenbone-certdata-sync (sync_certdata): Add --chmod=D+x option
	to rsync commands to fix problems with directories being created
	without +x permissions.

2013-03-06  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/schema_formats/XML/OMP.xml, doc/omp.html, doc/omp.rnc: Update
	documentation for various results related commands.

2013-03-06  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/manage_sql.c (update_nvt_cache): Set nvti tag.
	(result_iterator_nvt_tag): New function.

	* src/manage.h: Add result_iterator_nvt_tag header accordingly.

	* src/omp.c (buffer_results_xml): Send nvt tags.

2013-03-05  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/manage_sql.c (update_all_config_caches): Use definition for
	columns, so that the accessors will still work when the GET iterator
	gets more columns.

2013-03-05  Timo Pollmeier <timo.pollmeier@greenbone.net>

	Add functions to synchronize SCAP database with user defined OVAL
	repositories in private subdirectory.

	* CMakeLists.txt: Add oval_verify.xsl, ovaldef_list_ids.xsl.

	* tools/openvas-scapdata-sync.in (do_help): Add --refresh-private text.
	(init_sec_db_update): New function, contains database checks and
	variable inits from update_sec_db.
	(list_oval_files_sorted, list_oval_files_sortable): Change to search
	directory given as parameter instead of fixed directory and skip files
	without valid OVAL timestamp.
	(update_sec_db_private): New function to sync scap.db with user defined
	files. Currently supports validating, adding and removing OVAL
	definitions.
	(update_sec_db): Remove database checks and variable inits, call
	init_sec_db_update instead. Change handling of OVAL files list to new
	version of list_oval_files_sorted and print warnings for file without
	valid timestamps. Add call of update_sec_db_private near end.
	(do_refresh_private): New function to refresh user defined data only.
	(): New command line option --refresh-private.

	* tools/ovaldef_list_ids.xsl: New stylesheet to get a list of all IDs
	in an OVAL repository.

	* tools/oval_timestamp, tools/oval_update.xsl: Fix selection of
	timestamps failing when relevant elements contain extra whitespaces.

	* tools/oval_verify.xsl: New stylesheet for basic verification of OVAL
	repository files.

2013-03-04  Matthew Mundell <matthew.mundell@greenbone.net>

	Add basic user groups.

	* src/manage_sql.c (create_tables): Create groups tables.
	(find_group, copy_group, create_group, delete_group, group_uuid)
	(group_users, group_writable, trash_group_writable, group_in_use)
	(trash_group_in_use): New functions.
	(GROUP_ITERATOR_FILTER_COLUMNS, GROUP_ITERATOR_COLUMNS): New defines.
	(group_count, init_group_iterator): New functions.

	* src/manage.h: Add headers accordingly.
	(group_t): New type.

	* src/omp.c (omp_commands): Add group commands.
	(create_group_data_t, delete_group_data_t, get_groups_data_t): New
	types.
	(create_group_data_reset, delete_group_data_reset)
	(get_groups_data_reset: New functions.
	(command_data_t): Add group commands.
	(create_group_data, delete_group_data, get_groups_data): New variables.
	(client_state_t): Add group states.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text_element): Handle group commands.

2013-03-04  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* tools/greenbone-scapdata-sync (db_migrate_10): Fix sqlite3 call using
	an undefined database file name parameter.

2013-03-04  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* tools/greenbone-certdata-sync, tools/greenbone-scapdata-sync: Remove
	bashisms not supported by dash like [[ ... ]] and (( ... )) and change
	from #!/bin/bash to #!/bin/sh.

2013-03-01  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* tools/greenbone-certdata-sync (RSYNC_DELETE): Remove quotes causing
	exclude of private directory to be ignored.

	* tools/greenbone-scapdata-sync (RSYNC_DELETE): Remove quotes causing
	exclude of private directory to be ignored.
	(update_scap_db): Fix recalculation of max_cvss being performed even if
	no CVEs were updated.

2013-02-28  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	* src/otp.c (process_otp_scanner_input): Rename OTP message
	"PLUGINS_MD5" to "NVT_INFO".
	Rename internal SCANNER_PLUGINS_MD5 to SCANNER_NVT_INFO.

	* src/ompd.c (write_to_scanner): Update comment as MD5 does not play a
	role anymore.

2013-02-28  Andre Heinecke <andre.heinecke@greenbone.net>

	* report_formats/verinice-ism/gsm_verinice_ism.xsl,
	report_formats/verinice-ism/generate:
	Do not attach raw xml file of the report anymore

2013-02-28  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Post branch version bump.

	* CMakeLists.txt: Updated version number.

2013-02-27  Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>

	Remove unused functions.

	* src/manage.c (acknowledge_md5sum, acknowledge_md5sum_sums): Removed.

	* src/manage.h: Removed proto accordingly.

2013-02-27  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* src/manage.c (slave_setup, delete_slave_task): Delete slave resources
	(task, config, target, credentials) instead of moving them to trashcan.

2013-02-27  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (convert_to_newlines): Rewrite conversion routine to be more
	efficient with cleaner code.

2013-02-27  Timo Pollmeier <timo.pollmeier@greenbone.net>

	SCAP sync now updates max_cvss and most cve_refs of CPEs after updating
	CVEs to reduce number of time consuming queries for updating max_cvss.

	* tools/cve_update.xsl: Remove update of cve_refs and max_cvss.
	Columns are now updated by recount in sync shell scripts.

	* tools/greenbone-scapdata-sync (db_migrate_9): Change "sqlite3" to
	"$SQLITE3".
	(db_migrate_10, check_db_version): Add migration to version 10.
	(update_scap_db): Add recalculation of max_cvss and cve_refs after CVEs
	update.

	* tools/openvas-scapdata-sync.in (db_migrate_10, check_db_version):
	Add migration to version 10.
	(update_scap_db): Add recalculation of max_cvss and cve_refs after CVEs
	update.

	* tools/scap_db_init.sql (meta): Change version to 10.
	(affected_delete): Remove update of max_cvss. Replaced by recount in
	sync scripts.

2013-02-27  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* tools/greenbone-certdata-sync, tools/greenbone-scapdata-sync:
	Update version number.

2013-02-27  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* tools/greenbone-certdata-sync: New script to sync CERT data using
	the Greenbone feed.

2013-02-27  Timo Pollmeier <timo.pollmeier@greenbone.net>

	* tools/greenbone-scapdata-sync:
	Add PRIVATE_SUBDIR and private directory functionality to RSYNC_DELETE.

2013-02-27  Hani Benhabiles  <hani.benhabiles@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): Check return value for
	send_get_common() call in In CLIENT_GET_INFO case.

2013-02-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/report_formats/HTML/HTML.xsl (prognostic-description): New
	template.
	(result [issue]): For prognostic results, produce the description with
	prognostic-description so that the browser does paragraph wrapping.

2013-02-25  Matthew Mundell <matthew.mundell@greenbone.net>

	* src/omp.c (omp_xml_handle_end_element): In GET_REPORTS add checks
	for -2 filt_id to the asset and prognostic cases.

2013-02-25  Andre Heinecke <aheinecke@intevation.de>

	* report_formats/verinice-ism/create_report_import:
	Update version number to 1.1.7

2013-02-22  Michael Wiegand <michael.wiegand@greenbone.net>

	Post release version bump.

	* CMakeLists.txt: Updated version number to 4.0+beta6.

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.
	(database_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.
	(database_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.
	(database_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.
	(database_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.
	(database_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.
	(database_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.
	(database_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.
	(database_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.
	(database_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.
