rpmverify.c File Reference

rpmverify probe More...

`#include <stdio.h>`
`#include <string.h>`
`#include <errno.h>`
`#include <assert.h>`
`#include <limits.h>`
`#include <sys/types.h>`
`#include <sys/stat.h>`
`#include <fcntl.h>`
`#include <pcre.h>`
`#include <rpm/rpmdb.h>`
`#include <rpm/rpmlib.h>`
`#include <rpm/rpmts.h>`
`#include <rpm/rpmmacro.h>`
`#include <rpm/rpmlog.h>`
`#include <rpm/rpmfi.h>`
`#include <rpm/header.h>`
`#include <rpm/rpmcli.h>`
`#include <probe-api.h>`
`#include <alloc.h>`
`#include <common/assume.h>`
`#include "debug_priv.h"`
`#include "probe/entcmp.h"`

## Data Structures

struct | rpmverify_res
struct | rpmverify_global
struct | rpmverify_bhmap_t

## Macros

#define | HAVE_LIBRPM44 1 /* hack */
#define | headerFormat(_h, _fmt, _emsg) headerSprintf((_h),( _fmt), rpmTagTable, rpmHeaderFormats, (_emsg))
#define | rpmFreeCrypto() while(0)
#define | rpmFreeFilesystems() while(0)
#define | RPMVERIFY_SKIP_CONFIG 0x1000000000000000
#define | RPMVERIFY_SKIP_GHOST 0x2000000000000000
#define | RPMVERIFY_RPMATTRMASK 0x00000000ffffffff
#define | RPMVERIFY_LOCK
#define | RPMVERIFY_UNLOCK
#define | VF_RESULT(f) (res->oflags & (f) ? "not performed" : (res->vflags & RPMVERIFY_FAILURES ? "not performed" : (res->vflags & (f) ? "fail" : "pass")))
#define | FF_RESULT(f) (res->fflags & (f) ? true : false)

## Functions

void * | probe_init (void)
| Dummy probe_fini function.
void | probe_fini (void *ptr)
| Dummy probe_fini function.
int | probe_main (probe_ctx *ctx, void *arg)

## Variables

const rpmverify_bhmap_t | rpmverify_bhmap []

## Detailed Description

rpmverify probe

Author
  "Daniel Kopecek" dkope.nosp@m.cek@.nosp@m.redha.nosp@m.t.co.nosp@m.m

## Macro Definition Documentation

#define RPMVERIFY_LOCK

Value:
do { \
int prev_cancel_state = -1; \
if (pthread_mutex_lock(&g_rpm.mutex) != 0) { \
dE("Can't lock mutex\n"); \
return (-1); \
} \
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &prev_cancel_state); \
} while(0)

#define RPMVERIFY_UNLOCK

Value:
do { \
int prev_cancel_state = -1; \
if (pthread_mutex_unlock(&g_rpm.mutex) != 0) { \
dE("Can't unlock mutex. Aborting...\n"); \
abort(); \
} \
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &prev_cancel_state); \
} while(0)

## Variable Documentation

const rpmverify_bhmap_t rpmverify_bhmap[]

Initial value:
= {
{ "nodeps", (uint64_t)VERIFY_DEPS },
{ "nodigest", (uint64_t)VERIFY_DIGEST },
{ "nofiles", (uint64_t)VERIFY_FILES },
{ "noscripts", (uint64_t)VERIFY_SCRIPT },
{ "nosignature", (uint64_t)VERIFY_SIGNATURE },
{ "nolinkto", (uint64_t)VERIFY_LINKTO },
{ "nomd5", (uint64_t)VERIFY_MD5 },
{ "nosize", (uint64_t)VERIFY_SIZE },
{ "nouser", (uint64_t)VERIFY_USER },
{ "nogroup", (uint64_t)VERIFY_GROUP },
{ "nomtime", (uint64_t)VERIFY_MTIME },
{ "nomode", (uint64_t)VERIFY_MODE },
{ "nordev", (uint64_t)VERIFY_RDEV },
{ "noconfigfiles", RPMVERIFY_SKIP_CONFIG },
{ "noghostfiles", RPMVERIFY_SKIP_GHOST }
}