rpm 5.3.12
|
![]() |
Data Structures | |
struct | dnli_s |
Directory name iterator. More... | |
struct | arHeader_s |
ar(1) archive header. More... | |
struct | cpioCrcPhysicalHeader_s |
Cpio archive header information. More... | |
struct | hardLink_s |
Keeps track of the set of all hard links to a file in an archive. More... | |
struct | iosmIterator_s |
Iterator across package file info, forward on install, backward on erase. More... | |
struct | iosm_s |
File name and stat information. More... | |
struct | tarHeader_s |
Tar archive header information. More... | |
Files | |
file | fsm.c |
File state machine to handle a payload from a package. | |
file | fsm.h |
File state machine to handle a payload within an rpm package. | |
file | psm.c |
Package state machine to handle a package from a transaction set. | |
file | psm.h |
Package state machine to handle a package from a transaction set. | |
file | rpmlib.h |
In Memoriam: Steve Taylor <staylor@redhat.com> was here, now he's not. | |
file | ar.c |
Handle ar(1) archives. | |
file | ar.h |
Structures used for ar(1) archives. | |
file | cpio.c |
Handle cpio(1) archives. | |
file | cpio.h |
Structures used for cpio(1) archives. | |
file | iosm.c |
File state machine to handle a payload from a package. | |
file | iosm.h |
File state machine to handle archive I/O and system call's. | |
file | tar.c |
Handle ustar archives. | |
file | tar.h |
Structures used for tar(1) archives. | |
Defines | |
#define | IOSMERR_CHECK_ERRNO 0x00008000 |
Typedefs | |
typedef struct dnli_s * | DNLI_t |
Directory name iterator. | |
typedef struct iosm_s * | FSM_t |
File state machine data. | |
typedef struct iosmIterator_s * | FSMI_t |
Iterator across package file info, forward on install, backward on erase. | |
typedef struct dnli_s * | DNLI_t |
Directory name iterator. | |
typedef struct iosm_s * | IOSM_t |
File state machine data. | |
typedef enum iosmMapFlags_e | iosmMapFlags |
typedef struct iosmIterator_s * | IOSMI_t |
Iterator across package file info, forward on install, backward on erase. | |
Enumerations | |
enum | iosmMapFlags_e { IOSM_MAP_PATH = (1 << 0), IOSM_MAP_MODE = (1 << 1), IOSM_MAP_UID = (1 << 2), IOSM_MAP_GID = (1 << 3), IOSM_FOLLOW_SYMLINKS = (1 << 4), IOSM_MAP_ABSOLUTE = (1 << 5), IOSM_MAP_ADDDOT = (1 << 6), IOSM_ALL_HARDLINKS = (1 << 7), IOSM_MAP_TYPE = (1 << 8), IOSM_SBIT_CHECK = (1 << 9), IOSM_PAYLOAD_LIST = (1 << 10), IOSM_PAYLOAD_EXTRACT = (1 << 11), IOSM_PAYLOAD_CREATE = (1 << 12) } |
enum | iosmErrorReturns_e { IOSMERR_BAD_MAGIC = (2 ), IOSMERR_BAD_HEADER = (3 ), IOSMERR_OPEN_FAILED = (4 | 0x00008000 ), IOSMERR_CHMOD_FAILED = (5 | 0x00008000 ), IOSMERR_CHOWN_FAILED = (6 | 0x00008000 ), IOSMERR_WRITE_FAILED = (7 | 0x00008000 ), IOSMERR_UTIME_FAILED = (8 | 0x00008000 ), IOSMERR_UNLINK_FAILED = (9 | 0x00008000 ), IOSMERR_RENAME_FAILED = (10 | 0x00008000 ), IOSMERR_SYMLINK_FAILED = (11 | 0x00008000 ), IOSMERR_STAT_FAILED = (12 | 0x00008000 ), IOSMERR_LSTAT_FAILED = (13 | 0x00008000 ), IOSMERR_MKDIR_FAILED = (14 | 0x00008000 ), IOSMERR_RMDIR_FAILED = (15 | 0x00008000 ), IOSMERR_MKNOD_FAILED = (16 | 0x00008000 ), IOSMERR_MKFIFO_FAILED = (17 | 0x00008000 ), IOSMERR_LINK_FAILED = (18 | 0x00008000 ), IOSMERR_READLINK_FAILED = (19 | 0x00008000 ), IOSMERR_READ_FAILED = (20 | 0x00008000 ), IOSMERR_COPY_FAILED = (21 | 0x00008000 ), IOSMERR_LSETFCON_FAILED = (22 | 0x00008000 ), IOSMERR_HDR_SIZE = (23 ), IOSMERR_HDR_TRAILER = (24 ), IOSMERR_UNKNOWN_FILETYPE = (25 ), IOSMERR_MISSING_HARDLINK = (26 ), IOSMERR_DIGEST_MISMATCH = (27 ), IOSMERR_INTERNAL = (28 ), IOSMERR_UNMAPPED_FILE = (29 ), IOSMERR_ENOENT = (30 ), IOSMERR_ENOTEMPTY = (31 ) } |
Functions | |
static const char * | fsmFsPath (const IOSM_t fsm, const struct stat *st, const char *subdir, const char *suffix) |
Build path to file from file info, ornamented with subdir and suffix. | |
static void * | mapFreeIterator (void *p) |
Destroy file info iterator. | |
static void * | mapInitIterator (rpmfi fi, int reverse) |
Create file info iterator. | |
static int | mapNextIterator (void *a) |
Return next index into file info. | |
static int | cpioStrCmp (const void *a, const void *b) |
static int | mapFind (FSMI_t iter, const char *fsmPath) |
Locate archive path in file info. | |
static void * | dnlFreeIterator (const void *a) |
Destroy directory name iterator. | |
static int | dnlCount (const DNLI_t dnli) |
static int | dnlIndex (const DNLI_t dnli) |
static void * | dnlInitIterator (const IOSM_t fsm, int reverse) |
Create directory name iterator. | |
static const char * | dnlNextIterator (DNLI_t dnli) |
Return next directory name (from file info). | |
static int | saveHardLink (IOSM_t fsm) |
Save hard link in chain. | |
static void * | freeHardLink (struct hardLink_s *li) |
Destroy set of hard links. | |
static int | extractRegular (IOSM_t fsm) |
Create file from payload stream. | |
static int | writeFile (IOSM_t fsm, int writeData) |
Write next item to payload stream. | |
static int | writeLinkedFile (IOSM_t fsm) |
Write set of linked files to payload stream. | |
static int | fsmMakeLinks (IOSM_t fsm) |
Create pending hard links to existing file. | |
static int | fsmCommitLinks (IOSM_t fsm) |
Commit hard linked file set atomically. | |
static const char * | iosmFsPath (const IOSM_t iosm, const struct stat *st, const char *subdir, const char *suffix) |
Build path to file from file info, ornamented with subdir and suffix. | |
static int | iosmStrCmp (const void *a, const void *b) |
static int | iosmMakeLinks (IOSM_t iosm) |
Create pending hard links to existing file. | |
static int | iosmCommitLinks (IOSM_t iosm) |
Commit hard linked file set atomically. | |
char * | iosmStrerror (int rc) |
Return formatted error message on payload handling failure. |
#define IOSMERR_CHECK_ERRNO 0x00008000 |
Definition at line 64 of file iosm.h.
Referenced by iosmStrerror().
typedef struct iosmIterator_s* FSMI_t |
typedef struct iosmIterator_s* IOSMI_t |
typedef enum iosmMapFlags_e iosmMapFlags |
enum iosmErrorReturns_e |
enum iosmMapFlags_e |
static int cpioStrCmp | ( | const void * | a, |
const void * | b | ||
) | [static] |
static int dnlCount | ( | const DNLI_t | dnli | ) | [inline, static] |
Definition at line 286 of file fsm.c.
References dnli_s::fi.
Referenced by fsmMkdirs(), fsmRmdirs(), iosmMkdirs(), and iosmRmdirs().
static void * dnlFreeIterator | ( | const void * | a | ) | [static] |
Destroy directory name iterator.
a | directory name iterator |
NULL | always |
Definition at line 274 of file fsm.c.
References _free(), and dnli_s::active.
Referenced by fsmMkdirs(), fsmRmdirs(), iosmMkdirs(), and iosmRmdirs().
static int dnlIndex | ( | const DNLI_t | dnli | ) | [inline, static] |
Definition at line 294 of file fsm.c.
References dnli_s::isave.
Referenced by fsmMkdirs(), fsmRmdirs(), iosmMkdirs(), and iosmRmdirs().
static void * dnlInitIterator | ( | const IOSM_t | iosm, |
int | reverse | ||
) | [static] |
Create directory name iterator.
fsm | file state machine data |
reverse | traverse directory names in reverse order? |
iosm | file state machine data |
reverse | traverse directory names in reverse order? |
Definition at line 308 of file fsm.c.
References dnli_s::active, D_, dnli_s::fi, fsmGetFi(), dnli_s::i, iosmFileActionSkipped(), reverse, dnli_s::reverse, rpmfiInit(), rpmfiNext(), rpmlog(), RPMLOG_DEBUG, urlPath(), and xcalloc().
Referenced by fsmMkdirs(), fsmRmdirs(), iosmMkdirs(), and iosmRmdirs().
static const char * dnlNextIterator | ( | DNLI_t | dnli | ) | [static] |
Return next directory name (from file info).
dnli | directory name iterator |
Definition at line 395 of file fsm.c.
References dnli_s::active, dnli_s::fi, dnli_s::i, dnli_s::isave, and dnli_s::reverse.
Referenced by fsmMkdirs(), fsmRmdirs(), iosmMkdirs(), and iosmRmdirs().
static int extractRegular | ( | IOSM_t | iosm | ) | [static] |
Create file from payload stream.
fsm | file state machine data |
iosm | file state machine data |
Definition at line 974 of file fsm.c.
References iosm_s::digest, iosm_s::digestlen, iosm_s::fdigestalgo, fsmGetTs(), iosm_s::path, rpmtsGetRdb(), and iosm_s::sb.
Referenced by fsmStage(), and iosmStage().
static void * freeHardLink | ( | struct hardLink_s * | li | ) | [static] |
Destroy set of hard links.
li | set of hard links |
Definition at line 533 of file fsm.c.
References _free(), hardLink_s::filex, and hardLink_s::nsuffix.
Referenced by freeFSM(), freeIOSM(), fsmStage(), and iosmStage().
static int fsmCommitLinks | ( | IOSM_t | fsm | ) | [static] |
Commit hard linked file set atomically.
fsm | file state machine data |
Definition at line 1338 of file fsm.c.
References _free(), iosm_s::action, hardLink_s::filex, fsmNext(), IOSM_COMMIT, IOSM_MAP, iosmFileActionSkipped(), iosm_s::ix, iosm_s::li, iosm_s::links, hardLink_s::next, hardLink_s::nlink, iosm_s::nsuffix, iosm_s::path, hardLink_s::sb, and iosm_s::sb.
Referenced by fsmStage().
static const char* fsmFsPath | ( | const IOSM_t | fsm, |
const struct stat * | st, | ||
const char * | subdir, | ||
const char * | suffix | ||
) | [static] |
Build path to file from file info, ornamented with subdir and suffix.
fsm | file state machine data |
st | file stat info |
subdir | subdir to use (NULL disables) |
suffix | suffix to use (NULL disables) |
path | to file |
Definition at line 102 of file fsm.c.
References iosm_s::baseName, iosm_s::dirName, stpcpy(), and xmalloc().
Referenced by fsmMapPath(), and fsmStage().
static int fsmMakeLinks | ( | IOSM_t | fsm | ) | [static] |
Create pending hard links to existing file.
fsm | file state machine data |
Definition at line 1277 of file fsm.c.
References _free(), iosm_s::action, hardLink_s::createdPath, iosm_s::failedFile, hardLink_s::filex, fsmNext(), fsmUNSAFE, IOSM_LINK, IOSM_MAP, IOSM_VERIFY, IOSMERR_ENOENT, iosmFileActionSkipped(), iosm_s::ix, iosm_s::li, hardLink_s::linksLeft, hardLink_s::nlink, iosm_s::nsuffix, iosm_s::opath, iosm_s::path, and xstrdup().
Referenced by fsmStage().
static int iosmCommitLinks | ( | IOSM_t | iosm | ) | [static] |
Commit hard linked file set atomically.
iosm | file state machine data |
Definition at line 1372 of file iosm.c.
References _free(), iosm_s::action, hardLink_s::filex, IOSM_COMMIT, IOSM_MAP, iosmFileActionSkipped(), iosmNext(), iosm_s::ix, iosm_s::li, iosm_s::links, hardLink_s::next, hardLink_s::nlink, iosm_s::nsuffix, iosm_s::path, hardLink_s::sb, and iosm_s::sb.
Referenced by iosmStage().
static const char* iosmFsPath | ( | const IOSM_t | iosm, |
const struct stat * | st, | ||
const char * | subdir, | ||
const char * | suffix | ||
) | [static] |
Build path to file from file info, ornamented with subdir and suffix.
iosm | file state machine data |
st | file stat info |
subdir | subdir to use (NULL disables) |
suffix | suffix to use (NULL disables) |
path | to file |
Definition at line 111 of file iosm.c.
References iosm_s::baseName, iosm_s::dirName, stpcpy(), and xmalloc().
Referenced by iosmMapPath(), and iosmStage().
static int iosmMakeLinks | ( | IOSM_t | iosm | ) | [static] |
Create pending hard links to existing file.
iosm | file state machine data |
Definition at line 1311 of file iosm.c.
References _free(), iosm_s::action, hardLink_s::createdPath, iosm_s::failedFile, hardLink_s::filex, IOSM_LINK, IOSM_MAP, IOSM_VERIFY, IOSMERR_ENOENT, iosmFileActionSkipped(), iosmNext(), iosmUNSAFE, iosm_s::ix, iosm_s::li, hardLink_s::linksLeft, hardLink_s::nlink, iosm_s::nsuffix, iosm_s::opath, iosm_s::path, and xstrdup().
Referenced by iosmStage().
static int iosmStrCmp | ( | const void * | a, |
const void * | b | ||
) | [static] |
char* iosmStrerror | ( | int | rc | ) |
Return formatted error message on payload handling failure.
rc | error code |
Definition at line 2765 of file iosm.c.
References _, errno, IOSMERR_BAD_HEADER, IOSMERR_BAD_MAGIC, IOSMERR_CHECK_ERRNO, IOSMERR_CHMOD_FAILED, IOSMERR_CHOWN_FAILED, IOSMERR_COPY_FAILED, IOSMERR_DIGEST_MISMATCH, IOSMERR_ENOENT, IOSMERR_ENOTEMPTY, IOSMERR_HDR_SIZE, IOSMERR_INTERNAL, IOSMERR_LINK_FAILED, IOSMERR_LSETFCON_FAILED, IOSMERR_LSTAT_FAILED, IOSMERR_MISSING_HARDLINK, IOSMERR_MKDIR_FAILED, IOSMERR_MKFIFO_FAILED, IOSMERR_MKNOD_FAILED, IOSMERR_OPEN_FAILED, IOSMERR_READ_FAILED, IOSMERR_READLINK_FAILED, IOSMERR_RENAME_FAILED, IOSMERR_RMDIR_FAILED, IOSMERR_STAT_FAILED, IOSMERR_SYMLINK_FAILED, IOSMERR_UNKNOWN_FILETYPE, IOSMERR_UNLINK_FAILED, IOSMERR_UNMAPPED_FILE, IOSMERR_UTIME_FAILED, IOSMERR_WRITE_FAILED, and xstrdup().
Referenced by cpio_doio(), and rpmpsmStage().
static int mapFind | ( | FSMI_t | iter, |
const char * | iosmPath | ||
) | [static] |
Locate archive path in file info.
iter | file info iterator |
fsmPath | archive path |
iter | file info iterator |
iosmPath | archive path |
Definition at line 232 of file fsm.c.
References cpioStrCmp(), iosmIterator_s::fi, iosmIterator_s::i, mapNextIterator(), and rpmfiFC().
Referenced by fsmStage(), and iosmStage().
static void * mapFreeIterator | ( | void * | p | ) | [static] |
Destroy file info iterator.
p | file info iterator |
NULL | always |
Definition at line 134 of file fsm.c.
References _free(), iosmIterator_s::fi, rpmfiUnlink(), rpmtsFree(), and iosmIterator_s::ts.
Referenced by freeFSM(), freeIOSM(), fsmTeardown(), and iosmTeardown().
static void * mapInitIterator | ( | rpmfi | fi, |
int | reverse | ||
) | [static] |
Create file info iterator.
fi | transaction element file info |
reverse | iterate in reverse order? |
Definition at line 156 of file fsm.c.
References iosmIterator_s::fi, iosmIterator_s::i, iosmIterator_s::isave, reverse, iosmIterator_s::reverse, rpmfiLink(), and xcalloc().
Referenced by fsmSetup(), and iosmSetup().
static int mapNextIterator | ( | void * | a | ) | [static] |
Return next index into file info.
a | file info iterator |
Definition at line 176 of file fsm.c.
References iosmIterator_s::fi, iosmIterator_s::i, iosmIterator_s::isave, and iosmIterator_s::reverse.
Referenced by fsmStage(), iosmStage(), and mapFind().
static int saveHardLink | ( | IOSM_t | iosm | ) | [static] |
Save hard link in chain.
fsm | file state machine data |
iosm | file state machine data |
Definition at line 447 of file fsm.c.
References _free(), hardLink_s::createdPath, hardLink_s::filex, fsmGetFi(), fsmNext(), iosm_s::goal, IOSM_MAP, IOSM_PKGBUILD, IOSM_PKGINSTALL, iosmFileActionSkipped(), iosm_s::ix, iosm_s::li, hardLink_s::linkIndex, iosm_s::links, hardLink_s::linksLeft, hardLink_s::next, hardLink_s::nlink, iosm_s::nsuffix, hardLink_s::nsuffix, iosm_s::path, hardLink_s::sb, iosm_s::sb, and xcalloc().
Referenced by fsmStage(), and iosmStage().
static int writeFile | ( | IOSM_t | iosm, |
int | writeData | ||
) | [static] |
Write next item to payload stream.
fsm | file state machine data |
writeData | should data be written? |
iosm | file state machine data |
writeData | should data be written? |
Definition at line 1068 of file fsm.c.
References alloca(), iosm_s::baseName, iosm_s::dirName, Fileno(), fsmGetFi(), fsmNext(), fsmUNSAFE, IOSM_DWRITE, IOSM_HWRITE, IOSM_MAP_ABSOLUTE, IOSM_MAP_ADDDOT, IOSM_MAP_PATH, IOSM_PAD, IOSM_RCLOSE, IOSM_READ, IOSM_READLINK, IOSM_ROPEN, iosm_s::ix, iosm_s::lpath, iosm_s::mapFlags, iosm_s::opath, iosm_s::osb, iosm_s::path, iosm_s::rdbuf, iosm_s::rdlen, iosm_s::rdnb, iosm_s::rdsize, iosm_s::rfd, S_ISLNK, iosm_s::sb, stpcpy(), urlPath(), iosm_s::wrnb, and xstrdup().
Referenced by fsmStage(), iosmStage(), and writeLinkedFile().
static int writeLinkedFile | ( | IOSM_t | iosm | ) | [static] |
Write set of linked files to payload stream.
fsm | file state machine data |
iosm | file state machine data |
Definition at line 1203 of file fsm.c.
References _free(), iosm_s::astriplen, iosm_s::failedFile, hardLink_s::filex, fsmNext(), iosm_s::headerWrite, IOSM_MAP, iosm_s::ix, iosm_s::li, iosm_s::lpath, hardLink_s::nlink, iosm_s::nsuffix, iosm_s::path, stpcpy(), tarHeaderWrite(), urlPath(), writeFile(), xmalloc(), and xstrdup().
Referenced by fsmStage(), and iosmStage().