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 "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)
 Verify file attributes (including MD5 sum).
static int rpmVerifyScript (QVA_t qva, rpmts ts, rpmfi fi, FD_t scriptFd)
 Return exit code from running verify script from header.
static int verifyHeader (QVA_t qva, const rpmts ts, rpmfi fi)
 Check file info from header against what's actually installed.
static int verifyDependencies (QVA_t qva, rpmts ts, Header h)
 Check installed package dependencies for problems.
int showVerifyPackage (QVA_t qva, rpmts ts, Header h)
 Display results of package verify.
int rpmcliVerify (rpmts ts, QVA_t qva, const char **argv)
 Verify package install.

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)

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 (  )     (S_ISBLK((m)) || S_ISCHR((m)))

Definition at line 22 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 221 of file verify.c.

References rpmpsm_s::progTag, PSM_SCRIPT, rpmpsmFree(), rpmpsmNew(), rpmpsmStage(), 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:
0 no problems, 1 problems found

Definition at line 372 of file verify.c.

References _, alloca(), rpmProblem_s::altNEVR, rpmProblem_s::pkgNEVR, rpmps_s::probs, RPMMESS_NORMAL, rpmMessage, rpmpsFree(), rpmpsNumProblems(), 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 256 of file verify.c.

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

Referenced by showVerifyPackage().


Variable Documentation

int _rpmds_unspecified_epoch_noise

Definition at line 27 of file rpmds.c.

Referenced by rpmdsCompare(), and showVerifyPackage().


Generated on Fri Oct 12 08:44:55 2007 for rpm by  doxygen 1.5.2