Commit a6153453 authored by Sophie Brun's avatar Sophie Brun

Merge tag 'upstream/1.4.2' into kali/master

Upstream version 1.4.2
parents 6cd0b69c 0dac3831
openvas-cli 1.4.2 (2015-07-09)
This is the second maintenance release of the 1.4 version of the OpenVAS Command
Line Interface (CLI) for the Open Vulnerability Assessment System release 8
(OpenVAS-8).
Many thanks to everyone who has contributed to this release:
Benoît Allard and Michael Wiegand.
Main changes compared to 1.4.1:
* The timeout option (-t) is now supported by more actions in the Nagios plugin
check_omp.
* check_omp now exits with an exit code of NAGIOS_UNKNOWN instead of
NAGIOS_CRITICAL when a result could not be retrieved.
* The minimum required version of OpenVAS Libraries has been raised to 8.0.4.
openvas-cli 1.4.1 (2015-05-26)
This is the first maintenance release of the 1.4 version of the OpenVAS Command
Line Interface (CLI) for the Open Vulnerability Assessment System release 8
(OpenVAS-8).
Many thanks to everyone who has contributed to this release:
Matthew Mundell, Eero Volotinen, Jan-Oliver Wagner and Michael Wiegand.
Main changes compared to 1.4.0:
* The omp binary now supports the "--filter" parameter for report retrieval.
* The omp binary now supports the "--details" parameter for task retrieval.
* The check_omp binary now exits with NAGIOS_UNKNOWN instead of NAGIOS_CRITICAL
when a requested task could not be found.
openvas-cli 1.4.0 (2015-03-16)
This is the first release of the 1.4 version of the OpenVAS Command Line
......
......@@ -78,7 +78,7 @@ set (CPACK_PACKAGE_VERSION_MAJOR "1")
set (CPACK_PACKAGE_VERSION_MINOR "4")
# Use this scheme for stable releases:
set (CPACK_PACKAGE_VERSION_PATCH "0${SVN_REVISION}")
set (CPACK_PACKAGE_VERSION_PATCH "2${SVN_REVISION}")
set (CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
# Use this scheme for +betaN and +rcN releases:
#set (CPACK_PACKAGE_VERSION_PATCH "+beta1${SVN_REVISION}")
......@@ -154,7 +154,7 @@ message ("-- Install prefix: ${CMAKE_INSTALL_PREFIX}")
## list and throw an error, otherwise long install-cmake-install-cmake cycles
## might occur.
pkg_check_modules (LIBOPENVAS_OMP REQUIRED libopenvas_omp>=8.0.0)
pkg_check_modules (LIBOPENVAS_OMP REQUIRED libopenvas_omp>=8.0.4)
pkg_check_modules (LIBOPENVAS_BASE REQUIRED libopenvas_base>=8.0.0)
pkg_check_modules (LIBOPENVAS_MISC REQUIRED libopenvas_misc>=8.0.0)
pkg_check_modules (GNUTLS REQUIRED gnutls>=2.8)
......
2015-07-09 Michael Wiegand <michael.wiegand@greenbone.net>
Preparing the openvas-cli 1.4.2 release.
* CHANGES: Updated.
2015-06-04 Michael Wiegand <michael.wiegand@greenbone.net>
* omp/omp.c: Bump copyright years.
2015-06-03 Michael Wiegand <michael.wiegand@greenbone.net>
* nagios/check_omp.c: Bump copyright years.
2015-06-03 Benot Allard <benoit.allard@greenbone.net>
* nagios/check_omp.c (cmd_status_impl): Reduce the scope of the `trend`
variable.
2015-06-03 Michael Wiegand <michael.wiegand@greenbone.net>
* nagios/check_omp.c: Improve documentation of exit codes, explain why
check_omp uses exit codes differently than a Nagios plugin directly
monitoring a service.
(manager_open, filter_report, cmd_status_impl, main): Use
NAGIOS_UNKNOWN instead of NAGIOS_CRITICAL if the result could not be
retrieved to better differentiate between critical results and no
results.
(cmd_status_impl, main): Simplify usage of respond () to remove
duplicate usage of exit code defines.
2015-06-03 Michael Wiegand <michael.wiegand@greenbone.net>
Add support for handling timeouts while authenticating.
* nagios/check_omp.c (manager_open): Honor timeout option, handle
possible timeout return value. Add missing parameter to function
description.
2015-06-01 Michael Wiegand <michael.wiegand@greenbone.net>
Add support for handling timeouts while getting the list of tasks or
individual reports.
* nagios/check_omp.c (cmd_status_opts_t): Add timeout option.
(cmd_status_impl): Honor timeout option, handle possible timeout
return value.
(main): Merge ping timeout setting into new general timeout setting.
Keep "ping-timeout" as synonym for backward compatibility. Honor
timeout value for getting tasks and report, handle possible timeout
return values.
* CMakeLists.txt: Increase libopenvas_omp dependency to 8.0.4 for
timeout handling.
* INSTALL: Make consistent with CMakeLists.txt.
2015-05-26 Michael Wiegand <michael.wiegand@greenbone.net>
Post release version bump.
* CMakeLists.txt: Updated version to 1.4.2.
2015-05-26 Michael Wiegand <michael.wiegand@greenbone.net>
Preparing the openvas-cli 1.4.1 release.
* CHANGES: Updated.
2015-05-18 Michael Wiegand <michael.wiegand@greenbone.net>
* nagios/check_omp.c (cmd_status_impl): Exit with NAGIOS_UNKNOWN
instead of NAGIOS_CRITICAL when a task could not be found.
2015-04-20 Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>
* omp/omp.c (main): Add command line option "--details" which sets the
"details" element of "opts". Patch by Eero Volotinen.
2015-04-10 Matthew Mundell <matthew.mundell@greenbone.net>
* ChangeLog: Correct surname in last entry.
2015-04-10 Matthew Mundell <matthew.mundell@greenbone.net>
Add option --filter for option --get-reports. Based on patch by Eero
Volotinen.
* omp/omp.c (manage_get_reports): Add arg filter. Pass in OMP if given.
(main): Add option --filter.
2015-03-16 Michael Wiegand <michael.wiegand@greenbone.net>
Post release version bump.
* CMakeLists.txt: Updated version to 1.4.1.
2015-03-16 Michael Wiegand <michael.wiegand@greenbone.net>
Preparing the openvas-cli 1.4.0 release.
......@@ -47,7 +144,7 @@
and which task is seeked for (before it was linear search).
* nagios/check_omp.c (cmd_status_impl): Drop checking for the matching
name of the task because it is no guaranteed that there is a
name of the task because it is no guaranteed that there is a
task with the right name, or none at all.
(main): Extend the filter for tasks with the task name so that
later on the iteration over the list of tasks is much faster.
......
......@@ -12,7 +12,7 @@ Prerequisites:
* cmake
* glib-2.0
* gnutls (>= 2.8)
* openvas-libraries (>= 8.0.0)
* openvas-libraries (>= 8.0.4)
* pkg-config
Prerequisites for building documentation:
......
This diff is collapsed.
......@@ -7,7 +7,7 @@
* Michael Wiegand <michael.wiegand@greenbone.net>
*
* Copyright:
* Copyright (C) 2009, 2010 Greenbone Networks GmbH
* Copyright (C) 2009, 2010, 2015 Greenbone Networks GmbH
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -600,7 +600,7 @@ manager_get_omp_version (server_connection_t * connection, gchar ** version_str)
*/
static int
manager_get_reports (server_connection_t * connection, gchar ** report_ids,
gchar * format)
gchar * format, gchar * filter)
{
gchar *version = NULL;
gchar *default_format = NULL;
......@@ -633,8 +633,11 @@ manager_get_reports (server_connection_t * connection, gchar ** report_ids,
if (format == NULL || strcasecmp (format, default_format) == 0)
{
gchar *quoted_filter;
entity_t entity, report_xml;
quoted_filter = filter ? g_strescape (filter, "") : NULL;
if (openvas_server_sendf (&(connection->session),
"<get_reports"
" result_hosts_only=\"0\""
......@@ -642,16 +645,22 @@ manager_get_reports (server_connection_t * connection, gchar ** report_ids,
" sort_field=\"ROWID\""
" sort_order=\"1\""
" %s=\"%s\""
"%s%s%s"
" report_id=\"%s\"/>",
format_req_str,
format ? format :
default_format,
quoted_filter ? " filter=\"" : "",
quoted_filter ? quoted_filter : "",
quoted_filter ? "\"" : "",
*report_ids))
{
fprintf (stderr, "Failed to get report.\n");
manager_close (connection);
g_free (quoted_filter);
return -1;
}
g_free (quoted_filter);
if (read_entity (&connection->session, &entity)) {
fprintf (stderr, "Failed to get report.\n");
......@@ -672,22 +681,30 @@ manager_get_reports (server_connection_t * connection, gchar ** report_ids,
}
else
{
gchar *quoted_filter;
guchar *report = NULL;
gsize report_size = 0;
char first;
const char* status;
entity_t entity;
quoted_filter = filter ? g_markup_escape_text (filter, -1) : NULL;
if (openvas_server_sendf (&(connection->session),
"<get_reports %s=\"%s\" report_id=\"%s\"/>",
"<get_reports %s=\"%s\" report_id=\"%s\" %s%s%s/>",
format_req_str,
format,
*report_ids))
*report_ids,
quoted_filter ? " filter=\"" : "",
quoted_filter ? quoted_filter : "",
quoted_filter ? "\"" : ""))
{
g_free (quoted_filter);
fprintf (stderr, "Failed to get report.\n");
manager_close (connection);
return -1;
}
g_free (quoted_filter);
/* Read the response. */
......@@ -1018,6 +1035,10 @@ main (int argc, char **argv)
static gboolean file = FALSE;
/* Command start-task. */
static gboolean cmd_start_task = FALSE;
/* Filter string for get_reports */
static gchar *filter = NULL;
/* Command details */
static gboolean cmd_details = FALSE;
/* Command ping. */
static gboolean cmd_ping = FALSE;
static gint ping_timeout = DEFAULT_PING_TIMEOUT;
......@@ -1089,6 +1110,9 @@ main (int argc, char **argv)
{"format", 'f', 0, G_OPTION_ARG_STRING, &format,
"Format for get-report.",
"<format>"},
{"filter", 0, 0, G_OPTION_ARG_STRING, &filter,
"Filter string for get-report",
"<string>"},
/* Command get-tasks. */
{"get-tasks", 'G', 0, G_OPTION_ARG_NONE, &cmd_get_tasks,
"Get status of one, many or all tasks.", NULL},
......@@ -1122,6 +1146,9 @@ main (int argc, char **argv)
"Replace SENDFILE in xml with base64 of file.", "<file>"},
{G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &rest,
NULL, NULL},
/* Enable details */
{"details", 0, 0, G_OPTION_ARG_NONE, &cmd_details,
"Enable detailed view.", NULL},
{NULL}
};
......@@ -1153,7 +1180,7 @@ main (int argc, char **argv)
if (print_version)
{
printf ("OMP Command Line Interface %s\n", OPENVASCLI_VERSION);
printf ("Copyright (C) 2010-2013 Greenbone Networks GmbH\n");
printf ("Copyright (C) 2010-2015 Greenbone Networks GmbH\n");
printf ("License GPLv2+: GNU GPL version 2 or later\n");
printf
("This is free software: you are free to change and redistribute it.\n"
......@@ -1408,7 +1435,10 @@ main (int argc, char **argv)
omp_get_tasks_opts_t opts;
opts = omp_get_tasks_opts_defaults;
opts.details = 0;
if(cmd_details)
opts.details = 1;
else
opts.details = 0;
opts.filter = "permission=any owner=any rows=-1";
if (omp_get_tasks_ext (&(connection->session), opts, &status))
......@@ -1481,7 +1511,7 @@ main (int argc, char **argv)
if (manager_open (connection))
exit (EXIT_FAILURE);
exit_status = manager_get_reports (connection, report_ids, format);
exit_status = manager_get_reports (connection, report_ids, format, filter);
if (exit_status == 0)
manager_close (connection);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment