Commit 995a3c2e authored by Sophie Brun's avatar Sophie Brun

Imported Upstream version 1.4.0

parent da38ea58
openvas-cli 1.4.0 (2015-03-16)
This is the first 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:
Hani Benhabiles, Matthew Mundell, Jan-Oliver Wagner and Michael Wiegand.
Main changes compared to the 1.3 series:
* The openvas-libraries dependency has been raised to 8.0.0.
* Both omp and check_omp have been updated to use more appropriate filters.
* The Nagios plugin check_omp now uses a filter for task retrieval, resulting
in a performance gain.
* Support for choosing the certificates used for client authentication on the
command line has been added.
Main changes compared to 1.4+beta5:
* Support for choosing the certificates used for client authentication on the
command line has been added.
openvas-cli 1.4+beta5 (2015-01-12)
This is the fifth beta release of the 1.4 version of the OpenVAS Command Line
Interface (CLI) for the upcoming Open Vulnerability Assessment System release 8
(OpenVAS-8).
This release improves the task retrieval performance and simplifies command
line option parsing for the Nagios plugin check_omp. It also updates the
command line help for check_omp.
Many thanks to everyone who has contributed to this release:
Jan-Oliver Wagner and Michael Wiegand
Main changes compared to 1.4+beta4:
* The Nagios plugin check_omp now uses a filter for task retrieval, resulting
in a performance gain.
* Command line option parsing has been simplified for check_omp.
* The command line help for check_omp has been updated.
openvas-cli 1.4+beta4 (2014-11-24)
This is the fourth beta release of the 1.4 version of the OpenVAS Command Line
Interface (CLI) for the upcoming Open Vulnerability Assessment System release 8
(OpenVAS-8).
This release makes adjustments for the latest changes in OpenVAS Libraries and
updates the filters used in the omp and check_omp binaries.
Many thanks to everyone who has contributed to this release:
Hani Benhabiles and Matthew Mundell.
Main changes compared to 1.4+beta2:
* Both omp and check_omp have been updated to use more appropriate filters.
* The build process has been adjusted for changes in OpenVAS Libraries.
openvas-cli 1.4+beta3 (2014-10-14)
This is the third beta release of the 1.4 version of the OpenVAS Command Line
Interface (CLI) for the upcoming Open Vulnerability Assessment System release 8
(OpenVAS-8).
This release adds support checking the status of an OMP server ("OMP ping").
Many thanks to everyone who has contributed to this release:
Michael Wiegand.
Main changes compared to 1.4+beta2:
* Support for checking the status of an OMP server ("OMP ping") has been added.
openvas-cli 1.4+beta2 (2014-09-23)
This is the second beta release of the 1.4 version of the OpenVAS Command Line
Interface (CLI) for the upcoming Open Vulnerability Assessment System release 8
(OpenVAS-8).
This release fixes an issue which caused the omp binary to ignore arguments and
exit early under certain circumstances.
Many thanks to everyone who has contributed to this release:
Matthew Mundell.
Main changes compared to 1.4+beta1:
* An issue which caused the omp binary to ignore arguments and exit early under
certain circumstances has been fixed.
openvas-cli 1.4+beta1 (2014-09-05)
This is the first beta release of the 1.4 version of the OpenVAS Command Line
Interface (CLI) for the upcoming Open Vulnerability Assessment System release 8
(OpenVAS-8).
This release features a number of small adjustments to ensure OpenVAS CLI builds
with the OpenVAS Libraries of OpenVAS-8. It also add a new --send-file option to
the omp binary and removes the obsolete --rc option.
Many thanks to everyone who has contributed to this release:
Hani Benhabiles, Matthew Mundell, Jan-Oliver Wagner and Michael Wiegand.
Main changes compared to 1.3.0:
* The openvas-libraries dependency has been raised to 8.0.0.
* The obsolete --rc option for the omp binary has been removed.
* The --send-file option of the omp binary has been added.
* A number of small adjustments for compatibility with OpenVAS-8.
openvas-cli 1.3.0 (2014-04-10)
This is the 1.3.0 release of the OpenVAS Command Line Interface (CLI) for the
......
......@@ -8,10 +8,10 @@
# Copyright:
# Copyright (C) 2010 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 version 2,
# or, at your option, any later version as published by the Free
# Software Foundation
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
......@@ -75,7 +75,7 @@ set (CPACK_SOURCE_TOPLEVEL_TAG "")
set (CPACK_SYSTEM_NAME "")
set (CPACK_TOPLEVEL_TAG "")
set (CPACK_PACKAGE_VERSION_MAJOR "1")
set (CPACK_PACKAGE_VERSION_MINOR "3")
set (CPACK_PACKAGE_VERSION_MINOR "4")
# Use this scheme for stable releases:
set (CPACK_PACKAGE_VERSION_PATCH "0${SVN_REVISION}")
......@@ -154,7 +154,9 @@ message ("-- Install prefix: ${CMAKE_INSTALL_PREFIX}")
## list and throw an error, otherwise long install-cmake-install-cmake cycles
## might occur.
pkg_check_modules (LIBOPENVAS REQUIRED libopenvas>=7.0.0)
pkg_check_modules (LIBOPENVAS_OMP REQUIRED libopenvas_omp>=8.0.0)
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)
pkg_check_modules (GLIB REQUIRED glib-2.0)
......@@ -173,11 +175,23 @@ if (BUILD_STATIC_NAGIOS OR BUILD_STATIC_OMP)
OUTPUT_VARIABLE GNUTLS_LDFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND pkg-config --static --cflags libopenvas
OUTPUT_VARIABLE OPENVAS_CFLAGS
execute_process (COMMAND pkg-config --static --cflags libopenvas_omp
OUTPUT_VARIABLE OPENVAS_OMP_CFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND pkg-config --static --libs libopenvas
OUTPUT_VARIABLE OPENVAS_LDFLAGS
execute_process (COMMAND pkg-config --static --libs libopenvas_omp
OUTPUT_VARIABLE OPENVAS_OMP_LDFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND pkg-config --static --cflags libopenvas_misc
OUTPUT_VARIABLE OPENVAS_MISC_CFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND pkg-config --static --libs libopenvas_misc
OUTPUT_VARIABLE OPENVAS_MISC_LDFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND pkg-config --static --cflags libopenvas_base
OUTPUT_VARIABLE OPENVAS_BASE_CFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND pkg-config --static --libs libopenvas_base
OUTPUT_VARIABLE OPENVAS_BASE_LDFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
else (BUILD_STATIC_NAGIOS OR BUILD_STATIC_OMP)
execute_process (COMMAND pkg-config --cflags gnutls
......@@ -187,14 +201,28 @@ else (BUILD_STATIC_NAGIOS OR BUILD_STATIC_OMP)
OUTPUT_VARIABLE GNUTLS_LDFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND pkg-config --cflags libopenvas
OUTPUT_VARIABLE OPENVAS_CFLAGS
execute_process (COMMAND pkg-config --cflags libopenvas_omp
OUTPUT_VARIABLE OPENVAS_OMP_CFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND pkg-config --libs libopenvas_omp
OUTPUT_VARIABLE OPENVAS_OMP_LDFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND pkg-config --cflags libopenvas_misc
OUTPUT_VARIABLE OPENVAS_MISC_CFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND pkg-config --libs libopenvas_misc
OUTPUT_VARIABLE OPENVAS_MISC_LDFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND pkg-config --cflags libopenvas_base
OUTPUT_VARIABLE OPENVAS_BASE_CFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND pkg-config --libs libopenvas
OUTPUT_VARIABLE OPENVAS_LDFLAGS
execute_process (COMMAND pkg-config --libs libopenvas_base
OUTPUT_VARIABLE OPENVAS_BASE_LDFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif (BUILD_STATIC_NAGIOS OR BUILD_STATIC_OMP)
set (OPENVAS_CFLAGS "${OPENVAS_OMP_CFLAGS} ${OPENVAS_MISC_CFLAGS} ${OPENVAS_BASE_CFLAGS}")
set (OPENVAS_LDFLAGS "${OPENVAS_OMP_LDFLAGS} ${OPENVAS_MISC_LDFLAGS} ${OPENVAS_BASE_LDFLAGS}")
## Version
string (REPLACE "
......
2015-03-16 Michael Wiegand <michael.wiegand@greenbone.net>
Preparing the openvas-cli 1.4.0 release.
* CHANGES: Updated.
* CMakeLists.txt: Switch version scheme.
2015-01-29 Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>
* omp/omp.c (server_connection_t): Added elements client_cert_path,
client_key_path and client_ca_cert_path.
(manager_open): Use the new path elements of the connection object
instead of default values.
(main): Add and handle the new command line options "--client-cert",
"--client-key" and "-client-ca-cert".
2015-01-12 Michael Wiegand <michael.wiegand@greenbone.net>
Post release version bump.
* CMakeLists.txt: Updated version to 1.4+beta6.
2015-01-12 Michael Wiegand <michael.wiegand@greenbone.net>
Preparing the openvas-cli 1.4+beta5 release.
* CHANGES: Updated.
2014-12-09 Michael Wiegand <michael.wiegand@greenbone.net>
* nagios/check_omp.c: Document reason for include of stdlib.h.
(main): Use integer directly for manager port as well, removing the
need to the last remaining atoi () call.
2014-12-09 Michael Wiegand <michael.wiegand@greenbone.net>
* nagios/check_omp.c (main): Make it clear in command line help and
variable naming that "timeout" only refers to OMP pings. Parse timeout
to a gint directly.
2014-11-27 Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>
Apply the task name as a direct filter element for getting the tasks
in order to speed up the routine. Single measurements showed a speed
up of about 10%, but can vary depending on the number of tasks
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
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.
2014-11-24 Michael Wiegand <michael.wiegand@greenbone.net>
Post release version bump.
* CMakeLists.txt: Updated version to 1.4+beta5.
2014-11-24 Michael Wiegand <michael.wiegand@greenbone.net>
Preparing the openvas-cli 1.4+beta4 release.
* CHANGES: Updated.
2014-11-17 Hani Benhabiles <hani.benhabiles@greenbone.net>
* CMakeLists.txt: Check for and link against libopenvas_omp,
libopenvas_misc and libopenvas_base libraries instead of the whole
libopenvas package.
2014-10-23 Matthew Mundell <matthew.mundell@greenbone.net>
* omp/omp.c (main): Request all rows in filter, otherwise "Rows Per
Page" is used.
* nagios/check_omp.c (main): Request all rows in filter, otherwise "Rows
Per Page" is used.
2014-10-15 Matthew Mundell <matthew.mundell@greenbone.net>
* omp/omp.c (main): Use "filter" to include observed tasks, instead of
"actions".
2014-10-14 Michael Wiegand <michael.wiegand@greenbone.net>
Post release version bump.
* CMakeLists.txt: Updated version to 1.4+beta4.
2014-10-14 Michael Wiegand <michael.wiegand@greenbone.net>
Preparing the openvas-cli 1.4+beta3 release.
* CHANGES: Updated. Fixed dates of previous releases.
2014-10-02 Michael Wiegand <michael.wiegand@greenbone.net>
* nagios/check_omp.c (main): Check correct variable.
2014-10-02 Michael Wiegand <michael.wiegand@greenbone.net>
* omp/omp.c (main): Remove stray quote in command line help.
2014-10-02 Michael Wiegand <michael.wiegand@greenbone.net>
Add OMP ping support to OMP command line interface, in parts taken
from the ping functionality in nagios/check_omp.c implemented by
Werner Koch.
* omp/omp.c: Define default ping timeout.
(server_connection_t): Add timeout element.
(manager_open): Only try to authenticate if credentials are supplied.
(main): Handle new command line options for ping command and timeout.
Do not request password when requested to ping or get the OMP version
as this can be done unauthenticated.
2014-09-23 Michael Wiegand <michael.wiegand@greenbone.net>
Post release version bump.
* CMakeLists.txt: Updated version to 1.4+beta3.
2014-09-23 Michael Wiegand <michael.wiegand@greenbone.net>
Preparing the openvas-cli 1.4+beta2 release.
* CHANGES: Updated.
2014-09-15 Matthew Mundell <matthew.mundell@greenbone.net>
* omp/omp.c (main): Move exit into /? case, otherwise program exits
early whenever there is a plain argument, like for "--get-task <uuid>".
2014-09-05 Michael Wiegand <michael.wiegand@greenbone.net>
Post release version bump.
* CMakeLists.txt: Updated version to 1.4+beta2.
2014-09-05 Michael Wiegand <michael.wiegand@greenbone.net>
Preparing the openvas-cli 1.4+beta1 release.
* CHANGES: Updated.
* CMakeLists.txt: Set version to 1.4+beta1. Switch version scheme.
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 Michael Wiegand <michael.wiegand@greenbone.net>
* CMakeLists.txt, dialog/CMakeLists.txt, doc/omp.8.xml,
nagios/check_omp.c, nagios/CMakeLists.txt, omp/CMakeLists.txt,
omp/omp.c: Ensure the GPLv2+ license notice uses the paragraph
suggested by the Free Software Foundation.
2014-08-29 Hani Benhabiles <hani.benhabiles@greenbone.net>
* omp/omp.c (manager_open): Adjust openvas_server_open_with_cert() call
by providing certificates values instead of cert files paths.
(main): Handle manager_open() return value.
2014-08-07 Michael Wiegand <michael.wiegand@greenbone.net>
Update man page, regenerated in other formats.
* doc/omp.8.xml: Updated to match latest changes.
* doc/omp.html, doc/omp.8: Regenerated.
2014-08-07 Michael Wiegand <michael.wiegand@greenbone.net>
Belated post branch version bump.
* CMakeLists.txt: Updated version to 1.4.0. Bump openvas-libraries
dependency to >= 8.0.0.
* INSTALL: Update minimum version for openvas-libraries dependency.
2014-08-04 Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>
* omp/omp.c (main): Fixing call of openvas_server_sendf.
2014-08-04 Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>
* omp/omp.c (manager_get_omp_version, manager_get_report_formats, main):
Use openvas_server_sendf instead of openvas_server_send, which is to be
removed eventually.
2014-07-15 Matthew Mundell <matthew.mundell@greenbone.net>
* nagios/check_omp.c (main): Use "filter" to include observed tasks,
instead of "actions"
2014-06-12 Hani Benhabiles <hani.benhabiles@greenbone.net>
* omp/omp.c (get_file_base64): Remove funciton.
(replace_send_file_xml): Call openvas_file_as_base64().
2014-06-11 Matthew Mundell <matthew.mundell@greenbone.net>
* omp/omp.c (main): Remove --rc/-r option. Remove rcfile option setup.
* nagios/check_omp.c (filter_report): Init variable to quiet compiler.
(main): Remove rcfile option setup.
2014-04-16 Hani Benhabiles <hani.benhabiles@greenbone.net>
Add --send-file option to omp cli.
* doc/omp.8: Update documentation for new option.
* omp/omp.c (get_file_base64, replace_send_file_xml): New functions.
(main): Add --send-file option that replaces the first occurence of
SENDFILE string in xml with the base64 encoded content of the provided
file.
2014-04-10 Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>
Post release version bump.
* CMakeLists.txt: Updated version to 1.3.1.
2014-04-10 Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>
Preparing the openvas-cli 1.3.0 release.
......
......@@ -12,7 +12,7 @@ Prerequisites:
* cmake
* glib-2.0
* gnutls (>= 2.8)
* openvas-libraries (>= 7.0.0)
* openvas-libraries (>= 8.0.0)
* pkg-config
Prerequisites for building documentation:
......
......@@ -8,10 +8,10 @@
# Copyright:
# Copyright (C) 2012 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 version 2,
# or, at your option, any later version as published by the Free
# Software Foundation
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
......
......@@ -8,15 +8,15 @@
# Copyright:
# Copyright (C) 2009,2010 Greenbone Networks GmbH
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
......
......@@ -25,6 +25,9 @@ Use the password PASSWORD to access the OpenVAS Manager. If the password is not
\fB--config-file=\fIFILE\fB\f1
Use the information provided in FILE as parameters for the connection to the OpenVAS Manager.
.TP
\fB--send-file=\fIFILE\fB\f1
Replace SENDFILE in xml string to send with base64 encoded content of FILE. Only the first occurence is replaced.
.TP
\fB-P, --prompt\f1
Prompt to exit.
.TP
......@@ -43,9 +46,6 @@ Use COMMENT as the comment for the newly created task.
\fB-t, --target=\fITARGET\fB\f1
Use TARGET as the target for the newly created task.
.TP
\fB-r, --rc\f1
Create task with RC read from stdin.
.TP
\fB--file\f1
Add text in stdin as file on task..
.TP
......
......@@ -13,10 +13,10 @@
Copyright:
Copyright (C) 2011 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 version 2,
or, at your option, any later version as published by the Free
Software Foundation
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
......@@ -93,6 +93,16 @@
</optdesc>
</option>
<option>
<p><opt>--send-file=<arg>FILE</arg></opt></p>
<optdesc>
<p>
Replace SENDFILE in xml string to send with base64 encoded content of FILE.
Only the first occurence is replaced.
</p>
</optdesc>
</option>
<option>
<p><opt>-P, --prompt</opt></p>
<optdesc>
......@@ -135,13 +145,6 @@
</optdesc>
</option>
<option>
<p><opt>-r, --rc</opt></p>
<optdesc>
<p>Create task with RC read from stdin.</p>
</optdesc>
</option>
<option>
<p><opt>--file</opt></p>
<optdesc>
......
......@@ -73,6 +73,16 @@
<p><b>--send-file=<em>FILE</em></b></p>
<p>
Replace SENDFILE in xml string to send with base64 encoded content of FILE.
Only the first occurence is replaced.
</p>
<p><b>-P, --prompt</b></p>
<p>Prompt to exit.</p>
......@@ -115,13 +125,6 @@
<p><b>-r, --rc</b></p>
<p>Create task with RC read from stdin.</p>
<p><b>--file</b></p>
<p>Add text in stdin as file on task..</p>
......
......@@ -8,10 +8,10 @@
# Copyright:
# Copyright (C) 2009, 2010 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 version 2,
# or, at your option, any later version as published by the Free
# Software Foundation
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
......
......@@ -11,10 +11,10 @@
* Copyright:
* Copyright (C) 2009, 2010, 2012 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 version 2,
* or, at your option, any later version as published by the Free
* Software Foundation
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
......@@ -52,7 +52,7 @@
#include <glib.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h> /* for exit() */
#include <string.h>
#include <stdarg.h>
......@@ -384,6 +384,14 @@ filter_report (entity_t report, const char *host_filter,
low_dfn_ids = g_ptr_array_new ();
log_dfn_ids = g_ptr_array_new ();
}
else
{
/* Init to quiet compiler. */
high_oids = medium_oids = low_oids = log_oids = NULL;
high_names = medium_names = low_names = log_names = NULL;
high_descriptions = medium_descriptions = NULL;
low_descriptions = log_descriptions = NULL;
}
elems = results->entities;
while ((elem = first_entity (elems)))
......@@ -783,7 +791,10 @@ filter_report (entity_t report, const char *host_filter,
/* If host_filter is not NULL, mode must be STATUS_BY_LAST_REPORT and
host_filter is a string specifying for which IP the last results
are returned. */
are returned.
It is assumed that the "tasks" only contains a single task with the
name "task_filter" or no task at all.
*/
static int
cmd_status_impl (server_connection_t * connection, const char *task_filter,
entities_t tasks, int mode, char *host_filter,
......@@ -795,18 +806,7 @@ cmd_status_impl (server_connection_t * connection, const char *task_filter,
if (strcmp (entity_name (task), "task") == 0)
{
entity_t entity, report;
const char *name, *trend;
entity = entity_child (task, "name");
if (entity == NULL)
{
return respond (NAGIOS_CRITICAL, "Failed to parse task name.\n");
}
name = entity_text (entity);
/* Seeking to the right task... */
if (strcmp (task_filter, name))
goto skip_one_status_impl;
const char *trend;
/* FIXME: Check status (Done vs Requested) */
......@@ -887,7 +887,6 @@ cmd_status_impl (server_connection_t * connection, const char *task_filter,
/* Never reached. */
return respond (NAGIOS_UNKNOWN, "Internal error\n");
}
skip_one_status_impl:
tasks = next_entities (tasks);
}
......@@ -908,12 +907,12 @@ main (int argc, char **argv)
static gboolean print_version = FALSE;
static gboolean be_verbose = FALSE;
static gchar *manager_host_string = NULL;
static gchar *manager_port_string = NULL;
static gchar *manager_timeout_string = NULL;
static gint manager_port = OPENVASMD_PORT;
static gchar *omp_username = NULL;
static gchar *omp_password = NULL;
/* Command get-omp-version. */
static gboolean cmd_ping = FALSE;
static gint ping_timeout = DEFAULT_SOCKET_TIMEOUT;
static gboolean cmd_status = FALSE;
static gboolean status_trend = FALSE;
static gboolean status_last_report = FALSE;
......@@ -937,11 +936,8 @@ main (int argc, char **argv)
/* Global options. */
{"host", 'H', 0, G_OPTION_ARG_STRING, &manager_host_string,
"Connect to manager on host <host>", "<host>"},
{"port", 'p', 0, G_OPTION_ARG_STRING, &manager_port_string,
{"port", 'p', 0, G_OPTION_ARG_INT, &manager_port,
"Use port number <number>", "<number>"},
// FIXME!!!
{"timeout", 't', 0, G_OPTION_ARG_STRING, &manager_timeout_string,
"Use timeout <number>", "<number>"},
{"version", 'V', 0, G_OPTION_ARG_NONE, &print_version,
"Print version.", NULL},
{"verbose", 'v', 0, G_OPTION_ARG_NONE, &be_verbose,
......@@ -954,6 +950,8 @@ main (int argc, char **argv)
"OMP password", "<password>"},
{"ping", 'O', 0, G_OPTION_ARG_NONE, &cmd_ping,
"Ping the manager", NULL},
{"ping-timeout", 't', 0, G_OPTION_ARG_INT, &ping_timeout,
"Wait <seconds> for ping reply (0 disables timeout)", "<seconds>"},
{"status", 0, 0, G_OPTION_ARG_NONE, &cmd_status,
"Report status of task", NULL},
{"trend", 0, 0, G_OPTION_ARG_NONE, &status_trend,
......@@ -1048,35 +1046,29 @@ main (int argc, char **argv)
else
connection->host_string = OPENVASMD_ADDRESS;
if (manager_port_string != NULL)
connection->port = atoi (manager_port_string);
else
connection->port = OPENVASMD_PORT;
if (connection->port <= 0 || connection->port >= 65536)
if (manager_port <= 0 || manager_port >= 65536)
{
respond (NAGIOS_UNKNOWN,
"Manager port must be a number between 0 and 65536.\n");
do_exit (NAGIOS_UNKNOWN);
}
connection->port = manager_port;
if (omp_username != NULL)
connection->username = omp_username;
if (omp_password != NULL)
connection->password = omp_password;
if (manager_timeout_string != NULL)
connection->timeout = atoi (manager_timeout_string);
else
connection->timeout = DEFAULT_SOCKET_TIMEOUT;
if (connection->port < 0)
if (ping_timeout < 0)
{
respond (NAGIOS_UNKNOWN,
"Request timeout must be a non-negative number.\n");
"Ping timeout must be a non-negative number.\n");
do_exit (NAGIOS_UNKNOWN);
}
connection->timeout = ping_timeout;
if (be_verbose)
{
/** @todo Other modules ship with log level set to warning. */
......@@ -1134,8 +1126,8 @@ main (int argc, char **argv)
opts = omp_get_tasks_opts_defaults;
opts.details = 1;
opts.rcfile = 0;
opts.actions = "g";
/* TODO: Needs to be free'd at some point */
opts.filter = g_strdup_printf ("permission=any owner=any rows=1 name=\"%s\"", task_string);
if (display_descriptions)
display_oids = TRUE;
......
......@@ -8,10 +8,10 @@
# Copyright:
# Copyright (C) 2009, 2010 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 version 2,
# or, at your option, any later version as published by the Free
# Software Foundation
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License