Overview of pkg-lib-hpux.inc

Public Function Summary

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

Name Summary
ishpuxpkgvuln

Public Function Details

ishpuxpkgvuln

Named Parameters

patch_list
pkg
revision
rls

Code

function ishpuxpkgvuln(pkg, revision, patch_list, rls) {
  local_var kbrls, rpms, pat, matches, rc, report;

  # Check that we have the data for this release.
  kbrls = get_kb_item("ssh/login/release");
  if(kbrls!=rls) {
    return NULL;
  }

  pkgs_rev = get_kb_item("ssh/login/hp_pkgrev");
  inst_rev = eregmatch(pattern:pkg + "(	+)?([a-zA-Z0-9.]+) ",
                       string:chomp(pkgs_rev));
  if(isnull(inst_rev)) {
    return NULL;
  }

  __pkg_match = TRUE;

  if(patch_list != NULL)
  {
    patches = get_kb_item("ssh/login/hp_pkgsupersedes");
      foreach patch (patch_list)
      {
        if(patch >!< patches){
          return "";
        }
      }
    return NULL;
  }

  rc = revcomp(a:inst_rev[2], b:revision);

  if(rc < 0)
  {
    report = 'Package ' + pkg + ' version ' +
             inst_rev[2] + ' is installed which is known to be vulnerable.\n';
    return report;
  }
  return NULL;
}


		
top