Skip to content

Commit

Permalink
Remove: script_bugtraq_id completely (#1124)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kraemii committed Jul 21, 2022
1 parent 627a519 commit 8f1dfff
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 51 deletions.
8 changes: 0 additions & 8 deletions nasl/lint.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,14 +402,6 @@ validate_function (lex_ctxt *lexic, tree_cell *st)
{
if (!g_strcmp0 (st->x.str_val, "script_xref"))
return validate_script_xref (lexic, st->link[0]);
if (!g_strcmp0 (st->x.str_val, "script_bugtraq_id"))
{
nasl_perror (lexic,
"WARNING: use of unsupported function"
" script_bugtraq_id() - please use"
" script_xref(name:\"URL\", value:\"\") instead.\n");
return FAKE_CELL;
}
}
else
return NULL;
Expand Down
3 changes: 0 additions & 3 deletions nasl/nasl_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ static init_func libfuncs[] = {
{"script_get_preference_file_location", script_get_preference_file_location},
{"script_oid", script_oid},
{"script_cve_id", script_cve_id},
{"script_bugtraq_id",
script_bugtraq_id_dummy}, // Replace original script_bugtraq_id to
// ignore it
{"script_xref", script_xref},
{"script_tag", script_tag},
{"vendor_version", nasl_vendor_version},
Expand Down
36 changes: 2 additions & 34 deletions nasl/nasl_scanner_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,32 +136,6 @@ script_cve_id (lex_ctxt *lexic)
return FAKE_CELL;
}

tree_cell *
script_bugtraq_id (lex_ctxt *lexic)
{
struct script_infos *script_infos = lexic->script_infos;
char *bid = get_str_var_by_num (lexic, 0);
int i;

for (i = 0; bid != NULL; i++)
{
nvti_add_vtref (script_infos->nvti, vtref_new ("bid", bid, ""));
bid = get_str_var_by_num (lexic, i + 1);
}

return FAKE_CELL;
}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
// The unspecific () is on purpose, therefore ignoring missing_prototype
tree_cell *
script_bugtraq_id_dummy ()
{
return FAKE_CELL;
}
#pragma GCC diagnostic pop

/**
* @brief Add a cross reference to the meta data.
*
Expand All @@ -171,18 +145,12 @@ script_bugtraq_id_dummy ()
* Alternative to "value", "csv" can be used with a
* list of comma-separated values.
*
* In fact, if name is "cve" or "bid", it is equivalent
* to call script_cve_id() or script_bugtraq_id(), for example
* In fact, if name is "cve", it is equivalent
* to call script_cve_id(), for example
* script_cve_id ("CVE-2019-12345");
* is identical to
* script_xref (name: "cve", value: "CVE-2019-12345");
*
* And also:
* script_bugtraq_id (12345);
* is identical to
* script_xref (name: "bid", value: "12345");
* (watch out that the number now needs to be a string).
*
* This even works with multiple comma-separated elements like
* script_xref (name: "cve", csv: "CVE-2019-12345,CVE-2019-54321");
*
Expand Down
6 changes: 0 additions & 6 deletions nasl/nasl_scanner_glue.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ script_oid (lex_ctxt *);
tree_cell *
script_cve_id (lex_ctxt *);

tree_cell *
script_bugtraq_id (lex_ctxt *);

tree_cell *
script_bugtraq_id_dummy ();

tree_cell *
script_xref (lex_ctxt *);

Expand Down

0 comments on commit 8f1dfff

Please sign in to comment.