From 3fc1fc71b5c98725851e92e04eca0a7416701f8b Mon Sep 17 00:00:00 2001 From: Matt Mundell Date: Tue, 10 Oct 2023 13:57:34 +0200 Subject: [PATCH 1/3] Docs: Flush trailing whitespace --- src/debug_utils.c | 2 +- src/gmp.c | 26 ++++++------- src/gmp_configs.c | 22 +++++------ src/gmp_license.c | 6 +-- src/gmp_tls_certificates.c | 2 +- src/gvmd.c | 20 +++++----- src/lsc_crypt.c | 8 ++-- src/lsc_crypt.h | 2 +- src/manage.c | 16 ++++---- src/manage.h | 2 +- src/manage_acl.c | 2 +- src/manage_configs.c | 14 +++---- src/manage_migrators.c | 6 +-- src/manage_pg.c | 6 +-- src/manage_port_lists.c | 10 ++--- src/manage_report_formats.c | 10 ++--- src/manage_sql.c | 64 +++++++++++++++---------------- src/manage_sql_configs.c | 6 +-- src/manage_sql_nvts.c | 14 +++---- src/manage_sql_secinfo.c | 6 +-- src/manage_sql_tls_certificates.c | 10 ++--- src/manage_utils.c | 8 ++-- src/manage_utils_tests.c | 2 +- src/sql.c | 4 +- src/utils_tests.c | 2 +- 25 files changed, 135 insertions(+), 135 deletions(-) diff --git a/src/debug_utils.c b/src/debug_utils.c index d6f9d86de..677d80a05 100644 --- a/src/debug_utils.c +++ b/src/debug_utils.c @@ -29,7 +29,7 @@ /** * @brief Initialize Sentry using the current gvmd version and DSN. - * + * * The DSN is set via the environment variable SENTRY_DSN_GVMD. * * @return 1 if sentry support was enabled, 0 if not. diff --git a/src/gmp.c b/src/gmp.c index 55371acab..2e7649b7b 100644 --- a/src/gmp.c +++ b/src/gmp.c @@ -4136,7 +4136,7 @@ typedef enum CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_COMMENT, CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_CREATION_TIME, CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_DESCRIPTION, - + CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_DETECTION, CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_DETECTION_RESULT, CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_DETECTION_RESULT_DETAILS, @@ -7276,7 +7276,7 @@ gmp_xml_handle_start_element (/* unused */ GMarkupParseContext* context, set_client_state ( CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_DETECTION_RESULT); } - ELSE_READ_OVER; + ELSE_READ_OVER; case CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_DETECTION_RESULT: if (strcasecmp ("DETAILS", element_name) == 0) { @@ -8201,7 +8201,7 @@ buffer_notes_xml (GString *buffer, iterator_t *notes, int include_notes_details, while (next (&tags)) { - buffer_xml_append_printf + buffer_xml_append_printf (buffer, "" "%s" @@ -8485,7 +8485,7 @@ buffer_overrides_xml (GString *buffer, iterator_t *overrides, while (next (&tags)) { - buffer_xml_append_printf + buffer_xml_append_printf (buffer, "" "%s" @@ -9278,7 +9278,7 @@ buffer_results_xml (GString *buffer, iterator_t *results, task_t task, while (next (&tags)) { - buffer_xml_append_printf + buffer_xml_append_printf (buffer, "" "%s" @@ -15812,7 +15812,7 @@ handle_create_schedule (gmp_parser_t *gmp_parser, GError **error) SEND_TO_CLIENT_OR_FAIL (""); } - SEND_TO_CLIENT_OR_FAIL + SEND_TO_CLIENT_OR_FAIL (""); log_event ("schedule", "Schedule", uuid, "created"); free (uuid); @@ -21311,7 +21311,7 @@ gmp_xml_handle_end_element (/* unused */ GMarkupParseContext* context, log_event_fail ("tag", "Tag", NULL, "created"); break; case 2: - SEND_TO_CLIENT_OR_FAIL + SEND_TO_CLIENT_OR_FAIL (""); @@ -22867,7 +22867,7 @@ gmp_xml_handle_end_element (/* unused */ GMarkupParseContext* context, ldap_cacert = g_strdup (kvp->value); else if (strcmp (kvp->key, "ldaps-only") == 0) ldap_ldaps_only = (strcmp (kvp->value, "true") == 0); - + setting = g_slist_next (setting); } @@ -24080,7 +24080,7 @@ gmp_xml_handle_end_element (/* unused */ GMarkupParseContext* context, log_event_fail ("tag", "Tag", NULL, "modified"); break; case 5: - SEND_TO_CLIENT_OR_FAIL + SEND_TO_CLIENT_OR_FAIL (""); @@ -26160,7 +26160,7 @@ gmp_xml_handle_text (/* unused */ GMarkupParseContext* context, create_report_data->result_detection_source_name) { - detection_detail_t *detail = + detection_detail_t *detail = (detection_detail_t*) g_malloc (sizeof (detection_detail_t)); if (detail) { @@ -26170,17 +26170,17 @@ gmp_xml_handle_text (/* unused */ GMarkupParseContext* context, create_report_data->result_detection_location = NULL; detail->source_oid = create_report_data->result_detection_source_oid; create_report_data->result_detection_source_oid = NULL; - detail->source_name = create_report_data->result_detection_source_name; + detail->source_name = create_report_data->result_detection_source_name; create_report_data->result_detection_source_name = NULL; array_add(create_report_data->result_detection, detail); } } - + } break; - + APPEND (CLIENT_CREATE_REPORT_RR_H_DETAIL_NAME, &create_report_data->detail_name); diff --git a/src/gmp_configs.c b/src/gmp_configs.c index a91971b2f..3daa9eada 100644 --- a/src/gmp_configs.c +++ b/src/gmp_configs.c @@ -691,13 +691,13 @@ modify_config_element_start (gmp_parser_t *gmp_parser, const gchar *name, /** * @brief Handle basic, single-value fields of modify_config. - * + * * @param[in] config The config to modify. * @param[in] name The name to set or NULL to keep old value. * @param[in] comment The comment to set or NULL to keep old value. * @param[in] gmp_parser GMP parser. * @param[out] error GError output. - * + * * @return 0 on success, -1 on error. */ static int @@ -736,7 +736,7 @@ modify_config_handle_basic_fields (config_t config, * @param[out] families_growing_all Array of growing families with all VTs. * @param[out] families_growing_empty Array of growing, empty families. * @param[out] families_static_all Array of static families with all VTs. - * + * * @return 0 on success, -1 on error. */ static int @@ -788,7 +788,7 @@ modify_config_collect_selection_families (entities_t entities, /** * @brief Handles a family selection inside a modify_config command. - * + * * @param[in] config The config to modify. * @param[in] families_growing_all Array of growing families with all VTs. * @param[in] families_growing_empty Array of growing, empty families. @@ -796,7 +796,7 @@ modify_config_collect_selection_families (entities_t entities, * @param[in] family_selection_growing 1 if families should grow, else 0. * @param[in] gmp_parser The GMP parser. * @param[out] error GError output. - * + * * @return 0 on success, -1 on error. */ static int @@ -939,7 +939,7 @@ modify_config_handle_nvt_selection (config_t config, * @param[in] value Value to set for the preference. * @param[in] gmp_parser The GMP parser. * @param[out] error GError output. - * + * * @return 0 on success, -1 on error. */ static int @@ -962,7 +962,7 @@ modify_config_handle_preference (config_t config, if (nvt_oid) { SENDF_TO_CLIENT_OR_FAIL_WITH_RETURN - (-1, + (-1, XML_ERROR_SYNTAX ("modify_config", "Empty radio value for preference %s" " of NVT %s"), @@ -972,18 +972,18 @@ modify_config_handle_preference (config_t config, else { SENDF_TO_CLIENT_OR_FAIL_WITH_RETURN - (-1, + (-1, XML_ERROR_SYNTAX ("modify_config", "Empty radio value for preference %s"), nvt_oid); } return -1; case -1: - SENDF_TO_CLIENT_OR_FAIL_WITH_RETURN + SENDF_TO_CLIENT_OR_FAIL_WITH_RETURN (-1, XML_INTERNAL_ERROR ("modify_config")); return -1; default: - SENDF_TO_CLIENT_OR_FAIL_WITH_RETURN + SENDF_TO_CLIENT_OR_FAIL_WITH_RETURN (-1, XML_INTERNAL_ERROR ("modify_config")); return -1; } @@ -1024,7 +1024,7 @@ modify_config_run (gmp_parser_t *gmp_parser, GError **error) "Permission denied")); // Find the config - switch (manage_modify_config_start (config_id, &config)) + switch (manage_modify_config_start (config_id, &config)) { case 0: break; diff --git a/src/gmp_license.c b/src/gmp_license.c index 72cc8b721..2b817bd8c 100644 --- a/src/gmp_license.c +++ b/src/gmp_license.c @@ -365,9 +365,9 @@ modify_license_element_start (gmp_parser_t *gmp_parser, * @param[in] allow_empty Whether to allow an empty file. * @param[out] error_msg The error message of the license update * if any - * + * * @return 0 success, 1 service unavailable, 2 empty file not allowed, - * 99 permission denied. + * 99 permission denied. */ static int modify_license (gchar *file_content, gboolean allow_empty, char **error_msg) @@ -440,7 +440,7 @@ modify_license_run (gmp_parser_t *gmp_parser, if (error_msg) { SENDF_TO_CLIENT_OR_FAIL - (XML_ERROR_SYNTAX ("modify_license", + (XML_ERROR_SYNTAX ("modify_license", "%s"), error_msg); g_free (error_msg); } diff --git a/src/gmp_tls_certificates.c b/src/gmp_tls_certificates.c index 7bd902b17..fb2be18d6 100644 --- a/src/gmp_tls_certificates.c +++ b/src/gmp_tls_certificates.c @@ -307,7 +307,7 @@ get_tls_certificates_run (gmp_parser_t *gmp_parser, GError **error) gchar *extra_xml; - SENDF_TO_CLIENT_OR_FAIL + SENDF_TO_CLIENT_OR_FAIL ("" "%s" "%s" diff --git a/src/gvmd.c b/src/gvmd.c index 5b3262c59..1e745778c 100644 --- a/src/gvmd.c +++ b/src/gvmd.c @@ -1279,7 +1279,7 @@ fork_feed_sync () int pid; sigset_t sigmask_all, sigmask_current; gboolean gvmd_data_feed_dirs_exist; - + static gboolean disable_gvmd_data_feed_warning = FALSE; if (feed_version_check_in_progress) @@ -1756,13 +1756,13 @@ manager_listen (const char *address_str_unix, const char *address_str_tls, } /** - * @brief parse_authentication_goption_arg is used to parse authentication + * @brief parse_authentication_goption_arg is used to parse authentication * parameter. * * @param[in] opt the parameter (e.g. --pepper). * @param[in] arg the value of the parameter. * @param[in] data the pointer of the data to set (unused). - * @param[in] err used to set error string on failure. + * @param[in] err used to set error string on failure. * * @return TRUE success, FALSE on failure. **/ @@ -2321,7 +2321,7 @@ gvmd (int argc, char** argv, char *env[]) /* Set feed lock path */ set_feed_lock_path (feed_lock_path); - + /* Set feed lock timeout */ set_feed_lock_timeout (feed_lock_timeout); @@ -2689,12 +2689,12 @@ gvmd (int argc, char** argv, char *env[]) } return EXIT_SUCCESS; } - + if (rebuild_gvmd_data) { int ret; gchar *error_msg; - + error_msg = NULL; setproctitle ("--rebuild-gvmd-data"); @@ -2736,13 +2736,13 @@ gvmd (int argc, char** argv, char *env[]) } return EXIT_SUCCESS; } - + if (dump_vt_verification) { int ret; setproctitle ("--dump-vt-verification"); - + if (option_lock (&lockfile_checking)) return EXIT_FAILURE; @@ -2876,7 +2876,7 @@ gvmd (int argc, char** argv, char *env[]) { int ret; setproctitle ("Creating encryption key"); - + if (option_lock (&lockfile_checking)) return EXIT_FAILURE; @@ -2891,7 +2891,7 @@ gvmd (int argc, char** argv, char *env[]) { int ret; setproctitle ("Setting encryption key"); - + if (option_lock (&lockfile_checking)) return EXIT_FAILURE; diff --git a/src/lsc_crypt.c b/src/lsc_crypt.c index c767ec1ea..0d3e2296a 100644 --- a/src/lsc_crypt.c +++ b/src/lsc_crypt.c @@ -181,7 +181,7 @@ generate_parms_string (const char *enckey_uid) "%%no-protection\n" "%%no-ask-passphrase\n" "\n", - (enckey_length > 0) ? enckey_length + (enckey_length > 0) ? enckey_length : DEFAULT_ENCRYPTION_RSA_KEY_LENGTH, enckey_uid ); @@ -512,8 +512,8 @@ do_decrypt (lsc_crypt_ctx_t ctx, const char *cipherstring, /** * @brief Sets the parameters for creating a new encryption key * - * @param[in] type Type of the - * @param[in] length + * @param[in] type Type of the + * @param[in] length */ int lsc_crypt_enckey_parms_init (const char *type, int length) @@ -597,7 +597,7 @@ lsc_crypt_flush (lsc_crypt_ctx_t ctx) * @brief Checks if the encryption key defined by the context already exists * * @param[in] ctx The context - * + * * @return Whether the key exists */ gboolean diff --git a/src/lsc_crypt.h b/src/lsc_crypt.h index fda8c74c1..1713c0a1d 100644 --- a/src/lsc_crypt.h +++ b/src/lsc_crypt.h @@ -41,7 +41,7 @@ /** * @brief Template for the name of the encryption key. * - * It must contain a single %s that will be replaced with the current + * It must contain a single %s that will be replaced with the current * date and time. * * Note that the code will use the "=" prefix flag to indicate an diff --git a/src/manage.c b/src/manage.c index 66e0e6400..8fd75b698 100644 --- a/src/manage.c +++ b/src/manage.c @@ -934,7 +934,7 @@ severity_to_type (double severity) /** * @brief Creates a new encryption key and sets it as the new default. - * + * * @return 0 on success, -1 on failure. */ int @@ -961,7 +961,7 @@ manage_create_encryption_key (GSList *log_config, case 1: printf ("Credential encryption key '%s' already exists\n", generated_uid); - g_warning ("%s: Credential encryption key '%s' already exists", + g_warning ("%s: Credential encryption key '%s' already exists", __func__, generated_uid); lsc_crypt_flush(ctx); @@ -971,7 +971,7 @@ manage_create_encryption_key (GSList *log_config, default: printf ("Could not create credential encryption key '%s'\n", generated_uid); - g_warning ("%s: Could not create credential encryption key '%s'", + g_warning ("%s: Could not create credential encryption key '%s'", __func__, generated_uid); lsc_crypt_flush(ctx); @@ -1010,7 +1010,7 @@ manage_set_encryption_key (GSList *log_config, g_warning ("Error setting up log config or database connection."); return -1; } - + lsc_crypt_ctx_t ctx = lsc_crypt_new (uid); if (! lsc_crypt_enckey_exists (ctx)) { @@ -3550,7 +3550,7 @@ slave_get_relay (const char *original_host, else { // Consider relay not found if host or port is empty - ret = 1; + ret = 1; } } else @@ -5115,12 +5115,12 @@ manage_sync (sigset_t *sigmask_current, /** * @brief Rebuild configs, port lists and report formats from feed. - * + * * @param[in] types Comma-separated lists of types to rebuild or "all". * @param[in] log_config Logging configuration list. * @param[in] database Connection info for manage database. * @param[out] error_msg Error message. - * + * * @return 0 success, -1 failed. */ int @@ -5158,7 +5158,7 @@ manage_rebuild_gvmd_data_from_feed (const char *types, while (*split_iter) { gchar *type = g_strstrip (*split_iter); - + if (strcasecmp (type, "configs") == 0) sync_configs = TRUE; else if (strcasecmp (type, "port_lists") == 0) diff --git a/src/manage.h b/src/manage.h index e4c3a66f8..0b871973e 100644 --- a/src/manage.h +++ b/src/manage.h @@ -1181,7 +1181,7 @@ result_detection_reference (result_t, report_t, const char *, const char *, */ #define MIN_QOD_DEFAULT 70 -/** +/** * @brief Default size to limit note and override text to in reports. */ #define EXCERPT_SIZE_DEFAULT 300 diff --git a/src/manage_acl.c b/src/manage_acl.c index e4da64925..8b80856b4 100644 --- a/src/manage_acl.c +++ b/src/manage_acl.c @@ -1525,7 +1525,7 @@ acl_where_owned (const char *type, const get_data_t *get, int owned, * @return Newly allocated owned clause. */ gchar * -acl_where_owned_for_get (const char *type, const char *user_sql, +acl_where_owned_for_get (const char *type, const char *user_sql, const char *with_prefix, gchar **with) { gchar *owned_clause; diff --git a/src/manage_configs.c b/src/manage_configs.c index 8c1294126..9dd0fa214 100644 --- a/src/manage_configs.c +++ b/src/manage_configs.c @@ -398,11 +398,11 @@ sync_config_with_feed (const gchar *path, gboolean rebuild) * @brief Open the configs feed directory if it is available and the * feed owner is set. * Optionally set the current user to the feed owner on success. - * + * * The sync will be skipped if the feed directory does not exist or - * the feed owner is not set. + * the feed owner is not set. * For configs the NVTs also have to exist. - * + * * @param[out] dir The directory as GDir if available and feed owner is set, * NULL otherwise. * @param[in] set_current_user Whether to set current user to feed owner. @@ -416,9 +416,9 @@ try_open_configs_feed_dir (GDir **dir, gboolean set_current_user) char *feed_owner_uuid, *feed_owner_name; GError *error; gchar *nvt_feed_version; - + *dir = NULL; - + /* Test if base feed directory exists */ if (configs_feed_dir_exists () == FALSE) @@ -533,7 +533,7 @@ sync_configs_with_feed (gboolean rebuild) /** * @brief Tests if the configs feed directory exists. - * + * * @return TRUE if the directory exists. */ gboolean @@ -553,7 +553,7 @@ manage_sync_configs () /** * @brief Rebuild configs from the feed. - * + * * @return 0 success, 1 no feed directory, 2 no feed owner, 3 NVTs missing, * -1 error. */ diff --git a/src/manage_migrators.c b/src/manage_migrators.c index d5c95db0b..9d5436716 100644 --- a/src/manage_migrators.c +++ b/src/manage_migrators.c @@ -778,7 +778,7 @@ migrate_212_to_213 () certificate = g_base64_decode (certificate_64, &certificate_size); creation_time = iterator_int64 (&tls_certs, 2); - get_certificate_info ((gchar*)certificate, + get_certificate_info ((gchar*)certificate, certificate_size, NULL, /* activation_time */ NULL, /* expiration_time */ @@ -2922,7 +2922,7 @@ migrate_249_to_250 () " WHERE name = 'table_driven_lsc'" " AND type = 'SERVER_PREFS');"); - /* Disable the "table_based_lsc" scanner preference for all policies + /* Disable the "table_based_lsc" scanner preference for all policies * in the trashcan. */ sql ("INSERT INTO config_preferences_trash (config, type, name, value)" " SELECT id, 'SERVER_PREFS', 'table_driven_lsc', '0'" @@ -2932,7 +2932,7 @@ migrate_249_to_250 () " (SELECT config FROM config_preferences_trash" " WHERE name = 'table_driven_lsc'" " AND type = 'SERVER_PREFS');"); - + /* Set the database version to 250. */ set_db_version (250); diff --git a/src/manage_pg.c b/src/manage_pg.c index d2c68e45d..0e5340289 100644 --- a/src/manage_pg.c +++ b/src/manage_pg.c @@ -195,7 +195,7 @@ manage_create_sql_functions () return -1; /* Functions in C have been moved to the "pg-gvm" extension. */ - + /* Operators */ sql ("SET ROLE \"%s\";", DB_SUPERUSER_ROLE); @@ -3017,7 +3017,7 @@ check_db_sequences () /** * @brief Check if an extension is available and can be installed. - * + * * @param[in] name Name of the extension to check. * * @return TRUE extension is available, FALSE otherwise. @@ -3090,7 +3090,7 @@ check_db_extensions () // Switch to superuser role and try to install extensions. sql ("SET ROLE \"%s\";", DB_SUPERUSER_ROLE); - + // Clean up old functions now in pg-gvm cleanup_old_sql_functions (); diff --git a/src/manage_port_lists.c b/src/manage_port_lists.c index a39ce2920..82590b949 100644 --- a/src/manage_port_lists.c +++ b/src/manage_port_lists.c @@ -334,10 +334,10 @@ sync_port_list_with_feed (const gchar *path, gboolean rebuild) * @brief Open the port lists feed directory if it is available and the * feed owner is set. * Optionally set the current user to the feed owner on success. - * + * * The sync will be skipped if the feed directory does not exist or - * the feed owner is not set. - * + * the feed owner is not set. + * * @param[out] dir The directory as GDir if available and feed owner is set, * NULL otherwise. * @param[in] set_current_user Whether to set current user to feed owner. @@ -401,7 +401,7 @@ try_open_port_lists_feed_dir (GDir **dir, gboolean set_current_user) return 0; } - + /** * @brief Sync all port lists with the feed. * @@ -451,7 +451,7 @@ sync_port_lists_with_feed (gboolean rebuild) /** * @brief Tests if the port lists feed directory exists. - * + * * @return TRUE if the directory exists. */ gboolean diff --git a/src/manage_report_formats.c b/src/manage_report_formats.c index 06f2bb362..fad78ce4b 100644 --- a/src/manage_report_formats.c +++ b/src/manage_report_formats.c @@ -630,7 +630,7 @@ should_sync_report_format_from_path (const char *path, { if (rebuild) return 1; - + full_path = g_build_filename (feed_dir_report_formats (), path, NULL); g_free (uuid); @@ -694,10 +694,10 @@ sync_report_format_with_feed (const gchar *path, gboolean rebuild) * @brief Open the report formats feed directory if it is available and the * feed owner is set. * Optionally set the current user to the feed owner on success. - * + * * The sync will be skipped if the feed directory does not exist or - * the feed owner is not set. - * + * the feed owner is not set. + * * @param[out] dir The directory as GDir if available and feed owner is set, * NULL otherwise. * @param[in] set_current_user Whether to set current user to feed owner. @@ -812,7 +812,7 @@ sync_report_formats_with_feed (gboolean rebuild) /** * @brief Tests if the report formats feed directory exists. - * + * * @return TRUE if the directory exists. */ gboolean diff --git a/src/manage_sql.c b/src/manage_sql.c index c86a92e97..f6e8d12d2 100644 --- a/src/manage_sql.c +++ b/src/manage_sql.c @@ -2044,7 +2044,7 @@ manage_report_filter_controls (const gchar *filter, int *first, int *max, return; split = split_filter (filter); - + point = (keyword_t**) split->pdata; if (first) { @@ -6120,8 +6120,8 @@ encrypt_all_credentials (gboolean decrypt_flag) { GHashTable *plaintext_hashtable; char *encblob; - - plaintext_hashtable + + plaintext_hashtable = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_free); if (password) @@ -6193,7 +6193,7 @@ encrypt_all_auth_settings (gboolean decrypt_flag) char *radius_key = NULL; gboolean radius_key_encrypted; ntotal = ndecrypted = nencrypted = nreencrypted = 0; - + sql_begin_immediate (); radius_key = get_radius_key (&radius_key_encrypted); @@ -6337,7 +6337,7 @@ current_encryption_key_uid (gboolean with_fallback) if (key_uid) return key_uid; - + if (!with_fallback) return NULL; @@ -6365,7 +6365,7 @@ current_encryption_key_uid (gboolean with_fallback) /** * @brief Sets the database field defining the encryption key UID. * - * Note: This does not have any effects on any already created + * Note: This does not have any effects on any already created * encryption contexts that may be using the old UID. * * @param[in] new_uid The new UID to set. @@ -6374,7 +6374,7 @@ void set_current_encryption_key_uid (const char *new_uid) { gchar *quoted_new_uid = sql_quote (new_uid); - + sql ("INSERT INTO meta (name, value)" " VALUES ('encryption_key_uid', '%s')" " ON CONFLICT (name) DO UPDATE SET value = EXCLUDED.value;", @@ -6897,7 +6897,7 @@ validate_alert_event_data (gchar *name, gchar* data, event_t event) * @param[in] data The data. * @param[in] for_modify Whether to return error codes for modify_alert. * - * @return 0 valid, 2 or 6: validation of email address failed, + * @return 0 valid, 2 or 6: validation of email address failed, * 7 or 9 subject too long, 8 or 10 message too long, * 60 recipient credential not found, 61 invalid recipient credential * type, -1 error. When for_modify is 0, the first code is returned, @@ -9096,7 +9096,7 @@ email_encrypt_smime (FILE *plain_file, FILE *encrypted_file, } // End of message - if (fprintf (encrypted_file, + if (fprintf (encrypted_file, "\n") < 0) { g_warning ("%s: output error at end of message", __func__); @@ -11726,7 +11726,7 @@ scp_alert_path_print (const gchar *message, task_t task) memset(&time_string, 0, 9); current_time = time (NULL); - + if (localtime_r (¤t_time, &tm) == NULL) { g_warning ("%s: localtime failed, aborting", @@ -12531,7 +12531,7 @@ escalate_to_vfire (alert_t alert, task_t task, report_t report, event_t event, get_delta_report (alert, task, report), alert_filter_get - ? alert_filter_get + ? alert_filter_get : get, report_format, notes_details, @@ -13744,7 +13744,7 @@ escalate_2 (alert_t alert, task_t task, report_t report, event_t event, } /* TLS certificate subject workaround setting */ - tls_cert_workaround_str + tls_cert_workaround_str = alert_data (alert, "method", "tp_sms_tls_workaround"); if (tls_cert_workaround_str) @@ -14422,7 +14422,7 @@ condition_met (task_t task, report_t report, alert_t alert, /* SecInfo event. */ db_count = alert_secinfo_count (alert, filter_id); - + if (db_count >= count) return 1; break; @@ -17480,7 +17480,7 @@ authenticate (credentials_t* credentials) if (credentials->uuid == NULL) /* Can happen if user is deleted while logged in to GSA. */ return 1; - + if (credentials_setup (credentials)) { free (credentials->uuid); @@ -19244,7 +19244,7 @@ auto_delete_reports () { int ret; report_t report = g_array_index (reports_to_delete, report_t, i); - + sql_begin_immediate (); /* As in delete_report, this prevents other processes from getting the @@ -19437,7 +19437,7 @@ make_osp_result (task_t task, const char *host, const char *hostname, " FROM nvts WHERE oid='%s'", quoted_nvt); } - + if (!severity || !strcmp (severity, "")) { if (!strcmp (type, severity_to_type (SEVERITY_ERROR))) @@ -20038,7 +20038,7 @@ result_detection_reference (result_t result, report_t report, " OR port LIKE '%%%s%%');", report, quoted_host, *oid, quoted_location, quoted_location); - + if (*ref == NULL) goto detect_cleanup; @@ -21236,7 +21236,7 @@ report_task (report_t report, task_t *task) /** * @brief Get compliance counts for a report. - * + * * @param[in] report_id UUID of the report. * @param[out] compliance_yes Number of "YES" results. * @param[out] compliance_no Number of "NO" results. @@ -21256,7 +21256,7 @@ report_compliance_by_uuid (const char *report_id, if (compliance_yes) { - *compliance_yes + *compliance_yes = sql_int ("SELECT count(*) FROM results" " WHERE report = %llu" " AND description LIKE 'Compliant:%%YES%%';", @@ -21265,7 +21265,7 @@ report_compliance_by_uuid (const char *report_id, if (compliance_no) { - *compliance_no + *compliance_no = sql_int ("SELECT count(*) FROM results" " WHERE report = %llu" " AND description LIKE 'Compliant:%%NO%%';", @@ -21448,7 +21448,7 @@ report_add_result (report_t report, result_t result) /** * @brief Add results from an array to a report. - * + * * @param[in] report The report to add the results to. * @param[in] results GArray containing the row ids of the results to add. */ @@ -21466,7 +21466,7 @@ report_add_results_array (report_t report, GArray *results) { result_t result; result = g_array_index (results, result_t, index); - + if (index) g_string_append (array_sql, ", "); g_string_append_printf (array_sql, "%llu", result); @@ -21483,7 +21483,7 @@ report_add_results_array (report_t report, GArray *results) { result_t result; result = g_array_index (results, result_t, index); - + report_add_result_for_buffer (report, result); } @@ -27711,12 +27711,12 @@ print_report_xml_start (report_t report, report_t delta, task_t task, assert (get); - if ((get->filt_id && strlen (get->filt_id) + if ((get->filt_id && strlen (get->filt_id) && strcmp (get->filt_id, FILT_ID_NONE)) || (get->filter && strlen (get->filter))) { term = NULL; - if (get->filt_id && strlen (get->filt_id) + if (get->filt_id && strlen (get->filt_id) && strcmp (get->filt_id, FILT_ID_NONE)) { term = filter_term (get->filt_id); @@ -29341,7 +29341,7 @@ check_osp_result_exists (report_t report, task_t task, gchar *quoted_hostname, *quoted_port, *quoted_path; double severity_double = 0.0; int qod_int = QOD_DEFAULT; - + host = entity_attribute (r_entity, "host"); hostname = entity_attribute (r_entity, "hostname"); type = entity_attribute (r_entity, "type"); @@ -29655,11 +29655,11 @@ parse_osp_report (task_t task, report_t report, const char *report_xml) if (has_results) { - sql ("UPDATE reports SET modification_time = m_now() WHERE id = %llu;", + sql ("UPDATE reports SET modification_time = m_now() WHERE id = %llu;", report); report_add_results_array (report, results_array); } - + end_parse_osp_report: sql_commit (); @@ -44624,7 +44624,7 @@ add_feed_role_permissions (const char *type, roles_str = NULL; setting_value (SETTING_UUID_FEED_IMPORT_ROLES, &roles_str); - + if (roles_str == NULL || strlen (roles_str) == 0) { g_message ("%s: No feed import roles defined", __func__); @@ -44843,7 +44843,7 @@ clean_feed_role_permissions (const char *type, permission_resource, sql_roles->str); - while (next (&permissions)) + while (next (&permissions)) { const char *role_id = iterator_string (&permissions, 0); const char *role_name = iterator_string (&permissions, 1); @@ -54233,7 +54233,7 @@ manage_set_ldap_info (int enabled, gchar *host, gchar *authdn, * @brief Gets the current RADIUS secret key. * * @param[out] is_encrypted_ret Whether the key is encrypted. NULL to ignore. - * + * * @return Freshly allocated RADIUS secret key. */ char * @@ -54273,7 +54273,7 @@ get_radius_key (gboolean *is_encrypted) g_free (secret); } } - + return key; } diff --git a/src/manage_sql_configs.c b/src/manage_sql_configs.c index f79d6b1ea..df83267c1 100644 --- a/src/manage_sql_configs.c +++ b/src/manage_sql_configs.c @@ -871,14 +871,14 @@ nvt_selector_has (const char* quoted_selector, const char* family_or_nvt, * * @param[in] config_id UUID of the config to find. * @param[out] config_out Row ID of the config or 0 if not found. - * + * * @return 0 success, 1 config not found, -1 error. */ int manage_modify_config_start (const char *config_id, config_t *config_out) { sql_begin_immediate (); - + if (find_config_with_permission (config_id, config_out, "modify_config")) { sql_rollback (); @@ -889,7 +889,7 @@ manage_modify_config_start (const char *config_id, config_t *config_out) sql_rollback (); return 1; } - + return 0; } diff --git a/src/manage_sql_nvts.c b/src/manage_sql_nvts.c index c603a0b9c..0b3afad14 100644 --- a/src/manage_sql_nvts.c +++ b/src/manage_sql_nvts.c @@ -414,7 +414,7 @@ insert_vt_refs (const nvti_t *nvti, int rebuild, batch_t *batch) rebuild ? "_rebuild" : ""); else comma = 1; - + g_string_append_printf (batch->sql, // Newline in case it gets logged. "%s\n ('%s', '%s', '%s', '%s')", @@ -1594,7 +1594,7 @@ nvti_from_vt (element_t vt) = element_child (severity, "origin"); severity_date = element_child (severity, "date"); - + if (severity_date) { gchar *text; @@ -2016,7 +2016,7 @@ init_nvt_severity_iterator (iterator_t* iterator, const char *oid) * @brief Gets the type from an NVT severity iterator. * * @param[in] iterator Iterator. - * + * * @return The type of the severity. */ DEF_ACCESS (nvt_severity_iterator_type, 0) @@ -2025,7 +2025,7 @@ DEF_ACCESS (nvt_severity_iterator_type, 0) * @brief Gets the origin from an NVT severity iterator. * * @param[in] iterator Iterator. - * + * * @return The origin of the severity. */ DEF_ACCESS (nvt_severity_iterator_origin, 1); @@ -2034,7 +2034,7 @@ DEF_ACCESS (nvt_severity_iterator_origin, 1); * @brief Gets the date from an NVT severity iterator. * * @param[in] iterator Iterator. - * + * * @return The date of the severity in ISO time format. */ DEF_ACCESS (nvt_severity_iterator_date, 2); @@ -2043,7 +2043,7 @@ DEF_ACCESS (nvt_severity_iterator_date, 2); * @brief Gets the score from an NVT severity iterator. * * @param[in] iterator Iterator. - * + * * @return The score of the severity. */ double @@ -2056,7 +2056,7 @@ nvt_severity_iterator_score (iterator_t *iterator) * @brief Gets the value from an NVT severity iterator. * * @param[in] iterator Iterator. - * + * * @return The value of the severity in ISO time format. */ DEF_ACCESS (nvt_severity_iterator_value, 4); diff --git a/src/manage_sql_secinfo.c b/src/manage_sql_secinfo.c index 9d893b8f9..8c98a2245 100644 --- a/src/manage_sql_secinfo.c +++ b/src/manage_sql_secinfo.c @@ -582,9 +582,9 @@ DEF_ACCESS (cpe_info_iterator_nvd_id, GET_ITERATOR_COLUMN_COUNT + 5); /** * @brief Get the XML details / raw data for a given CPE ID. - * + * * @param[in] cpe_id ID of the CPE to get the raw XML of. - * + * * @return newly allocated XML details string */ char * @@ -2493,7 +2493,7 @@ insert_cve_from_entry (element_t entry, element_t last_modified, } else cvss_is_v3 = TRUE; - + if (cvss == NULL) base_metrics = NULL; else diff --git a/src/manage_sql_tls_certificates.c b/src/manage_sql_tls_certificates.c index 6443d7cc6..48cffb3e8 100644 --- a/src/manage_sql_tls_certificates.c +++ b/src/manage_sql_tls_certificates.c @@ -1716,7 +1716,7 @@ tls_certificate_host_asset_id (const char *host_ip, const char *origin_id) /** * @brief Clean up DNs of TLS Certificates that are not valid UTF-8. - * + * * @return The number of TLS certificates updated. */ int @@ -1724,18 +1724,18 @@ cleanup_tls_certificate_encoding () { int changes = 0; iterator_t iterator; - + init_iterator (&iterator, "SELECT id, subject_dn, issuer_dn" " FROM tls_certificates" " WHERE subject_dn ~ '[\\x80-\\xFF]'" " OR issuer_dn ~ '[\\x80-\\xFF]'"); - + while (next (&iterator)) { tls_certificate_t tls_certificate; const char *subject_dn, *issuer_dn; - + tls_certificate = iterator_int64 (&iterator, 0); subject_dn = iterator_string (&iterator, 1); issuer_dn = iterator_string (&iterator, 2); @@ -1745,7 +1745,7 @@ cleanup_tls_certificate_encoding () { gchar *quoted_subject_dn = sql_ascii_escape_and_quote (subject_dn); gchar *quoted_issuer_dn = sql_ascii_escape_and_quote (issuer_dn); - + sql ("UPDATE tls_certificates" " SET subject_dn = '%s', issuer_dn = '%s'" " WHERE id = %llu", diff --git a/src/manage_utils.c b/src/manage_utils.c index e6f681451..70bb933e6 100644 --- a/src/manage_utils.c +++ b/src/manage_utils.c @@ -131,7 +131,7 @@ time_t add_months (time_t time, int months) { struct tm broken; - + if (localtime_r (&time, &broken) == NULL) { g_warning ("%s: localtime failed", __func__); @@ -157,7 +157,7 @@ manage_count_hosts_max (const char *given_hosts, const char *exclude_hosts, int count; gvm_hosts_t *hosts; gchar *clean_hosts; - + clean_hosts = clean_hosts_string (given_hosts); hosts = gvm_hosts_new_with_max (clean_hosts, max_hosts); @@ -1435,7 +1435,7 @@ clean_hosts_string (const char *hosts) * First line matches zeroes before non-zero numbers, e.g. "000" in "000120" * Second line matches groups of all zeroes except one, e.g. "00" in "000" */ - ipv4_replace_regex + ipv4_replace_regex = g_regex_new ("(?<=\\D|^)(0+)(?=(?:(?:[1-9]\\d*)(?:\\D|$)))" "|(?<=\\D|^)(0+)(?=0(?:\\D|$))", 0, 0, NULL); @@ -1470,6 +1470,6 @@ clean_hosts_string (const char *hosts) g_regex_unref (ipv4_match_regex); g_regex_unref (ipv4_replace_regex); - + return g_string_free (new_hosts, FALSE); } diff --git a/src/manage_utils_tests.c b/src/manage_utils_tests.c index ca0f340af..0ab7f6a97 100644 --- a/src/manage_utils_tests.c +++ b/src/manage_utils_tests.c @@ -206,7 +206,7 @@ main (int argc, char **argv) add_test_with_context (suite, manage_utils, icalendar_next_time_from_string_utc); add_test_with_context (suite, manage_utils, icalendar_next_time_from_string_tz); - + add_test_with_context (suite, manage_utils, clean_hosts_string_zeroes); if (argc > 1) diff --git a/src/sql.c b/src/sql.c index 876002ce9..0f08b56e1 100644 --- a/src/sql.c +++ b/src/sql.c @@ -45,7 +45,7 @@ #define DEADLOCK_SLEEP 1000 /** - * @brief defines the amount of retries after a deadlock is considered a warning + * @brief defines the amount of retries after a deadlock is considered a warning */ #define DEADLOCK_THRESHOLD 25 @@ -285,7 +285,7 @@ sql (char* sql, ...) if (deadlock_amount++ > DEADLOCK_THRESHOLD) { g_warning("%s: %d deadlocks detected, waiting and retrying %s", __func__, deadlock_amount, sql); - } + } gvm_usleep (DEADLOCK_SLEEP); continue; } diff --git a/src/utils_tests.c b/src/utils_tests.c index 03152c2f5..2a252a19d 100644 --- a/src/utils_tests.c +++ b/src/utils_tests.c @@ -72,7 +72,7 @@ Ensure (utils, parse_iso_time_tz_with_fallback_tz) assert_that (parse_iso_time_tz ("2020-01-01T01:02:03", "Australia/Adelaide"), is_equal_to (1577802723)); - + assert_that (parse_iso_time_tz ("2020-01-01T01:02:03", NULL), is_equal_to (1577840523)); From 45708a170955091b23aea1805882686baf405820 Mon Sep 17 00:00:00 2001 From: Matt Mundell Date: Tue, 10 Oct 2023 15:17:47 +0200 Subject: [PATCH 2/3] Docs: Add missing --- src/gmp_logout.c | 10 +++++++++- src/gvmd.c | 1 + src/lsc_crypt.c | 22 ++++++++++++++++++++-- src/main.c | 1 + src/manage.c | 8 +++++++- src/manage_pg.c | 2 ++ src/manage_sql.c | 39 ++++++++++++++++++++++++--------------- src/manage_sql_configs.c | 6 +++++- src/manage_sql_nvts.c | 4 ++-- src/manage_sql_secinfo.c | 9 +++++++-- 10 files changed, 78 insertions(+), 24 deletions(-) diff --git a/src/gmp_logout.c b/src/gmp_logout.c index f8ceab62f..ca9f88157 100644 --- a/src/gmp_logout.c +++ b/src/gmp_logout.c @@ -26,14 +26,22 @@ #include "gmp_logout.h" #include "manage.h" +/** + * @brief The logout command. + */ typedef struct { context_data_t *context; ///< XML parser context. } logout_t; +/** + * @brief Parser callback data. + * + * This is initially 0 because it's a global variable. + */ static logout_t logout_data; -/* +/** * @brief Reset command data. */ static void diff --git a/src/gvmd.c b/src/gvmd.c index 1e745778c..33efe7dc8 100644 --- a/src/gvmd.c +++ b/src/gvmd.c @@ -1814,6 +1814,7 @@ parse_authentication_goption_arg (const gchar *opt, const gchar *arg, * * @param[in] argc The number of arguments in argv. * @param[in] argv The list of arguments to the program. + * @param[in] env The program's environment arguments. * * @return EXIT_SUCCESS on success, EXIT_FAILURE on failure. */ diff --git a/src/lsc_crypt.c b/src/lsc_crypt.c index 0d3e2296a..d4e1a0b8a 100644 --- a/src/lsc_crypt.c +++ b/src/lsc_crypt.c @@ -90,8 +90,15 @@ struct lsc_crypt_ctx_s /* Key generation parameters */ + +/** + * @brief Key type. + */ gchar *enckey_type = NULL; +/** + * @brief Key length. + */ int enckey_length = 0; @@ -164,6 +171,13 @@ get32 (const void *buffer) /* Local functions. */ +/** + * @brief Generate GnupgKeyParms element. + * + * @param enckey_uid The Name-Real field. + * + * @return Element or NULL. + */ static gchar* generate_parms_string (const char *enckey_uid) { @@ -512,8 +526,10 @@ do_decrypt (lsc_crypt_ctx_t ctx, const char *cipherstring, /** * @brief Sets the parameters for creating a new encryption key * - * @param[in] type Type of the - * @param[in] length + * @param[in] type Type of the key. + * @param[in] length Length of the key. + * + * @return 0. */ int lsc_crypt_enckey_parms_init (const char *type, int length) @@ -527,6 +543,8 @@ lsc_crypt_enckey_parms_init (const char *type, int length) /** * @brief Return a new context for LSC encryption * + * @param[in] enckey_uid UID for key, or NULL. Will be copied. + * @return A new context object to be released with \ref * lsc_crypt_release. */ diff --git a/src/main.c b/src/main.c index 4f5533b7e..e49742ba2 100644 --- a/src/main.c +++ b/src/main.c @@ -30,6 +30,7 @@ * * @param[in] argc The number of arguments in argv. * @param[in] argv The list of arguments to the program. + * @param[in] env The program's environment arguments. * * @return EXIT_SUCCESS on success, EXIT_FAILURE on failure. */ diff --git a/src/manage.c b/src/manage.c index 8fd75b698..8fbd26559 100644 --- a/src/manage.c +++ b/src/manage.c @@ -935,6 +935,9 @@ severity_to_type (double severity) /** * @brief Creates a new encryption key and sets it as the new default. * + * @param[in] log_config Logging configuration list. + * @param[in] database Connection info for manage database. + * * @return 0 on success, -1 on failure. */ int @@ -994,7 +997,9 @@ manage_create_encryption_key (GSList *log_config, /** * @brief Sets the new default encryption key. The key must already exist. * - * @param[in] uid UID of the encryption key. + * @param[in] log_config Logging configuration list. + * @param[in] database Connection info for manage database. + * @param[in] uid UID for key. * * @return 0 on success, -1 on failure. */ @@ -3989,6 +3994,7 @@ credential_full_type (const char* abbreviation) * @param[in] end The end time of the performance report. * @param[in] titles The end titles for the performance report. * @param[in] performance_str The performance string. + * @param[out] error Error return. * * @return 0 if successful, 6 could not connect to scanner or failed to get * performance report diff --git a/src/manage_pg.c b/src/manage_pg.c index 0e5340289..1e67cac98 100644 --- a/src/manage_pg.c +++ b/src/manage_pg.c @@ -1753,6 +1753,8 @@ create_view_vulns () /** * @brief Create NVT related tables. + * + * @param[in] suffix String to append to table names. */ void create_tables_nvt (const gchar *suffix) diff --git a/src/manage_sql.c b/src/manage_sql.c index f6e8d12d2..2445b63dd 100644 --- a/src/manage_sql.c +++ b/src/manage_sql.c @@ -10219,6 +10219,7 @@ scp_to_host (const char *username, const char *password, * @param[in] username Username. * @param[in] share_path Name/address of host and name of the share. * @param[in] file_path Destination filename with path inside the share. + * @param[in] max_protocol Max protocol. * @param[in] report Report that should be sent. * @param[in] report_size Size of the report. * @param[out] script_message Custom error message of the alert script. @@ -17500,8 +17501,6 @@ authenticate (credentials_t* credentials) /** * @brief Perform actions necessary at user logout - * - * @param[in] username Username. */ void logout_user () @@ -19405,6 +19404,7 @@ result_nvt_notice (const gchar *nvt) * @param[in] severity Result severity. * @param[in] qod Quality of detection. * @param[in] path Result path, e.g. file location of a product. + * @param[in] hash_value Hash value of the result. * * @return A result descriptor for the new result, 0 if error. */ @@ -20696,12 +20696,13 @@ host_detail_free (host_detail_t *detail) * @param[in] s_desc The detail's source description. * @param[in] name The detail's name. * @param[in] value The detail's value. + * @param[in] hash_value The detail's hash value. */ void insert_report_host_detail (report_t report, const char *host, const char *s_type, const char *s_name, const char *s_desc, const char *name, - const char *value, const char * hash_value) + const char *value, const char *hash_value) { char *quoted_host, *quoted_source_name, *quoted_source_type; char *quoted_source_desc, *quoted_name, *quoted_value; @@ -29308,15 +29309,14 @@ report_host_noticeable (report_t report, const gchar *host) && report_host_result_count (report_host) > 0; } -/* +/** * @brief Generate the hash value for the entity of the result and * check if osp result for report already exists * * @param[in] report Report. * @param[in] task Task. * @param[in] r_entity entity of the result. - * - * @param[out] hash_value The generated hash value of r_entity. + * @param[out] entity_hash_value The generated hash value of r_entity. * * @return "1" if osp result already exists, else "0" */ @@ -29415,15 +29415,17 @@ check_osp_result_exists (report_t report, task_t task, return return_value; } -/* - * @brief Generate the hash value for the report host detail and - * check if the report host detail entry already exists +/** + * @brief Check if host detail exists. * * @param[in] report Report. - * @param[in] task Task. - * @param[in] r_entity entity of the result. - * - * @param[out] hash_value The generated hash value of r_entity. + * @param[in] host Host. + * @param[in] s_type Source type. + * @param[in] s_name Source name. + * @param[in] s_desc Source description. + * @param[in] name Name. + * @param[in] value Value. + * @param[out] detail_hash_value The generated hash value. * * @return "1" if osp result already exists, else "0" */ @@ -29467,7 +29469,7 @@ check_host_detail_exists (report_t report, const char *host, const char *s_type, quoted_s_name, quoted_s_desc, quoted_name, quoted_value)) { g_info ("Captured duplicate report host detail, report: %llu hash_value: %s", - report, *detail_hash_value); + report, *detail_hash_value); g_debug ("Hash string: %s", hash_string); return_value = 1; } @@ -48979,6 +48981,8 @@ DEF_ACCESS (host_identifier_iterator_os_title, /** * @brief Extra WHERE clause for host assets. * + * @param[in] filter Filter term. + * * @return WHERE clause. */ static gchar* @@ -50284,6 +50288,11 @@ setting_auto_cache_rebuild_int () current_credentials.uuid); } +/** + * @brief Return user setting as int. + * + * @return User setting. + */ static int setting_delta_reports_version_int () { @@ -54232,7 +54241,7 @@ manage_set_ldap_info (int enabled, gchar *host, gchar *authdn, /** * @brief Gets the current RADIUS secret key. * - * @param[out] is_encrypted_ret Whether the key is encrypted. NULL to ignore. + * @param[out] is_encrypted Whether the key is encrypted. NULL to ignore. * * @return Freshly allocated RADIUS secret key. */ diff --git a/src/manage_sql_configs.c b/src/manage_sql_configs.c index df83267c1..e339232ae 100644 --- a/src/manage_sql_configs.c +++ b/src/manage_sql_configs.c @@ -1696,7 +1696,11 @@ check_config_families () * * @param[in] name The name of the preference. * @param[in] value The value of the preference. - * @param[in] rebuild Whether a rebuild is happening. + * @param[in] oid The OID of the NVT. + * @param[in] id The ID of the preference. + * @param[in] type The pref_type of the preference. + * @param[in] pref_name The pref_name of the preference. + * @param[in] rebuild Whether a rebuild is happening. */ void manage_nvt_preference_add (const char *name, const char *value, diff --git a/src/manage_sql_nvts.c b/src/manage_sql_nvts.c index 0b3afad14..b921427fa 100644 --- a/src/manage_sql_nvts.c +++ b/src/manage_sql_nvts.c @@ -331,7 +331,7 @@ batch_start (int max) /** * @brief Check an SQL batch. * - * @para[in] b Batch. + * @param[in] b Batch. * * @return 1 init b->str, 0 continue as normal. */ @@ -365,7 +365,7 @@ batch_check (batch_t *b) /** * @brief End and free an SQL batch. * - * @para[in] b Batch. + * @param[in] b Batch. */ void batch_end (batch_t *b) diff --git a/src/manage_sql_secinfo.c b/src/manage_sql_secinfo.c index 8c98a2245..52c86804d 100644 --- a/src/manage_sql_secinfo.c +++ b/src/manage_sql_secinfo.c @@ -1860,6 +1860,13 @@ update_cert_bund_advisories (int last_cert_update) /* SCAP update: CPEs. */ +/** + * @brief Decode and SQL quote a CPE name. + * + * @param[in] name Name. + * + * @return Quoted name. + */ static gchar * decode_and_quote_cpe_name (const char *name) { @@ -1997,8 +2004,6 @@ insert_scap_cpe (inserts_t *inserts, element_t cpe_item, element_t item_metadata * * @param[in] inserts Pointer to SQL buffer. * @param[in] cpe_item CPE item XML element. - * @param[in] item_metadata Item's metadata element. - * @param[in] modification_time Modification time of item. * * @return 0 success, -1 error. */ From a5a9999bc094c747ca3e0752cb31d2607fead57b Mon Sep 17 00:00:00 2001 From: Matt Mundell Date: Tue, 10 Oct 2023 15:24:02 +0200 Subject: [PATCH 3/3] Convert tabs to spaces --- src/gmp.c | 4 ++-- src/gmp_license.c | 2 +- src/manage_sql_secinfo.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gmp.c b/src/gmp.c index 2e7649b7b..1264e7028 100644 --- a/src/gmp.c +++ b/src/gmp.c @@ -7714,7 +7714,7 @@ gmp_xml_handle_start_element (/* unused */ GMarkupParseContext* context, case CLIENT_LOGOUT: logout_element_start (gmp_parser, element_name, attribute_names, attribute_values); - break; + break; case CLIENT_MODIFY_LICENSE: modify_license_element_start (gmp_parser, element_name, attribute_names, attribute_values); @@ -21545,7 +21545,7 @@ gmp_xml_handle_end_element (/* unused */ GMarkupParseContext* context, create_target_data->port_list_id, create_target_data->port_range, ssh_credential, - ssh_elevate_credential, + ssh_elevate_credential, create_target_data->ssh_credential_id ? create_target_data->ssh_port : create_target_data->ssh_lsc_port, diff --git a/src/gmp_license.c b/src/gmp_license.c index 2b817bd8c..8041622d6 100644 --- a/src/gmp_license.c +++ b/src/gmp_license.c @@ -444,7 +444,7 @@ modify_license_run (gmp_parser_t *gmp_parser, "%s"), error_msg); g_free (error_msg); } - else + else { SENDF_TO_CLIENT_OR_FAIL (XML_ERROR_SYNTAX ("modify_license", diff --git a/src/manage_sql_secinfo.c b/src/manage_sql_secinfo.c index 52c86804d..2197ad142 100644 --- a/src/manage_sql_secinfo.c +++ b/src/manage_sql_secinfo.c @@ -1001,7 +1001,7 @@ init_nvt_cert_bund_adv_iterator (iterator_t *iterator, const char *oid) " WHERE cve_name IN (SELECT ref_id" " FROM vt_refs" " WHERE vt_oid = '%s'" - " AND type = 'cve'))" + " AND type = 'cve'))" " ORDER BY name DESC;", oid); } @@ -1205,7 +1205,7 @@ init_nvt_dfn_cert_adv_iterator (iterator_t *iterator, const char *oid) " WHERE cve_name IN (SELECT ref_id" " FROM vt_refs" " WHERE vt_oid = '%s'" - " AND type = 'cve'))" + " AND type = 'cve'))" " ORDER BY name DESC;", oid); }