Open SCAP Library
Data Structures | Macros | Functions
rpminfo.c File Reference

rpminfo probe More...

#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <assert.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <regex.h>
#include <rpm/rpmdb.h>
#include <rpm/rpmlib.h>
#include <rpm/rpmts.h>
#include <rpm/rpmmacro.h>
#include <rpm/rpmlog.h>
#include <rpm/header.h>
#include <seap.h>
#include <probe-api.h>
#include <probe/probe.h>
#include <probe/option.h>
#include "probe/entcmp.h"
#include <alloc.h>
#include <common/assume.h>
#include "common/debug_priv.h"

Data Structures

struct  rpminfo_req
 
struct  rpminfo_rep
 
struct  rpminfo_global
 

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 RPMINFO_LOCK
 
#define RPMINFO_UNLOCK
 

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)
 

Detailed Description

rpminfo probe

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

2010/06/13 dkope.nosp@m.cek@.nosp@m.redha.nosp@m.t.co.nosp@m.m This probe is able to process a rpminfo_object as defined in OVAL 5.4 and 5.5.

Macro Definition Documentation

#define RPMINFO_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 RPMINFO_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)