Overview of os_eol.inc

Public Function Summary

Public functions are intended to be called by the code that imports this library.

Name Summary
build_eol_message
get_eol_date
get_eol_url

Public Function Details

build_eol_message

Named Parameters

cpe

Code

function build_eol_message(cpe) {

  if(!cpe) return "";

  eol_url = get_eol_url(cpe:cpe);
  eol_date = get_eol_date(cpe:cpe);

  message = 'The Operating System (' + cpe  + ') on the remote host has reached the end of life';
  
  if(eol_date)
    message +=  ' at ' + eol_date;

  message += '\nand should not be used anymore.';

  if(eol_url)
    message += '\nSee ' + eol_url + ' for more information.\n';

  return message;

}  


		
top

get_eol_date

Named Parameters

cpe

Code

function get_eol_date(cpe) {

  if(!cpe) return FALSE;
  if(!eol_cpes[cpe]) return FALSE;

  eol_date = eol_cpes[cpe];

  if("unknown" >< eol_date) return FALSE;

  return eol_date;

}  

function build_eol_message(cpe) {

		
top

get_eol_url

Named Parameters

cpe

Code

function get_eol_url(cpe) {

  if(!cpe) return FALSE;

  if(eol_urls[cpe]) # for some windows cpes
    return eol_urls[cpe];

  _cpe = split(cpe,sep:":",keep:FALSE);

  if (_cpe && _cpe[0] && _cpe[1] && _cpe[2] && _cpe[3]) {
    cpe = _cpe[0] + ':' + _cpe[1] + ':' + _cpe[2] + ':' + _cpe[3];
  }  

  if(":-:lts" >< cpe) # for ubuntu lts
    cpe += ':-:lts';

  if(!eol_urls[cpe]) return FALSE;

  return eol_urls[cpe];

}

function get_eol_date(cpe) {

		
top