From 8b9f7ba5807475f7cbc8e3e09763659c55eb6a58 Mon Sep 17 00:00:00 2001 From: Greenbone Bot Date: Thu, 29 Aug 2024 12:11:20 +0000 Subject: [PATCH 1/8] Automatic release to 22.12.0 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ea3924ab1..9d8c4040f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ cmake_minimum_required (VERSION 3.0) message ("-- Configuring gsad") -project (gsad VERSION 22.11.1 LANGUAGES C) +project (gsad VERSION 22.12.0 LANGUAGES C) if (NOT DEFINED PROJECT_VERSION_STRING) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) From 9c942ba05bad1000f381327f3fe83255387a539a Mon Sep 17 00:00:00 2001 From: Greenbone Bot Date: Thu, 29 Aug 2024 12:11:21 +0000 Subject: [PATCH 2/8] Automatic adjustments after release [skip ci] * Update to version 22.12.1-dev1 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d8c4040f..c4fcf5357 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ cmake_minimum_required (VERSION 3.0) message ("-- Configuring gsad") -project (gsad VERSION 22.12.0 LANGUAGES C) +project (gsad VERSION 22.12.1 LANGUAGES C) if (NOT DEFINED PROJECT_VERSION_STRING) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) From 0856f49e84b80a455ef1287882afa761455978f1 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelsalam Date: Wed, 21 Aug 2024 10:59:28 +0200 Subject: [PATCH 3/8] Add: Allow update of settings for time and date format --- src/gsad_gmp.c | 110 +++++++++++++++++++++++++++++++++++++++++++ src/gsad_validator.c | 2 + 2 files changed, 112 insertions(+) diff --git a/src/gsad_gmp.c b/src/gsad_gmp.c index 2550adf70..24bc71d23 100644 --- a/src/gsad_gmp.c +++ b/src/gsad_gmp.c @@ -11984,7 +11984,9 @@ save_my_settings_gmp (gvm_connection_t *connection, credentials_t *credentials, { const char *lang, *text, *old_passwd, *passwd, *max; const char *details_fname, *list_fname, *report_fname; + const char *time_format, *date_format; gchar *lang_64, *text_64, *max_64, *fname_64; + gchar *time_format_64, *date_format_64; GString *xml; entity_t entity; params_t *changed, *defaults, *filters; @@ -12004,6 +12006,8 @@ save_my_settings_gmp (gvm_connection_t *connection, credentials_t *credentials, details_fname = params_value (params, "details_fname"); list_fname = params_value (params, "list_fname"); report_fname = params_value (params, "report_fname"); + time_format = params_value (params, "time_format"); + date_format = params_value (params, "date_format"); CHECK_VARIABLE_INVALID (text, "Save Settings") CHECK_VARIABLE_INVALID (text, "Save Settings") @@ -12013,6 +12017,8 @@ save_my_settings_gmp (gvm_connection_t *connection, credentials_t *credentials, CHECK_VARIABLE_INVALID (details_fname, "Save Settings") CHECK_VARIABLE_INVALID (list_fname, "Save Settings") CHECK_VARIABLE_INVALID (report_fname, "Save Settings") + CHECK_VARIABLE_INVALID (time_format, "Save Settings") + CHECK_VARIABLE_INVALID (date_format, "Save Settings") xml = g_string_new (""); @@ -12638,6 +12644,110 @@ save_my_settings_gmp (gvm_connection_t *connection, credentials_t *credentials, } } + /* Send User Interface Time Format. */ + changed_value = params_value (changed, "time_format"); + if (changed_value == NULL + || (strcmp (changed_value, "") && strcmp (changed_value, "0"))) + { + time_format_64 = + g_base64_encode ((guchar *) time_format, strlen (time_format)); + + if (gvm_connection_sendf (connection, + "" + "%s" + "", + time_format_64 ? time_format_64 : "") + == -1) + { + g_free (time_format_64); + cmd_response_data_set_status_code (response_data, + MHD_HTTP_INTERNAL_SERVER_ERROR); + return gsad_message ( + credentials, "Internal error", __func__, __LINE__, + "An internal error occurred while saving settings. " + "It is unclear whether all the settings were saved. " + "Diagnostics: Failure to send command to manager daemon.", + response_data); + } + g_free (time_format_64); + + entity = NULL; + xml_string_append (xml, "", + "11deb7ff-550b-4950-aacf-06faeb7c61b9"); + if (read_entity_and_string_c (connection, &entity, &xml)) + { + g_string_free (xml, TRUE); + cmd_response_data_set_status_code (response_data, + MHD_HTTP_INTERNAL_SERVER_ERROR); + return gsad_message ( + credentials, "Internal error", __func__, __LINE__, + "An internal error occurred while saving settings. " + "It is unclear whether all the settings were saved. " + "Diagnostics: Failure to receive response from manager daemon.", + response_data); + } + xml_string_append (xml, ""); + if (gmp_success (entity) != 1) + { + set_http_status_from_entity (entity, response_data); + modify_failed = 1; + } + } + + /* Send User Interface Date Format. */ + changed_value = params_value (changed, "date_format"); + if (changed_value == NULL + || (strcmp (changed_value, "") && strcmp (changed_value, "0"))) + { + date_format_64 = + g_base64_encode ((guchar *) date_format, strlen (date_format)); + + if (gvm_connection_sendf (connection, + "" + "%s" + "", + date_format_64 ? date_format_64 : "") + == -1) + { + g_free (date_format_64); + cmd_response_data_set_status_code (response_data, + MHD_HTTP_INTERNAL_SERVER_ERROR); + return gsad_message ( + credentials, "Internal error", __func__, __LINE__, + "An internal error occurred while saving settings. " + "It is unclear whether all the settings were saved. " + "Diagnostics: Failure to send command to manager daemon.", + response_data); + } + g_free (date_format_64); + + entity = NULL; + xml_string_append (xml, "", + "d9857b7c-1159-4193-9bc0-18fae5473a69"); + if (read_entity_and_string_c (connection, &entity, &xml)) + { + g_string_free (xml, TRUE); + cmd_response_data_set_status_code (response_data, + MHD_HTTP_INTERNAL_SERVER_ERROR); + return gsad_message ( + credentials, "Internal error", __func__, __LINE__, + "An internal error occurred while saving settings. " + "It is unclear whether all the settings were saved. " + "Diagnostics: Failure to receive response from manager daemon.", + response_data); + } + xml_string_append (xml, ""); + if (gmp_success (entity) != 1) + { + set_http_status_from_entity (entity, response_data); + modify_failed = 1; + } + } + if (user_changed) { session_add_user (user_get_token (user), user); diff --git a/src/gsad_validator.c b/src/gsad_validator.c index 462be24f3..03539ae36 100644 --- a/src/gsad_validator.c +++ b/src/gsad_validator.c @@ -545,6 +545,8 @@ init_validator () "^(second|minute|hour|day|week|month|year|decade)$"); gvm_validator_add (validator, "chart_title", "(?s)^.*$"); gvm_validator_add (validator, "icalendar", "(?s)^BEGIN:VCALENDAR.+$"); + gvm_validator_add (validator, "time_format", "^(12|24)$"); + gvm_validator_add (validator, "date_format", "^(wmdy|wdmy)$"); /* Binary data params that should not use no UTF-8 validation */ gvm_validator_add_binary (validator, "certificate_bin"); From a1ff6d3025185c2a5b2d1878e4d2c0d6ab0283e7 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelsalam Date: Fri, 30 Aug 2024 10:09:51 +0200 Subject: [PATCH 4/8] Allow system_default value --- src/gsad_validator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gsad_validator.c b/src/gsad_validator.c index 03539ae36..8199a3bf2 100644 --- a/src/gsad_validator.c +++ b/src/gsad_validator.c @@ -545,8 +545,8 @@ init_validator () "^(second|minute|hour|day|week|month|year|decade)$"); gvm_validator_add (validator, "chart_title", "(?s)^.*$"); gvm_validator_add (validator, "icalendar", "(?s)^BEGIN:VCALENDAR.+$"); - gvm_validator_add (validator, "time_format", "^(12|24)$"); - gvm_validator_add (validator, "date_format", "^(wmdy|wdmy)$"); + gvm_validator_add (validator, "time_format", "^(12|24|system_default)$"); + gvm_validator_add (validator, "date_format", "^(wmdy|wdmy|system_default)$"); /* Binary data params that should not use no UTF-8 validation */ gvm_validator_add_binary (validator, "certificate_bin"); From 15e1b457e96d6672cbc32105c601757fd12fb14e Mon Sep 17 00:00:00 2001 From: robert-schardt Date: Fri, 27 Sep 2024 07:37:01 +0200 Subject: [PATCH 5/8] Change: Update gvm-libs image in prod.Dockerfile and build.Dockerfile (#180) Co-authored-by: Robert Schardt --- .docker/build.Dockerfile | 2 +- .docker/prod.Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.docker/build.Dockerfile b/.docker/build.Dockerfile index 44e0febcb..77c4b86fb 100644 --- a/.docker/build.Dockerfile +++ b/.docker/build.Dockerfile @@ -2,7 +2,7 @@ ARG GVM_LIBS_VERSION=oldstable # We want gvm-libs to be ready so we use the build docker image of gvm-libs -FROM greenbone/gvm-libs:$GVM_LIBS_VERSION +FROM registry.community.greenbone.net/community/gvm-libs:${GVM_LIBS_VERSION} # This will make apt-get install without question ARG DEBIAN_FRONTEND=noninteractive diff --git a/.docker/prod.Dockerfile b/.docker/prod.Dockerfile index fdff43940..3def718a6 100644 --- a/.docker/prod.Dockerfile +++ b/.docker/prod.Dockerfile @@ -27,7 +27,7 @@ RUN mkdir /build \ && cmake -DCMAKE_BUILD_TYPE=Release /source \ && make DESTDIR=/install install -FROM greenbone/gvm-libs:${GVM_LIBS_VERSION} +FROM registry.community.greenbone.net/community/gvm-libs:${GVM_LIBS_VERSION} ARG DEBIAN_FRONTEND=noninteractive From 9b8e227dc3335f5c6206d79b24cbc5d897bb6833 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelsalam Date: Tue, 15 Oct 2024 14:43:05 +0200 Subject: [PATCH 6/8] Address review comments --- src/gsad_gmp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gsad_gmp.c b/src/gsad_gmp.c index 24bc71d23..5953338e2 100644 --- a/src/gsad_gmp.c +++ b/src/gsad_gmp.c @@ -11986,7 +11986,6 @@ save_my_settings_gmp (gvm_connection_t *connection, credentials_t *credentials, const char *details_fname, *list_fname, *report_fname; const char *time_format, *date_format; gchar *lang_64, *text_64, *max_64, *fname_64; - gchar *time_format_64, *date_format_64; GString *xml; entity_t entity; params_t *changed, *defaults, *filters; @@ -12649,7 +12648,7 @@ save_my_settings_gmp (gvm_connection_t *connection, credentials_t *credentials, if (changed_value == NULL || (strcmp (changed_value, "") && strcmp (changed_value, "0"))) { - time_format_64 = + gchar *time_format_64 = g_base64_encode ((guchar *) time_format, strlen (time_format)); if (gvm_connection_sendf (connection, @@ -12701,7 +12700,7 @@ save_my_settings_gmp (gvm_connection_t *connection, credentials_t *credentials, if (changed_value == NULL || (strcmp (changed_value, "") && strcmp (changed_value, "0"))) { - date_format_64 = + gchar *date_format_64 = g_base64_encode ((guchar *) date_format, strlen (date_format)); if (gvm_connection_sendf (connection, From 82c473ee254c27b8ff1e7eb8023463a114e24aee Mon Sep 17 00:00:00 2001 From: Greenbone Bot Date: Thu, 17 Oct 2024 09:58:47 +0000 Subject: [PATCH 7/8] Automatic release to 24.0.0 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c4fcf5357..78d0dd5e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ cmake_minimum_required (VERSION 3.0) message ("-- Configuring gsad") -project (gsad VERSION 22.12.1 LANGUAGES C) +project (gsad VERSION 24.0.0 LANGUAGES C) if (NOT DEFINED PROJECT_VERSION_STRING) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) From 3f92b0902a9fa74a9aa98a84401052e86fb10ece Mon Sep 17 00:00:00 2001 From: Greenbone Bot Date: Thu, 17 Oct 2024 09:58:50 +0000 Subject: [PATCH 8/8] Automatic adjustments after release [skip ci] * Update to version 24.0.1-dev1 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 78d0dd5e9..c6a7246c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ cmake_minimum_required (VERSION 3.0) message ("-- Configuring gsad") -project (gsad VERSION 24.0.0 LANGUAGES C) +project (gsad VERSION 24.0.1 LANGUAGES C) if (NOT DEFINED PROJECT_VERSION_STRING) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)