rpm  5.4.10
Macros | Functions | Variables
legacy.c File Reference
#include "system.h"
#include "rpmio_internal.h"
#include <rpmmacro.h>
#include "misc.h"
#include "legacy.h"
#include "debug.h"
Include dependency graph for legacy.c:

Go to the source code of this file.

Macros

#define alloca_strdup(_s)   strcpy(alloca(strlen(_s)+1), (_s))

Functions

static int open_dso (const char *path, pid_t *pidp, size_t *fsizep)
 Open a file descriptor to verify file MD5 and size.
int dodigest (int dalgo, const char *fn, unsigned char *digest, unsigned dflags, size_t *fsizep)
 Return digest and size of a file.

Variables

static const char hmackey [] = "orboDeJITITejsirpADONivirpUkvarP"

Detailed Description

Definition in file legacy.c.

Macro Definition Documentation

#define alloca_strdup (   _s)    strcpy(alloca(strlen(_s)+1), (_s))

Definition at line 39 of file legacy.c.

Function Documentation

int dodigest ( int  dalgo,
const char *  fn,
unsigned char *  digest,
unsigned  dflags,
size_t *  fsizep 
)

Return digest and size of a file.

Parameters
dalgodigest algorithm to use
fnfile name
Return values
*digestfile digest
Parameters
dflags0x1 = return ASCII 0x2 = do HMAC
Return values
*fsizepfile size pointer (or NULL)
Returns
0 on success, 1 on error

Definition at line 178 of file legacy.c.

References _free(), Fclose(), fdDup(), fdFiniDigest(), fdInitDigest(), fdInitHmac(), Ferror(), Fopen(), Fread(), hmackey, open_dso(), RPMDIGEST_NONE, rpmDigestFinal(), rpmDigestInit(), rpmDigestUpdate(), rpmHmacInit(), URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().

Referenced by genCpioListAndHeader(), handleOverlappedFiles(), rpmAddSignature(), rpmfiDecideFate(), and rpmvfVerify().

static int open_dso ( const char *  path,
pid_t *  pidp,
size_t *  fsizep 
)
static

Open a file descriptor to verify file MD5 and size.

Parameters
pathfile path
Return values
pidpprelink helper pid or 0
fsizepfile size
Returns
-1 on error, otherwise, an open file descriptor

Definition at line 49 of file legacy.c.

References _free(), ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN, ANNOTATE_IGNORE_READS_AND_WRITES_END, environ, rpmExpand(), and unsetenv().

Referenced by dodigest().

Variable Documentation

const char hmackey[] = "orboDeJITITejsirpADONivirpUkvarP"
static

Definition at line 176 of file legacy.c.

Referenced by dodigest().