#include "system.h"#include "rpmio_internal.h"#include <rpmlib.h>#include <rpmmacro.h>#include "misc.h"#include "legacy.h"#include "debug.h"

Go to the source code of this file.
Defines | |
| #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 digestalgo, const char *fn, unsigned char *digest, int asAscii, size_t *fsizep) |
| Return digest and size of a file. | |
| int | domd5 (const char *fn, unsigned char *digest, int asAscii, size_t *fsizep) |
| Return MD5 digest and size of a file. | |
| void | rpmfiBuildFNames (Header h, rpmTag tagN, const char ***fnp, int *fcp) |
| Retrieve file names from header. | |
Definition in file legacy.c.
| #define alloca_strdup | ( | _s | ) | strcpy(alloca(strlen(_s)+1), (_s)) |
| int dodigest | ( | int | digestalgo, | |
| const char * | fn, | |||
| unsigned char * | digest, | |||
| int | asAscii, | |||
| size_t * | fsizep | |||
| ) |
Return digest and size of a file.
| digestalgo | digest algorithm to use | |
| fn | file name |
| digest | address of md5sum |
| asAscii | return md5sum as ascii string? |
| *fsizep | file size pointer (or NULL) |
Definition at line 156 of file legacy.c.
References _free(), Fclose(), fdDup(), fdFiniDigest(), fdInitDigest(), Ferror(), Fopen(), Fread(), open_dso(), RPMDIGEST_NONE, rpmDigestFinal(), rpmDigestInit(), rpmDigestUpdate(), 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 domd5(), genCpioListAndHeader(), handleOverlappedFiles(), rpmAddSignature(), rpmfiDecideFate(), and rpmVerifyFile().
| int domd5 | ( | const char * | fn, | |
| unsigned char * | digest, | |||
| int | asAscii, | |||
| size_t * | fsizep | |||
| ) |
Return MD5 digest and size of a file.
| fn | file name |
| digest | address of md5sum |
| asAscii | return md5sum as ascii string? |
| *fsizep | file size pointer (or NULL) |
Definition at line 261 of file legacy.c.
References dodigest(), and PGPHASHALGO_MD5.
| static int open_dso | ( | const char * | path, | |
| pid_t * | pidp, | |||
| size_t * | fsizep | |||
| ) | [static] |
Open a file descriptor to verify file MD5 and size.
| path | file path |
| pidp | prelink helper pid or 0 | |
| fsizep | file size |
Definition at line 44 of file legacy.c.
References rpmExpand(), and unsetenv().
Referenced by dodigest().
Retrieve file names from header.
The representation of file names in package headers changed in rpm-4.0. Originally, file names were stored as an array of absolute paths. In rpm-4.0, file names are stored as separate arrays of dirname's and basename's, * with a dirname index to associate the correct dirname with each basname.
This function is used to retrieve file names independent of how the file names are represented in the package header.
| h | header | |
| tagN | RPMTAG_BASENAMES | PMTAG_ORIGBASENAMES |
| *fnp | array of file names | |
| *fcp | number of files |
Definition at line 266 of file legacy.c.
References _free(), headerFreeData(), headerGetEntryMinMemory(), RPMTAG_BASENAMES, RPMTAG_DIRINDEXES, RPMTAG_DIRNAMES, RPMTAG_ORIGBASENAMES, RPMTAG_ORIGDIRINDEXES, RPMTAG_ORIGDIRNAMES, stpcpy(), urlPath(), and xmalloc().
Referenced by _fnTag(), expandFilelist(), fssizesTag(), mungeFilelist(), rpmHeaderGetEntry(), rpmInstallSourcePackage(), and rpmpsmStage().
1.5.7.1