Skip to content

Commit

Permalink
Merge branch 'master' of github.com:greenbone/gvmd into license-gmp
Browse files Browse the repository at this point in the history
  • Loading branch information
timopollmeier committed Aug 26, 2021
2 parents 358cea3 + 10c0c55 commit 4081b7b
Show file tree
Hide file tree
Showing 16 changed files with 131 additions and 306 deletions.
46 changes: 39 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,26 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Removed OVAL definitions from gvmd [#1525](https://github.com/greenbone/gvmd/pull/1525)
- Removed OVAL definitions from GMP and gvmd documentation [1551](https://github.com/greenbone/gvmd/pull/1551)
- Removed the Business Process Map from gvmd [1627](https://github.com/greenbone/gvmd/pull/1627)
- Removed ifaces element from users [#1676](https://github.com/greenbone/gvmd/pull/1676)

[Unreleased]: https://github.com/greenbone/gvmd/compare/gvmd-21.04...master

## [21.4.3] (Unreleased)
## [21.4.4] (unreleased)
### Added
### Changed
### Deprecated
### Removed
### Fixed

[Unreleased]: https://github.com/greenbone/gvmd/compare/v21.4.3...HEAD


## [21.4.3] - 2021-08-03
### Fixed
- Fix sending prefs for whole, growing VT families [#1603](https://github.com/greenbone/gvmd/pull/1603)
- Add trash columns for target "elevate" credential [#1636](https://github.com/greenbone/gvmd/pull/1636)

[Unreleased]: https://github.com/greenbone/gvmd/compare/v21.4.2...gvmd-21.04
[21.4.3]: https://github.com/greenbone/gvmd/compare/v21.4.2...gvmd-21.04

## [21.4.2] - 2021-06-28
### Fixed
Expand Down Expand Up @@ -116,24 +123,49 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

[21.4.0]: https://github.com/greenbone/gvmd/compare/gvmd-20.08...v21.4.0

## [20.8.3] (Unreleased)
## [20.8.4] - Unreleased
### Added
### Changed
* Changed defaults for installation locations [#1662](https://github.com/greenbone/gvmd/pull/1662) [#1665](https://github.com/greenbone/gvmd/pull/1665)
* SYSCONFDIR is /etc by default now
* LOCALSTATEDIR is /var by default now
* GVM_RUN_DIR is /run/gvm by default now
* OPENVAS_DEFAULT_SOCKET is /run/ospd/ospd-openvas.sock by default now
* SYSTEMD_SERVICE_DIR is /lib/systemd/system by default now
* Removed gvmd.default file and adjusted gvmd.service file accordingly
* GVM_FEED_LOCK_PATH is /var/lib/gvm/feed-update.lock by default now

### Deprecated
### Removed
* Remove BID from GMP documentation [#1673](https://github.com/greenbone/gvmd/pull/1673)

### Fixed

[20.8.4]: https://github.com/greenbone/gvmd/compare/v20.8.3...gvmd-20.08


## [20.8.3] - 2021-08-03

### Added
- Add --optimize add-/cleanup-feed-permissions [#1612](https://github.com/greenbone/gvmd/pull/1612)

### Changed
- Use less report cache SQL when adding results [#1618](https://github.com/greenbone/gvmd/pull/1618)

### Deprecated
### Removed
### Fixed
- Solved a performance problem when filtering results by tags [#1579](https://github.com/greenbone/gvmd/pull/1579)
- Fix VTs hash check and add --dump-vt-verification [#1611](https://github.com/greenbone/gvmd/pull/1611) [#1629](https://github.com/greenbone/gvmd/pull/1629) [#1643](https://github.com/greenbone/gvmd/pull/1643)
- Fix VTs hash check and add --dump-vt-verification
[#1611](https://github.com/greenbone/gvmd/pull/1611)
[#1629](https://github.com/greenbone/gvmd/pull/1629)
[#1641](https://github.com/greenbone/gvmd/pull/1651)
[#1643](https://github.com/greenbone/gvmd/pull/1643)
[#1655](https://github.com/greenbone/gvmd/pull/1655)
- Fix memory errors in modify_permission [#1613](https://github.com/greenbone/gvmd/pull/1613)
- Fix sensor connection for performance reports on failure [#1633](https://github.com/greenbone/gvmd/pull/1633)
- Sort the "host" column by IPv4 address if possible [#1637](https://github.com/greenbone/gvmd/pull/1637)
- Fix for parse_iso_time_tz error with musl library [#1644](https://github.com/greenbone/gvmd/pull/1644)

[Unreleased]: https://github.com/greenbone/gvmd/compare/v20.8.2...gvmd-20.08
[20.8.3]: https://github.com/greenbone/gvmd/compare/v20.8.2...gvmd-20.08

## [20.8.2] - 2021-06-23

Expand Down
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ include (CPack)

## Variables

set (GVMD_DATABASE_VERSION 246)
set (GVMD_DATABASE_VERSION 247)

set (GVMD_SCAP_DATABASE_VERSION 19)

Expand All @@ -110,7 +110,7 @@ if (SYSCONF_INSTALL_DIR)
endif (SYSCONF_INSTALL_DIR)

if (NOT SYSCONFDIR)
set (SYSCONFDIR "${CMAKE_INSTALL_PREFIX}/etc")
set (SYSCONFDIR "/etc")
endif (NOT SYSCONFDIR)

if (NOT EXEC_PREFIX)
Expand All @@ -130,7 +130,7 @@ if (NOT LIBDIR)
endif (NOT LIBDIR)

if (NOT LOCALSTATEDIR)
set (LOCALSTATEDIR "${CMAKE_INSTALL_PREFIX}/var")
set (LOCALSTATEDIR "/var")
endif (NOT LOCALSTATEDIR)

if (NOT DATADIR)
Expand Down Expand Up @@ -181,16 +181,16 @@ set (GVM_CLIENT_KEY "${GVM_STATE_DIR}/private/CA/clientkey.pem")
set (GVM_CA_CERTIFICATE "${GVM_STATE_DIR}/CA/cacert.pem")

if (NOT GVM_RUN_DIR)
set (GVM_RUN_DIR "${LOCALSTATEDIR}/run")
set (GVM_RUN_DIR "/run/gvm")
endif (NOT GVM_RUN_DIR)

if (NOT GVM_FEED_LOCK_PATH)
set (GVM_FEED_LOCK_PATH "${GVM_RUN_DIR}/feed-update.lock")
set (GVM_FEED_LOCK_PATH "${GVM_STATE_DIR}/feed-update.lock")
endif (NOT GVM_FEED_LOCK_PATH)
add_definitions (-DGVM_FEED_LOCK_PATH="${GVM_FEED_LOCK_PATH}")

if (NOT OPENVAS_DEFAULT_SOCKET)
set (OPENVAS_DEFAULT_SOCKET "/var/run/ospd/ospd.sock")
set (OPENVAS_DEFAULT_SOCKET "/run/ospd/ospd-openvas.sock")
endif (NOT OPENVAS_DEFAULT_SOCKET)
add_definitions (-DOPENVAS_DEFAULT_SOCKET="${OPENVAS_DEFAULT_SOCKET}")

Expand Down
12 changes: 2 additions & 10 deletions config/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,18 @@


if (NOT SYSTEMD_SERVICE_DIR)
set (SYSTEMD_SERVICE_DIR "${CMAKE_INSTALL_PREFIX}/lib/systemd/system")
set (SYSTEMD_SERVICE_DIR "/lib/systemd/system")
endif (NOT SYSTEMD_SERVICE_DIR)

if (NOT DEFAULT_CONFIG_DIR)
set (DEFAULT_CONFIG_DIR "${CMAKE_INSTALL_PREFIX}/etc/default")
endif (NOT DEFAULT_CONFIG_DIR)

if (NOT LOGROTATE_DIR)
set (LOGROTATE_DIR "${CMAKE_INSTALL_PREFIX}/etc/logrotate.d")
set (LOGROTATE_DIR "${SYSCONFDIR}/logrotate.d")
endif (NOT LOGROTATE_DIR)

configure_file (gvmd.service.in gvmd.service)
configure_file (gvmd.logrotate.in gvmd.logrotate)
configure_file (gvmd.default.in gvmd.default)

install (FILES ${CMAKE_CURRENT_BINARY_DIR}/gvmd.service
DESTINATION ${SYSTEMD_SERVICE_DIR}/)

install (FILES ${CMAKE_CURRENT_BINARY_DIR}/gvmd.default
DESTINATION ${DEFAULT_CONFIG_DIR}/ RENAME gvmd)

install (FILES ${CMAKE_CURRENT_BINARY_DIR}/gvmd.logrotate
DESTINATION ${LOGROTATE_DIR}/ RENAME gvmd)
19 changes: 0 additions & 19 deletions config/gvmd.default.in

This file was deleted.

8 changes: 5 additions & 3 deletions config/gvmd.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ ConditionKernelCommandLine=!recovery

[Service]
Type=forking
User=$GVMD_USER
Group=$GVMD_GROUP
User=gvm
Group=gvm
PIDFile=${GVM_RUN_DIR}/gvmd.pid
RuntimeDirectory=gvm
RuntimeDirectoryMode=2775
EnvironmentFile=${DEFAULT_CONFIG_DIR}/gvmd
ExecStart=${SBINDIR}/gvmd --osp-vt-update=$OSP_VT_UPDATE $OPTIONS
ExecStart=${SBINDIR}/gvmd --osp-vt-update=/run/ospd/ospd-openvas.sock --listen-group=gvm
Restart=always
TimeoutStopSec=10

Expand Down
2 changes: 1 addition & 1 deletion doc/gvmd.8
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ Verify scanner SCANNER-UUID and exit.
Print version and exit.
.TP
\fB--vt-verification-collation=\fICOLLATION\fB\f1
Set collation for VT verification to COLLATION, leave empty to choose automatically. Should be 'ucs_default' if DB uses UTF-8 or 'C' for single-byte encodings.
Set collation for VT verification to COLLATION, omit or leave empty to choose automatically. Should be 'ucs_default' if DB uses UTF-8 or 'C' for single-byte encodings.
.SH SIGNALS
SIGHUP causes gvmd to rebuild the database with information from the Scanner (openvas).
.SH EXAMPLES
Expand Down
2 changes: 1 addition & 1 deletion doc/gvmd.8.xml
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<p><opt>--vt-verification-collation=<arg>COLLATION</arg></opt></p>
<optdesc>
<p>
Set collation for VT verification to COLLATION, leave empty
Set collation for VT verification to COLLATION, omit or leave empty
to choose automatically. Should be 'ucs_default' if DB uses UTF-8
or 'C' for single-byte encodings.
</p>
Expand Down
2 changes: 1 addition & 1 deletion doc/gvmd.html
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ <h2>Options</h2>
<p><b>--vt-verification-collation=<em>COLLATION</em></b></p>

<p>
Set collation for VT verification to COLLATION, leave empty
Set collation for VT verification to COLLATION, omit or leave empty
to choose automatically. Should be 'ucs_default' if DB uses UTF-8
or 'C' for single-byte encodings.
</p>
Expand Down
53 changes: 2 additions & 51 deletions src/gmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1085,8 +1085,6 @@ typedef struct
array_t *groups; ///< IDs of groups.
char *hosts; ///< Hosts.
int hosts_allow; ///< Whether hosts are allowed.
char *ifaces; ///< Interfaces.
int ifaces_allow; ///< Whether interfaces are allowed.
char *name; ///< User name.
char *password; ///< Password.
char *comment; ///< Comment.
Expand All @@ -1109,7 +1107,6 @@ create_user_data_reset (create_user_data_t * data)
g_free (data->password);
g_free (data->comment);
g_free (data->hosts);
g_free (data->ifaces);
array_free (data->roles);
if (data->sources)
{
Expand Down Expand Up @@ -3022,8 +3019,6 @@ typedef struct
array_t *groups; ///< IDs of groups.
gchar *hosts; ///< Hosts.
int hosts_allow; ///< Whether hosts are allowed.
char *ifaces; ///< Interfaces.
int ifaces_allow; ///< Whether interfaces are allowed.
gboolean modify_password; ///< Whether to modify password.
gchar *name; ///< User name.
gchar *new_name; ///< New user name.
Expand All @@ -3050,7 +3045,6 @@ modify_user_data_reset (modify_user_data_t * data)
g_free (data->password);
g_free (data->comment);
g_free (data->hosts);
g_free (data->ifaces);
array_free (data->roles);
if (data->sources)
{
Expand Down Expand Up @@ -4295,7 +4289,6 @@ typedef enum
CLIENT_CREATE_USER_GROUPS,
CLIENT_CREATE_USER_GROUPS_GROUP,
CLIENT_CREATE_USER_HOSTS,
CLIENT_CREATE_USER_IFACES,
CLIENT_CREATE_USER_NAME,
CLIENT_CREATE_USER_PASSWORD,
CLIENT_CREATE_USER_ROLE,
Expand Down Expand Up @@ -4523,7 +4516,6 @@ typedef enum
CLIENT_MODIFY_USER_GROUPS,
CLIENT_MODIFY_USER_GROUPS_GROUP,
CLIENT_MODIFY_USER_HOSTS,
CLIENT_MODIFY_USER_IFACES,
CLIENT_MODIFY_USER_NAME,
CLIENT_MODIFY_USER_NEW_NAME,
CLIENT_MODIFY_USER_PASSWORD,
Expand Down Expand Up @@ -4829,7 +4821,6 @@ gmp_xml_handle_start_element (/* unused */ GMarkupParseContext* context,
create_user_data->groups = make_array ();
create_user_data->roles = make_array ();
create_user_data->hosts_allow = 0;
create_user_data->ifaces_allow = 0;
}
else if (strcasecmp ("DELETE_ASSET", element_name) == 0)
{
Expand Down Expand Up @@ -6716,17 +6707,6 @@ gmp_xml_handle_start_element (/* unused */ GMarkupParseContext* context,
gvm_append_string (&modify_user_data->hosts, "");
set_client_state (CLIENT_MODIFY_USER_HOSTS);
}
else if (strcasecmp ("IFACES", element_name) == 0)
{
const gchar *attribute;
if (find_attribute
(attribute_names, attribute_values, "allow", &attribute))
modify_user_data->ifaces_allow = strcmp (attribute, "0");
else
modify_user_data->ifaces_allow = 1;
gvm_append_string (&modify_user_data->ifaces, "");
set_client_state (CLIENT_MODIFY_USER_IFACES);
}
else if (strcasecmp ("NAME", element_name) == 0)
set_client_state (CLIENT_MODIFY_USER_NAME);
else if (strcasecmp ("NEW_NAME", element_name) == 0)
Expand Down Expand Up @@ -7706,16 +7686,6 @@ gmp_xml_handle_start_element (/* unused */ GMarkupParseContext* context,
create_user_data->hosts_allow = 1;
set_client_state (CLIENT_CREATE_USER_HOSTS);
}
else if (strcasecmp ("IFACES", element_name) == 0)
{
const gchar *attribute;
if (find_attribute
(attribute_names, attribute_values, "allow", &attribute))
create_user_data->ifaces_allow = strcmp (attribute, "0");
else
create_user_data->ifaces_allow = 1;
set_client_state (CLIENT_CREATE_USER_IFACES);
}
else if (strcasecmp ("NAME", element_name) == 0)
set_client_state (CLIENT_CREATE_USER_NAME);
else if (strcasecmp ("PASSWORD", element_name) == 0)
Expand Down Expand Up @@ -17549,8 +17519,8 @@ handle_get_users (gmp_parser_t *gmp_parser, GError **error)
while (1)
{
iterator_t groups, roles;
const char *hosts, *ifaces;
int hosts_allow, ifaces_allow;
const char *hosts;
int hosts_allow;

ret = get_next (&users, &get_users_data->get, &first, &count,
init_user_iterator);
Expand All @@ -17575,13 +17545,6 @@ handle_get_users (gmp_parser_t *gmp_parser, GError **error)
? user_iterator_method (&users)
: "file");

/* Interfaces Access */
ifaces = user_iterator_ifaces (&users);
ifaces_allow = user_iterator_ifaces_allow (&users);
SENDF_TO_CLIENT_OR_FAIL ("<ifaces allow=\"%i\">%s</ifaces>",
ifaces_allow,
ifaces ? ifaces : "");

/* User Roles */
init_user_role_iterator (&roles,
get_iterator_resource (&users));
Expand Down Expand Up @@ -22228,8 +22191,6 @@ gmp_xml_handle_end_element (/* unused */ GMarkupParseContext* context,
? create_user_data->comment : "",
create_user_data->hosts,
create_user_data->hosts_allow,
create_user_data->ifaces,
create_user_data->ifaces_allow,
create_user_data->sources,
create_user_data->groups,
&fail_group_id,
Expand Down Expand Up @@ -22313,7 +22274,6 @@ gmp_xml_handle_end_element (/* unused */ GMarkupParseContext* context,
CLOSE (CLIENT_CREATE_USER, GROUPS);
CLOSE (CLIENT_CREATE_USER_GROUPS, GROUP);
CLOSE (CLIENT_CREATE_USER, HOSTS);
CLOSE (CLIENT_CREATE_USER, IFACES);
CLOSE (CLIENT_CREATE_USER, NAME);
CLOSE (CLIENT_CREATE_USER, PASSWORD);
CLOSE (CLIENT_CREATE_USER, ROLE);
Expand Down Expand Up @@ -24800,8 +24760,6 @@ gmp_xml_handle_end_element (/* unused */ GMarkupParseContext* context,
modify_user_data->comment,
modify_user_data->hosts,
modify_user_data->hosts_allow,
modify_user_data->ifaces,
modify_user_data->ifaces_allow,
modify_user_data->sources,
modify_user_data->groups, &fail_group_id,
modify_user_data->roles, &fail_role_id,
Expand Down Expand Up @@ -24900,7 +24858,6 @@ gmp_xml_handle_end_element (/* unused */ GMarkupParseContext* context,
CLOSE (CLIENT_MODIFY_USER, GROUPS);
CLOSE (CLIENT_MODIFY_USER_GROUPS, GROUP);
CLOSE (CLIENT_MODIFY_USER, HOSTS);
CLOSE (CLIENT_MODIFY_USER, IFACES);
CLOSE (CLIENT_MODIFY_USER, NAME);
CLOSE (CLIENT_MODIFY_USER, NEW_NAME);
CLOSE (CLIENT_MODIFY_USER, PASSWORD);
Expand Down Expand Up @@ -25839,9 +25796,6 @@ gmp_xml_handle_text (/* unused */ GMarkupParseContext* context,
APPEND (CLIENT_MODIFY_USER_HOSTS,
&modify_user_data->hosts);

APPEND (CLIENT_MODIFY_USER_IFACES,
&modify_user_data->ifaces);

APPEND (CLIENT_MODIFY_USER_NAME,
&modify_user_data->name);

Expand Down Expand Up @@ -26376,9 +26330,6 @@ gmp_xml_handle_text (/* unused */ GMarkupParseContext* context,
APPEND (CLIENT_CREATE_USER_HOSTS,
&create_user_data->hosts);

APPEND (CLIENT_CREATE_USER_IFACES,
&create_user_data->ifaces);

APPEND (CLIENT_CREATE_USER_NAME,
&create_user_data->name);

Expand Down
Loading

0 comments on commit 4081b7b

Please sign in to comment.