#include "system.h"
#include "cpio.h"
#include "rpmerr.h"
#include "debug.h"
Go to the source code of this file.
Compounds | |
struct | cpioCrcPhysicalHeader |
struct | cpioHeader |
struct | hardLink |
Defines | |
#define | CPIO_NEWC_MAGIC "070701" |
#define | CPIO_CRC_MAGIC "070702" |
#define | TRAILER "TRAILER!!!" |
#define | PHYS_HDR_SIZE 110 |
#define | GET_NUM_FIELD(phys, log) |
#define | SET_NUM_FIELD(phys, val, space) |
Enumerations | |
enum | hardLinkType { HARDLINK_INSTALL = 1, HARDLINK_BUILD } |
Functions | |
off_t | saferead (FD_t cfd, void * vbuf, size_t amount) |
Read data from payload. More... | |
off_t | ourread (FD_t cfd, void * buf, size_t size) |
Read data from payload and update number of bytes read. More... | |
void | padinfd (FD_t cfd, int modulo) |
Align input payload handle, skipping input bytes. More... | |
off_t | safewrite (FD_t cfd, const void * vbuf, size_t amount) |
Write data to payload. More... | |
int | padoutfd (FD_t cfd, size_t * where, int modulo) |
Align output payload handle, padding with zeroes. More... | |
int | strntoul (const char *str, char **endptr, int base, int num) |
Convert string to unsigned integer (with buffer size check). More... | |
int | getNextHeader (FD_t cfd, struct cpioHeader * hdr) |
Process next cpio heasder. More... | |
int | cpioFileMapCmp (const void * a, const void * b) |
int | createDirectory (const char * path, mode_t perms) |
int | setInfo (struct cpioHeader * hdr) |
Set owner, group, and modify/access times. More... | |
int | checkDirectory (const char * filename) |
Create directories in file path (like "mkdir -p"). More... | |
int | expandRegular (FD_t cfd, const struct cpioHeader * hdr, const char * filemd5, cpioCallback cb, void * cbData) |
Create file from payload stream. More... | |
int | expandSymlink (FD_t cfd, const struct cpioHeader * hdr) |
Create symlink from payload stream. More... | |
int | expandFifo ( FD_t cfd, const struct cpioHeader * hdr) |
Create fifo from payload stream. More... | |
int | expandDevice ( FD_t cfd, const struct cpioHeader * hdr) |
Create fifo from payload stream. More... | |
struct hardLink* | newHardLink (const struct stat * st, enum hardLinkType hltype) |
Create and initialize set of hard links. More... | |
void | freeHardLink ( struct hardLink * li) |
Destroy set of hard links. More... | |
int | createLinks (struct hardLink * li, const char ** failedFile) |
Create hard links to existing file. More... | |
int | eatBytes (FD_t cfd, int amount) |
Skip amount bytes on input payload stream. More... | |
int | cpioInstallArchive (FD_t cfd, const struct cpioFileMapping * mappings, int numMappings, cpioCallback cb, void * cbData, const char ** failedFile) |
int | writeFile (FD_t cfd, const struct stat * st, const struct cpioFileMapping * map, size_t * sizep, int writeData) |
Write next item to payload stream. More... | |
int | writeLinkedFile (FD_t cfd, const struct hardLink * hlink, const struct cpioFileMapping * mappings, cpioCallback cb, void * cbData, size_t * sizep, const char ** failedFile) |
Write set of linked files to payload stream. More... | |
int | cpioBuildArchive (FD_t cfd, const struct cpioFileMapping * mappings, int numMappings, cpioCallback cb, void * cbData, unsigned int * archiveSize, const char ** failedFile) |
const char* | cpioStrerror (int rc) |
Definition in file cpio.c.
|
|
|
|
|
Initializer: \ log = strntoul(phys, &end, 16, sizeof(phys)); \ if (*end) return CPIOERR_BAD_HEADER; Definition at line 217 of file cpio.c. Referenced by getNextHeader(). |
|
Don't depend on sizeof(struct) |
|
Initializer: \ sprintf(space, "%8.8lx", (unsigned long) (val)); \ memcpy(phys, space, 8); Definition at line 220 of file cpio.c. Referenced by writeFile(). |
|
|
|
Create directories in file path (like "mkdir -p").
Definition at line 377 of file cpio.c. Referenced by cpioInstallArchive(). |
|
Definition at line 298 of file cpio.c. Referenced by checkDirectory(), and cpioInstallArchive(). |
|
Create hard links to existing file.
Definition at line 679 of file cpio.c. Referenced by cpioInstallArchive(). |
|
Skip amount bytes on input payload stream.
Definition at line 717 of file cpio.c. Referenced by cpioInstallArchive(). |
|
Create fifo from payload stream.
Definition at line 592 of file cpio.c. Referenced by cpioInstallArchive(). |
|
Create fifo from payload stream.
Definition at line 568 of file cpio.c. Referenced by cpioInstallArchive(). |
|
Create file from payload stream.
Definition at line 432 of file cpio.c. Referenced by cpioInstallArchive(). |
|
Create symlink from payload stream.
Definition at line 527 of file cpio.c. Referenced by cpioInstallArchive(). |
|
Destroy set of hard links.
Definition at line 653 of file cpio.c. Referenced by cpioBuildArchive(), and cpioInstallArchive(). |
|
Process next cpio heasder.
Definition at line 230 of file cpio.c. Referenced by cpioInstallArchive(). |
|
Create and initialize set of hard links.
Definition at line 618 of file cpio.c. Referenced by cpioBuildArchive(), and cpioInstallArchive(). |
|
Read data from payload and update number of bytes read.
Definition at line 117 of file cpio.c. Referenced by eatBytes(), expandRegular(), expandSymlink(), getNextHeader(), and padinfd(). |
|
Align input payload handle, skipping input bytes.
Definition at line 131 of file cpio.c. Referenced by cpioInstallArchive(), and getNextHeader(). |
|
Align output payload handle, padding with zeroes.
Definition at line 176 of file cpio.c. Referenced by cpioBuildArchive(), and writeFile(). |
|
Read data from payload.
Definition at line 89 of file cpio.c. Referenced by ourread(). |
|
Write data to payload.
Definition at line 148 of file cpio.c. Referenced by cpioBuildArchive(), padoutfd(), and writeFile(). |
|
Set owner, group, and modify/access times.
Definition at line 340 of file cpio.c. Referenced by cpioInstallArchive(). |
|
Convert string to unsigned integer (with buffer size check).
|
|
Write next item to payload stream.
Definition at line 922 of file cpio.c. Referenced by cpioBuildArchive(), and writeLinkedFile(). |
|
Write set of linked files to payload stream.
Definition at line 1076 of file cpio.c. Referenced by cpioBuildArchive(). |