verify.c File Reference
RPMCLI.

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

`#include "system.h"`
`#include <rpmio.h>`
`#include <rpmiotypes.h>`
`#include <rpmcb.h>`
`#include "ugid.h"`
`#include <rpmtypes.h>`
`#include <rpmtag.h>`
`#include <rpmfi.h>`
`#include "psm.h"`
`#include "legacy.h"`
`#include <rpmcli.h>`
`#include "debug.h"`
Include dependency graph for verify.c:

Go to the source code of this file.

## Macros

#define | _RPMSQ_INTERNAL
#define | _RPMPS_INTERNAL /* XXX rpmps needs iterator. */
#define | _RPMTS_INTERNAL /* XXX expose rpmtsSetScriptFd */
#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

static int | rpmVerifyFile (const rpmts ts, const rpmfi fi, rpmVerifyAttrs *res, rpmVerifyAttrs omitMask)
| Verify file attributes (including file digest). More...
static int | rpmVerifyScript (QVA_t qva, rpmts ts, rpmfi fi, FD_t scriptFd)
| Return exit code from running verify script from header. More...
static int | verifyHeader (QVA_t qva, const rpmts ts, rpmfi fi)
| Check file info from header against what's actually installed. More...
static 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)
| Display results of package verify. More...
int | rpmcliVerify (rpmts ts, QVA_t qva, const char **argv)
| Verify package install. More...

## Variables

int | _rpmds_unspecified_epoch_noise

## Detailed Description

Verify installed payload files from package metadata.

Definition in file verify.c.

## Macro Definition Documentation

#define _RPMPS_INTERNAL /* XXX rpmps needs iterator. */

Definition at line 23 of file verify.c.

#define _RPMSQ_INTERNAL

Definition at line 18 of file verify.c.

#define _RPMTS_INTERNAL /* XXX expose rpmtsSetScriptFd */

Definition at line 24 of file verify.c.

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

Referenced by verifyHeader().

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

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

Referenced by verifyHeader().

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

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

Referenced by verifyHeader().

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

Definition at line 32 of file verify.c.

Referenced by rpmVerifyFile().

## Function Documentation

static 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 244 of file verify.c.

References rpmpsm_s::progTag, PSM_SCRIPT, rpmpsmFree(), rpmpsmNew(), rpmpsmStage(), RPMTAG_SANITYCHECK, RPMTAG_SANITYCHECKPROG, RPMTAG_VERIFYSCRIPT, RPMTAG_VERIFYSCRIPTPROG, rpmtsSetScriptFd(), rpmpsm_s::scriptTag, rpmpsm_s::stepName, and rpmpsm_s::ts.

Referenced by showVerifyPackage().

static 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
  number of problems found (0 for no problems)

Definition at line 409 of file verify.c.

References _, alloca(), headerGetInstance(), rpmlog(), RPMLOG_NOTICE, rpmProblemGetAltNEVR(), rpmProblemGetPkgNEVR(), rpmpsFree(), rpmpsFreeIterator(), rpmpsInitIterator(), rpmpsNextIterator(), rpmpsNumProblems(), rpmpsProblem(), rpmtsAddEraseElement(), rpmtsAddInstallElement(), rpmtsCheck(), rpmtsEmpty(), rpmtsProblems(), and stpcpy().

Referenced by showVerifyPackage().

static 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 284 of file verify.c.

References _, _verify, _verifyfile, _verifylink, errno, rpmQVKArguments_s::qva_fflags, rpmQVKArguments_s::qva_flags, rpmQVKArguments_s::qva_mode, rpmfiFFlags(), rpmfiFN(), rpmfiInit(), RPMFILE_CONFIG, RPMFILE_DOC, RPMFILE_GHOST, RPMFILE_LICENSE, RPMFILE_MISSINGOK, RPMFILE_PUBKEY, RPMFILE_README, rpmfiLink(), rpmfiNext(), rpmfiUnlink(), rpmIsVerbose, rpmlog(), RPMLOG_NOTICE, RPMVERIFY_FDIGEST, RPMVERIFY_FILESIZE, RPMVERIFY_GROUP, RPMVERIFY_LINKTO, RPMVERIFY_LSTATFAIL, RPMVERIFY_MODE, RPMVERIFY_MTIME, RPMVERIFY_RDEV, RPMVERIFY_USER, rpmVerifyFile(), and VERIFY_ATTRS.

Referenced by showVerifyPackage().

## Variable Documentation

int _rpmds_unspecified_epoch_noise

Definition at line 122 of file rpmds.c.

Referenced by showVerifyPackage().