Greenbone Vulnerability Manager  8.0.0~git
Macros | Functions | Variables
manage_sql_secinfo.c File Reference

GVM management layer: SecInfo. More...

#include "manage_sql_secinfo.h"
#include "manage_sql.h"
#include "sql.h"
#include "utils.h"
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <fnmatch.h>
#include <ftw.h>
#include <glib/gstdio.h>
#include <gvm/base/proctitle.h>
#include <gvm/util/fileutils.h>
#include <stdlib.h>
#include <string.h>
#include <sys/file.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>

Macros

#define _GNU_SOURCE
 Enable extra GNU functions.
 
#define G_LOG_DOMAIN   "md manage"
 GLib log domain.
 

Functions

void manage_db_remove (const gchar *)
 Attach external databases. More...
 
int manage_db_init (const gchar *)
 Init external database. More...
 
static gchar * string_replace (const gchar *string, const gchar *to,...)
 Replace text in a string. More...
 
static void increment_transaction_size (int *current_size)
 Increment transaction size, commit and reset at secinfo_commit_size. More...
 
int cpe_info_count (const get_data_t *get)
 Count number of cpe. More...
 
int init_cpe_info_iterator (iterator_t *iterator, get_data_t *get, const char *name)
 Initialise a info iterator. More...
 
void init_cpe_cve_iterator (iterator_t *iterator, const char *cve, int ascending, const char *sort_field)
 Initialise an CVE iterator, for CVEs reported for a certain CPE. More...
 
gchar * cve_cvss_base (const gchar *cve)
 Get the short file name for an OVALDEF. More...
 
int cve_info_count (const get_data_t *get)
 Count number of cve. More...
 
int init_cve_info_iterator (iterator_t *iterator, get_data_t *get, const char *name)
 Initialise a info iterator. More...
 
int init_ovaldef_info_iterator (iterator_t *iterator, get_data_t *get, const char *name)
 Initialise an OVAL definition (ovaldef) info iterator. More...
 
int ovaldef_info_count (const get_data_t *get)
 Count number of ovaldef. More...
 
gchar * get_ovaldef_short_filename (char *item_id)
 Get the short file name for an OVALDEF. More...
 
char * ovaldef_uuid (const char *name, const char *fname)
 Get the uuid for an OVALDEF from a name and file name. More...
 
char * ovaldef_severity (const char *id)
 Get the severity of an OVALDEF using an ID. More...
 
char * ovaldef_version (const char *id)
 Get the version of an OVALDEF using an ID. More...
 
char * ovaldef_cves (const char *id)
 Get the CVE names of an OVALDEF as ", " separated str. More...
 
int init_cert_bund_adv_info_iterator (iterator_t *iterator, get_data_t *get, const char *name)
 Initialise an CERT-Bund advisory (cert_bund_adv) info iterator. More...
 
int cert_bund_adv_info_count (const get_data_t *get)
 Count number of cert_bund_adv. More...
 
void init_cve_cert_bund_adv_iterator (iterator_t *iterator, const char *cve, int ascending, const char *sort_field)
 Initialise CVE iterator, for CVEs referenced by a CERT-Bund advisory. More...
 
void init_nvt_cert_bund_adv_iterator (iterator_t *iterator, const char *oid, int ascending, const char *sort_field)
 Initialise an CERT-Bund iterator, for advisories relevant to a NVT. More...
 
int init_dfn_cert_adv_info_iterator (iterator_t *iterator, get_data_t *get, const char *name)
 Initialise an DFN-CERT advisory (dfn_cert_adv) info iterator. More...
 
int dfn_cert_adv_info_count (const get_data_t *get)
 Count number of dfn_cert_adv. More...
 
void init_cve_dfn_cert_adv_iterator (iterator_t *iterator, const char *cve, int ascending, const char *sort_field)
 Initialise CVE iterator, for CVEs referenced by a DFN-CERT advisory. More...
 
void init_nvt_dfn_cert_adv_iterator (iterator_t *iterator, const char *oid, int ascending, const char *sort_field)
 Initialise an DFN-CERT iterator, for advisories relevant to a NVT. More...
 
int all_info_count (const get_data_t *get)
 Count number of SecInfo entries. More...
 
int total_info_count (const get_data_t *get, int filtered)
 Count number of all SecInfo entries. More...
 
int init_all_info_iterator (iterator_t *iterator, get_data_t *get, const char *name)
 Initialise an info iterator. More...
 
void init_ovaldi_file_iterator (iterator_t *iterator)
 Initialise an ovaldi file iterator. More...
 
static int update_dfn_xml (const gchar *xml_path, int last_cert_update, int last_dfn_update)
 Update DFN-CERT info from a single XML feed file. More...
 
static int update_dfn_cert_advisories (int last_cert_update)
 Update DFN-CERTs. More...
 
static int update_bund_xml (const gchar *xml_path, int last_cert_update, int last_bund_update)
 Update CERT-Bund info from a single XML feed file. More...
 
static int update_cert_bund_advisories (int last_cert_update)
 Update CERT-Bunds. More...
 
static int update_scap_cpes (int last_scap_update)
 Update SCAP CPEs. More...
 
static int update_cve_xml (const gchar *xml_path, int last_scap_update, int last_cve_update)
 Update CVE info from a single XML feed file. More...
 
static int update_scap_cves (int last_scap_update)
 Update SCAP CVEs. More...
 
static void oval_definition_dates (entity_t definition, int *definition_date_newest, int *definition_date_oldest)
 Get last date from definition entity. More...
 
static void oval_oval_definitions_date (entity_t entity, int *file_timestamp)
 Get generator/timestamp from main oval_definitions entity. More...
 
static int verify_oval_file (const gchar *full_path)
 Verify a OVAL definitions file. More...
 
static int update_ovaldef_xml (gchar **file_and_date, int last_scap_update, int last_ovaldef_update, int private)
 Update OVALDEF info from a single XML feed file. More...
 
static gchar * oval_generator_timestamp (entity_t entity)
 Extract generator timestamp from OVAL element. More...
 
static gchar * oval_timestamp (const gchar *xml)
 Extract timestamp from OVAL XML. More...
 
static int oval_files_add (const char *path, const struct stat *stat, int flag, struct FTW *traversal)
 Add an OVAL file to oval_files. More...
 
static gint oval_files_compare (gconstpointer one, gconstpointer two)
 Compare OVAL files. More...
 
static void oval_files_free ()
 Free oval_files.
 
static int update_scap_ovaldefs (int last_scap_update, int private)
 Update SCAP OVALDEFs. More...
 
static void write_sync_start (int lockfile)
 Write start time to sync lock file. More...
 
static int manage_db_reinit (const gchar *name)
 Reinit a db. More...
 
static void sync_secinfo (sigset_t *sigmask_current, int(*update)(int), const gchar *process_title, const gchar *lockfile_basename)
 Sync a SecInfo DB. More...
 
static int manage_feed_timestamp (const gchar *name)
 Get the feed timestamp. More...
 
int check_cert_db_version ()
 Ensure CERT db is at the right version, and in the right mode. More...
 
static int update_cert_timestamp ()
 Update timestamp in CERT db from feed timestamp. More...
 
static void update_cvss_dfn_cert (int updated_dfn_cert, int last_cert_update, int last_scap_update)
 Update DFN-CERT Max CVSS. More...
 
static void update_cvss_cert_bund (int updated_cert_bund, int last_cert_update, int last_scap_update)
 Update CERT-Bund Max CVSS. More...
 
static int sync_cert (int lockfile)
 Sync the CERT DB. More...
 
void manage_sync_cert (sigset_t *sigmask_current)
 Sync the CERT DB. More...
 
int check_scap_db_version ()
 Ensure SCAP db is at the right version, and in the right mode. More...
 
static int update_scap_timestamp ()
 Update timestamp in SCAP db from feed timestamp. More...
 
static void update_scap_cvss (int updated_cves, int updated_cpes, int updated_ovaldefs)
 Update CERT-Bund Max CVSS. More...
 
static void update_scap_placeholders (int updated_cves)
 Update SCAP placeholder CVES. More...
 
static int sync_scap (int lockfile)
 Sync the SCAP DB. More...
 
void manage_sync_scap (sigset_t *sigmask_current)
 Sync the SCAP DB. More...
 
void set_secinfo_commit_size (int new_commit_size)
 Set the SecInfo update commit size. More...
 

Variables

static int secinfo_commit_size = SECINFO_COMMIT_SIZE_DEFAULT
 Commit size for updates.
 
static array_t * oval_files = NULL
 Files for update_scap_ovaldefs.
 

Detailed Description

GVM management layer: SecInfo.

The SecInfo parts of the GVM management layer.

Function Documentation

◆ all_info_count()

int all_info_count ( const get_data_t get)

Count number of SecInfo entries.

Parameters
[in]getGET params.
Returns
Total number of SecInfo entries in filtered set.

◆ cert_bund_adv_info_count()

int cert_bund_adv_info_count ( const get_data_t get)

Count number of cert_bund_adv.

Parameters
[in]getGET params.
Returns
Total number of CERT-Bund advisories in filtered set.

◆ check_cert_db_version()

int check_cert_db_version ( )

Ensure CERT db is at the right version, and in the right mode.

Returns
0 success, -1 error.

◆ check_scap_db_version()

int check_scap_db_version ( )

Ensure SCAP db is at the right version, and in the right mode.

Returns
0 success, -1 error.

◆ cpe_info_count()

int cpe_info_count ( const get_data_t get)

Count number of cpe.

Parameters
[in]getGET params.
Returns
Total number of cpes in filtered set.

◆ cve_cvss_base()

gchar* cve_cvss_base ( const gchar *  cve)

Get the short file name for an OVALDEF.

Parameters
[in]cveFull OVAL identifier with file suffix.
Returns
The file name of the OVAL definition relative to the SCAP directory, Freed by g_free.

◆ cve_info_count()

int cve_info_count ( const get_data_t get)

Count number of cve.

Parameters
[in]getGET params.
Returns
Total number of cpes in filtered set.

◆ dfn_cert_adv_info_count()

int dfn_cert_adv_info_count ( const get_data_t get)

Count number of dfn_cert_adv.

Parameters
[in]getGET params.
Returns
Total number of DFN-CERT advisories in filtered set.

◆ get_ovaldef_short_filename()

gchar* get_ovaldef_short_filename ( char *  item_id)

Get the short file name for an OVALDEF.

Parameters
[in]item_idFull OVAL identifier with file suffix.
Returns
The file name of the OVAL definition relative to the SCAP directory, Freed by g_free.

◆ increment_transaction_size()

static void increment_transaction_size ( int *  current_size)
inlinestatic

Increment transaction size, commit and reset at secinfo_commit_size.

Parameters
[in,out]current_sizePointer to current size to increment and compare.

◆ init_all_info_iterator()

int init_all_info_iterator ( iterator_t iterator,
get_data_t get,
const char *  name 
)

Initialise an info iterator.

Parameters
[in]iteratorIterator.
[in]getGET data.
[in]nameName of the info
Returns
0 success, 1 failed to find info, 2 failed to find filter, -1 error.

◆ init_cert_bund_adv_info_iterator()

int init_cert_bund_adv_info_iterator ( iterator_t iterator,
get_data_t get,
const char *  name 
)

Initialise an CERT-Bund advisory (cert_bund_adv) info iterator.

Parameters
[in]iteratorIterator.
[in]getGET data.
[in]nameName of the info
Returns
0 success, 1 failed to find target, 2 failed to find filter, -1 error.

◆ init_cpe_cve_iterator()

void init_cpe_cve_iterator ( iterator_t iterator,
const char *  cve,
int  ascending,
const char *  sort_field 
)

Initialise an CVE iterator, for CVEs reported for a certain CPE.

Parameters
[in]iteratorIterator.
[in]cveCVE.
[in]ascendingWhether to sort ascending or descending.
[in]sort_fieldField to sort on, or NULL for "id".

◆ init_cpe_info_iterator()

int init_cpe_info_iterator ( iterator_t iterator,
get_data_t get,
const char *  name 
)

Initialise a info iterator.

Parameters
[in]iteratorIterator.
[in]getGET data.
[in]nameName of the info
Returns
0 success, 1 failed to find target, 2 failed to find filter, -1 error.

◆ init_cve_cert_bund_adv_iterator()

void init_cve_cert_bund_adv_iterator ( iterator_t iterator,
const char *  cve,
int  ascending,
const char *  sort_field 
)

Initialise CVE iterator, for CVEs referenced by a CERT-Bund advisory.

Parameters
[in]iteratorIterator.
[in]cveName of the CVE.
[in]ascendingWhether to sort ascending or descending.
[in]sort_fieldField to sort on, or NULL for "id".

◆ init_cve_dfn_cert_adv_iterator()

void init_cve_dfn_cert_adv_iterator ( iterator_t iterator,
const char *  cve,
int  ascending,
const char *  sort_field 
)

Initialise CVE iterator, for CVEs referenced by a DFN-CERT advisory.

Parameters
[in]iteratorIterator.
[in]cveName of the CVE.
[in]ascendingWhether to sort ascending or descending.
[in]sort_fieldField to sort on, or NULL for "id".

◆ init_cve_info_iterator()

int init_cve_info_iterator ( iterator_t iterator,
get_data_t get,
const char *  name 
)

Initialise a info iterator.

Parameters
[in]iteratorIterator.
[in]getGET data.
[in]nameName of the info
Returns
0 success, 1 failed to find target, 2 failed to find filter, -1 error.

◆ init_dfn_cert_adv_info_iterator()

int init_dfn_cert_adv_info_iterator ( iterator_t iterator,
get_data_t get,
const char *  name 
)

Initialise an DFN-CERT advisory (dfn_cert_adv) info iterator.

Parameters
[in]iteratorIterator.
[in]getGET data.
[in]nameName of the info
Returns
0 success, 1 failed to find target, 2 failed to find filter, -1 error.

◆ init_nvt_cert_bund_adv_iterator()

void init_nvt_cert_bund_adv_iterator ( iterator_t iterator,
const char *  oid,
int  ascending,
const char *  sort_field 
)

Initialise an CERT-Bund iterator, for advisories relevant to a NVT.

Parameters
[in]iteratorIterator.
[in]oidOID of the NVT.
[in]ascendingWhether to sort ascending or descending.
[in]sort_fieldField to sort on, or NULL for "id".

◆ init_nvt_dfn_cert_adv_iterator()

void init_nvt_dfn_cert_adv_iterator ( iterator_t iterator,
const char *  oid,
int  ascending,
const char *  sort_field 
)

Initialise an DFN-CERT iterator, for advisories relevant to a NVT.

Parameters
[in]iteratorIterator.
[in]oidOID of the NVT.
[in]ascendingWhether to sort ascending or descending.
[in]sort_fieldField to sort on, or NULL for "id".

◆ init_ovaldef_info_iterator()

int init_ovaldef_info_iterator ( iterator_t iterator,
get_data_t get,
const char *  name 
)

Initialise an OVAL definition (ovaldef) info iterator.

Parameters
[in]iteratorIterator.
[in]getGET data.
[in]nameName of the info
Returns
0 success, 1 failed to find target, 2 failed to find filter, -1 error.

◆ init_ovaldi_file_iterator()

void init_ovaldi_file_iterator ( iterator_t iterator)

Initialise an ovaldi file iterator.

Parameters
[in]iteratorIterator.

◆ manage_db_init()

int manage_db_init ( const gchar *  name)

Init external database.

Parameters
[in]nameName. "cert" or "scap".
Returns
0 success, -1 error.

◆ manage_db_reinit()

static int manage_db_reinit ( const gchar *  name)
static

Reinit a db.

Parameters
[in]nameName of db.
Returns
0 success, -1 error.

◆ manage_db_remove()

void manage_db_remove ( const gchar *  name)

Attach external databases.

Parameters
[in]nameDatabase name.

Attach external databases.

Parameters
[in]nameDatabase name.

◆ manage_feed_timestamp()

static int manage_feed_timestamp ( const gchar *  name)
static

Get the feed timestamp.

Parameters
[in]nameFeed type: SCAP or CERT.
Returns
Timestamp from feed. 0 if missing. -1 on error.

◆ manage_sync_cert()

void manage_sync_cert ( sigset_t *  sigmask_current)

Sync the CERT DB.

Parameters
[in]sigmask_currentSigmask to restore in child.

◆ manage_sync_scap()

void manage_sync_scap ( sigset_t *  sigmask_current)

Sync the SCAP DB.

Parameters
[in]sigmask_currentSigmask to restore in child.

◆ oval_definition_dates()

static void oval_definition_dates ( entity_t  definition,
int *  definition_date_newest,
int *  definition_date_oldest 
)
static

Get last date from definition entity.

Parameters
[in]definitionDefinition.
[out]definition_date_newestNewest date.
[out]definition_date_oldestOldest date.

◆ oval_files_add()

static int oval_files_add ( const char *  path,
const struct stat *  stat,
int  flag,
struct FTW *  traversal 
)
static

Add an OVAL file to oval_files.

Parameters
[in]pathPath of file.
[in]statStatus of file.
[in]flagDummy arg for nftw.
[in]traversalDummy arg for nftw.
Returns
0 success, -1 error.

◆ oval_files_compare()

static gint oval_files_compare ( gconstpointer  one,
gconstpointer  two 
)
static

Compare OVAL files.

Parameters
[in]oneFirst file.
[in]twoSecond file.
Returns
0 same, 1 one is greater than two, -1 two is greater than one.

◆ oval_generator_timestamp()

static gchar* oval_generator_timestamp ( entity_t  entity)
static

Extract generator timestamp from OVAL element.

Parameters
[in]entityOVAL element.
Returns
Freshly allocated timestamp if found, else NULL.

◆ oval_oval_definitions_date()

static void oval_oval_definitions_date ( entity_t  entity,
int *  file_timestamp 
)
static

Get generator/timestamp from main oval_definitions entity.

Parameters
[in]entityEntity.
[out]file_timestampTimestamp.

◆ oval_timestamp()

static gchar* oval_timestamp ( const gchar *  xml)
static

Extract timestamp from OVAL XML.

Parameters
[in]xmlOVAL XML.
Returns
Freshly allocated timestamp, else NULL.

◆ ovaldef_cves()

char* ovaldef_cves ( const char *  id)

Get the CVE names of an OVALDEF as ", " separated str.

Parameters
[in]idOval definition ID.
Returns
String of CVEs affecting of the OVAL definition, NULL otherwise. Freed by g_free.

◆ ovaldef_info_count()

int ovaldef_info_count ( const get_data_t get)

Count number of ovaldef.

Parameters
[in]getGET params.
Returns
Total number of OVAL definitions in filtered set.

◆ ovaldef_severity()

char* ovaldef_severity ( const char *  id)

Get the severity of an OVALDEF using an ID.

Parameters
[in]idOval definition ID.
Returns
The severity of the OVAL definition from the SCAP directory. Freed by g_free.

◆ ovaldef_uuid()

char* ovaldef_uuid ( const char *  name,
const char *  fname 
)

Get the uuid for an OVALDEF from a name and file name.

Parameters
[in]nameOval definition name.
[in]fnameOval definition file name.
Returns
The OVAL definition uuid from the SCAP directory. Freed by g_free.

◆ ovaldef_version()

char* ovaldef_version ( const char *  id)

Get the version of an OVALDEF using an ID.

Parameters
[in]idOval definition ID.
Returns
The version of the OVAL definition from the SCAP directory. Freed by g_free.

◆ set_secinfo_commit_size()

void set_secinfo_commit_size ( int  new_commit_size)

Set the SecInfo update commit size.

Parameters
new_commit_sizeThe new SecInfo update commit size.

◆ string_replace()

static gchar* string_replace ( const gchar *  string,
const gchar *  to,
  ... 
)
static

Replace text in a string.

Parameters
[in]stringString to replace in.
[in]toReplacement text.
Returns
Freshly allocated string with replacements.

◆ sync_cert()

static int sync_cert ( int  lockfile)
static

Sync the CERT DB.

Parameters
[in]lockfileLock file.
Returns
0 success, -1 error.

◆ sync_scap()

static int sync_scap ( int  lockfile)
static

Sync the SCAP DB.

Parameters
[in]lockfileLock file.
Returns
0 success, -1 error.

◆ sync_secinfo()

static void sync_secinfo ( sigset_t *  sigmask_current,
int(*)(int)  update,
const gchar *  process_title,
const gchar *  lockfile_basename 
)
static

Sync a SecInfo DB.

Parameters
[in]sigmask_currentSigmask to restore in child.
[in]updateFunction to do the sync.
[in]process_titleProcess title.
[in]lockfile_basenameBasename for lockfile.

◆ total_info_count()

int total_info_count ( const get_data_t get,
int  filtered 
)

Count number of all SecInfo entries.

Parameters
[in]getGET params.
[in]filteredWhether to count entries in filtered set only.
Returns
Total number of SecInfo entries.

◆ update_bund_xml()

static int update_bund_xml ( const gchar *  xml_path,
int  last_cert_update,
int  last_bund_update 
)
static

Update CERT-Bund info from a single XML feed file.

Parameters
[in]xml_pathXML path.
[in]last_cert_updateTime of last CERT update.
[in]last_bund_updateTime of last update to a DFN.
Returns
0 nothing to do, 1 updated, -1 error.

◆ update_cert_bund_advisories()

static int update_cert_bund_advisories ( int  last_cert_update)
static

Update CERT-Bunds.

Assume that the databases are attached.

Parameters
[in]last_cert_updateTime of last CERT update from meta.
Returns
0 nothing to do, 1 updated, -1 error.

◆ update_cert_timestamp()

static int update_cert_timestamp ( )
static

Update timestamp in CERT db from feed timestamp.

Returns
0 success, -1 error.

◆ update_cve_xml()

static int update_cve_xml ( const gchar *  xml_path,
int  last_scap_update,
int  last_cve_update 
)
static

Update CVE info from a single XML feed file.

Parameters
[in]xml_pathXML path.
[in]last_scap_updateTime of last SCAP update.
[in]last_cve_updateTime of last update to a DFN.
Returns
0 nothing to do, 1 updated, -1 error.

◆ update_cvss_cert_bund()

static void update_cvss_cert_bund ( int  updated_cert_bund,
int  last_cert_update,
int  last_scap_update 
)
static

Update CERT-Bund Max CVSS.

Parameters
[in]updated_cert_bundWhether CERT-Bund updated.
[in]last_cert_updateTime of last CERT update.
[in]last_scap_updateTime of last SCAP update.

◆ update_cvss_dfn_cert()

static void update_cvss_dfn_cert ( int  updated_dfn_cert,
int  last_cert_update,
int  last_scap_update 
)
static

Update DFN-CERT Max CVSS.

Parameters
[in]updated_dfn_certWhether CERT-Bund updated.
[in]last_cert_updateTime of last CERT update.
[in]last_scap_updateTime of last SCAP update.

◆ update_dfn_cert_advisories()

static int update_dfn_cert_advisories ( int  last_cert_update)
static

Update DFN-CERTs.

Assume that the databases are attached.

Parameters
[in]last_cert_updateTime of last CERT update from meta.
Returns
0 nothing to do, 1 updated, -1 error.

◆ update_dfn_xml()

static int update_dfn_xml ( const gchar *  xml_path,
int  last_cert_update,
int  last_dfn_update 
)
static

Update DFN-CERT info from a single XML feed file.

Parameters
[in]xml_pathXML path.
[in]last_cert_updateTime of last CERT update.
[in]last_dfn_updateTime of last update to a DFN.
Returns
0 nothing to do, 1 updated, -1 error.

◆ update_ovaldef_xml()

static int update_ovaldef_xml ( gchar **  file_and_date,
int  last_scap_update,
int  last_ovaldef_update,
int  private 
)
static

Update OVALDEF info from a single XML feed file.

Parameters
[in]file_and_dateArray containing XML path and timestamp.
[in]last_scap_updateTime of last SCAP update.
[in]last_ovaldef_updateTime of last update to an ovaldef.
[in]privateWhether this is from the user's private dir.
Returns
0 nothing to do, 1 updated, -1 error.

◆ update_scap_cpes()

static int update_scap_cpes ( int  last_scap_update)
static

Update SCAP CPEs.

Parameters
[in]last_scap_updateTime of last SCAP update.
Returns
0 nothing to do, 1 updated, -1 error.

◆ update_scap_cves()

static int update_scap_cves ( int  last_scap_update)
static

Update SCAP CVEs.

Assume that the databases are attached.

Parameters
[in]last_scap_updateTime of last SCAP update from meta.
Returns
0 nothing to do, 1 updated, -1 error.

◆ update_scap_cvss()

static void update_scap_cvss ( int  updated_cves,
int  updated_cpes,
int  updated_ovaldefs 
)
static

Update CERT-Bund Max CVSS.

Parameters
[in]updated_cvesWhether CVEs were updated.
[in]updated_cpesWhether CPEs were updated.
[in]updated_ovaldefsWhether OVAL defs were updated.

◆ update_scap_ovaldefs()

static int update_scap_ovaldefs ( int  last_scap_update,
int  private 
)
static

Update SCAP OVALDEFs.

Assume that the databases are attached.

Parameters
[in]last_scap_updateTime of last SCAP update from meta.
[in]privateWhether to update private SCAP data, instead of the feed data.
Returns
0 nothing to do, 1 updated, -1 error.

◆ update_scap_placeholders()

static void update_scap_placeholders ( int  updated_cves)
static

Update SCAP placeholder CVES.

Parameters
[in]updated_cvesWhether the CVEs were updated.

◆ update_scap_timestamp()

static int update_scap_timestamp ( )
static

Update timestamp in SCAP db from feed timestamp.

Returns
0 success, -1 error.

◆ verify_oval_file()

static int verify_oval_file ( const gchar *  full_path)
static

Verify a OVAL definitions file.

Parameters
[in]full_pathFull path to the OVAL definitions file to verify.
Returns
0 if valid, else -1.

◆ write_sync_start()

static void write_sync_start ( int  lockfile)
static

Write start time to sync lock file.

Parameters
[in]lockfileLock file.