Main Page Modules Data Structures File List Data Fields Globals Related Pages

# lib/verify.c File Reference

Verify installed payload files from package metadata. More...

`#include "system.h"`
`#include <rpmcli.h>`
`#include "psm.h"`
`#include "rpmfi.h"`
`#include "rpmts.h"`
`#include "legacy.h"`
`#include "ugid.h"`
`#include "misc.h"`
`#include "debug.h"`

Go to the source code of this file.

## Defines

#define | S_ISDEV(m) (S_ISBLK((m)) || S_ISCHR((m)))
#define | _verify(_RPMVERIFY_F, _C) ((verifyResult & _RPMVERIFY_F) ? _C : aok)
#define | _verifylink(_RPMVERIFY_F, _C)
#define | _verifyfile(_RPMVERIFY_F, _C)

## Functions

int | rpmVerifyFile (const rpmts ts, const rpmfi fi, rpmVerifyAttrs *res, rpmVerifyAttrs omitMask)
int | rpmVerifyScript (QVA_t qva, rpmts ts, rpmfi fi, FD_t scriptFd)
| Return exit code from running verify script from header. More...
int | verifyHeader (QVA_t qva, const rpmts ts, rpmfi fi)
| Check file info from header against what's actually installed. More...
int | verifyDependencies (QVA_t qva, rpmts ts, Header h)
| Check installed package dependencies for problems. More...
int | showVerifyPackage (QVA_t qva, rpmts ts, Header h)
int | rpmcliVerify (rpmts ts, QVA_t qva, const char **argv)

## Variables

int | _rpmds_unspecified_epoch_noise

## Detailed Description

Verify installed payload files from package metadata.

Definition in file verify.c.

## Define Documentation

#define _verify | ( | _RPMVERIFY_F,
|  | _C |  | ) | ((verifyResult & _RPMVERIFY_F) ? _C : aok)

#define _verifyfile | ( | _RPMVERIFY_F,
|  | _C |  | ) |

Value:

    ((verifyResult & RPMVERIFY_READFAIL) ? unknown : \
             (verifyResult & _RPMVERIFY_F) ? _C : aok)

#define _verifylink | ( | _RPMVERIFY_F,
|  | _C |  | ) |

Value:

    ((verifyResult & RPMVERIFY_READLINKFAIL) ? unknown : \
             (verifyResult & _RPMVERIFY_F) ? _C : aok)

#define S_ISDEV | ( | m |  | ) | (S_ISBLK((m)) || S_ISCHR((m)))

| Definition at line 24 of file verify.c. Referenced by rpmVerifyFile.

## Function Documentation

int rpmcliVerify | ( | rpmts | ts,
|  | QVA_t | qva,
|  | const char ** | argv
| ) |

| Definition at line 462 of file verify.c. References _RPMVSF_NODIGESTS, _RPMVSF_NOSIGNATURES, rpmExpandNumeric, rpmQueryVerify, rpmts, rpmtsEmpty, rpmtsSetVSFlags, RPMVSF_NEEDPAYLOAD, RPMVSF_NOHDRCHK, rpmVSFlags, and showVerifyPackage. Referenced by main.

int rpmVerifyFile | ( | const rpmts | ts,
|  | const rpmfi | fi,
|  | rpmVerifyAttrs * | res,
|  | rpmVerifyAttrs | omitMask
| ) |

| Definition at line 29 of file verify.c. References alloca, domd5, gidToGname, Lstat, Readlink, rpmfi, RPMFILE_GHOST, RPMFILE_STATE_NETSHARED, RPMFILE_STATE_NORMAL, RPMFILE_STATE_NOTINSTALLED, RPMFILE_STATE_REPLACED, rpmfileAttrs, rpmts, rpmtsRootDir, S_ISDEV, S_ISLNK, stpcpy, uidToUname, and uint_16. Referenced by verifyHeader.

int rpmVerifyScript | ( | QVA_t | qva,
|  | rpmts | ts,
|  | rpmfi | fi,
|  | FD_t | scriptFd
| ) | `[static]`

Return exit code from running verify script from header.

Todo:
  malloc/free/refcount handling is fishy here.

Parameters:

  qva | parsed query/verify options
  ts | transaction set
  fi | file info set
  scriptFd | file handle to use for stderr (or NULL)

Returns:
  0 on success

Definition at line 219 of file verify.c.

References rpmpsm_s::progTag, PSM_SCRIPT, rpmfi, rpmpsmFree, rpmpsmNew, rpmpsmStage, RPMTAG_VERIFYSCRIPT, RPMTAG_VERIFYSCRIPTPROG, rpmts, rpmtsSetScriptFd, rpmpsm_s::scriptTag, rpmpsm_s::stepName, and rpmpsm_s::ts.

Referenced by showVerifyPackage.

int showVerifyPackage | ( | QVA_t | qva,
|  | rpmts | ts,
|  | Header | h
| ) |

| Definition at line 422 of file verify.c. References _rpmds_unspecified_epoch_noise, Fclose, fdDup, headerIsEntry, rpmfi, RPMTAG_BASENAMES, RPMTAG_VERIFYSCRIPT, rpmts, rpmVerifyScript, verifyDependencies, and verifyHeader. Referenced by rpmcliVerify.

int verifyDependencies | ( | QVA_t | qva,
|  | rpmts | ts,
|  | Header | h
| ) | `[static]`

Check installed package dependencies for problems.

Parameters:

  qva | parsed query/verify options
  ts | transaction set
  h | header

Returns:
  0 no problems, 1 problems found

Definition at line 359 of file verify.c.

References _, alloca, rpmProblem_s::altNEVR, rpmProblem_s::pkgNEVR, rpmps_s::probs, rpmpsFree, rpmpsNumProblems, rpmts, rpmtsAddInstallElement, rpmtsCheck, rpmtsEmpty, rpmtsProblems, and stpcpy.

Referenced by showVerifyPackage.

int verifyHeader | ( | QVA_t | qva,
|  | const rpmts | ts,
|  | rpmfi | fi
| ) | `[static]`

Check file info from header against what's actually installed.

Parameters:

  qva | parsed query/verify options
  ts | transaction set
  fi | file info set

Returns:
  0 no problems, 1 problems found

Definition at line 251 of file verify.c.

References _, rpmfi, RPMFILE_CONFIG, RPMFILE_DOC, RPMFILE_GHOST, RPMFILE_LICENSE, RPMFILE_MISSINGOK, RPMFILE_README, rpmfileAttrs, rpmts, and rpmVerifyFile.

Referenced by showVerifyPackage.

## Variable Documentation

int _rpmds_unspecified_epoch_noise

| Definition at line 27 of file verify.c. Referenced by showVerifyPackage.