rpm
5.4.10
|
File state machine to handle archive I/O and system call's. More...
Go to the source code of this file.
Data Structures | |
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... | |
Macros | |
#define | _IOSM_INTERNAL /* XXX expose internals for unit tests. */ |
#define | IOSMERR_CHECK_ERRNO 0x00008000 |
#define | IOSM_VERBOSE 0x8000 |
#define | IOSM_INTERNAL 0x4000 |
#define | IOSM_SYSCALL 0x2000 |
#define | IOSM_DEAD 0x1000 |
#define | _fv(_a) ((_a) | IOSM_VERBOSE) |
#define | _fi(_a) ((_a) | IOSM_INTERNAL) |
#define | _fs(_a) ((_a) | (IOSM_INTERNAL | IOSM_SYSCALL)) |
#define | _fd(_a) ((_a) | (IOSM_INTERNAL | IOSM_DEAD)) |
Typedefs | |
typedef struct iosm_s * | IOSM_t |
File state machine data. More... | |
typedef enum iosmFileAction_e | iosmFileAction |
File disposition(s) during package install/erase processing. More... | |
typedef enum iosmMapFlags_e | iosmMapFlags |
typedef enum iosmFileStage_e | iosmFileStage |
typedef struct iosmIterator_s * | IOSMI_t |
Iterator across package file info, forward on install, backward on erase. More... | |
Enumerations | |
enum | iosmFileAction_e { FA_UNKNOWN = 0, FA_CREATE, FA_COPYIN, FA_COPYOUT, FA_BACKUP, FA_SAVE, FA_SKIP, FA_ALTNAME, FA_ERASE, FA_SKIPNSTATE, FA_SKIPNETSHARED, FA_SKIPCOLOR } |
File disposition(s) during package install/erase processing. More... | |
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 ) } |
enum | iosmFileStage_e { IOSM_UNKNOWN = 0, IOSM_INIT = (( 1 ) | ( 0x4000 | 0x1000 )), IOSM_PRE = (( 2 ) | ( 0x4000 | 0x1000 )), IOSM_PROCESS = (( 3 ) | 0x8000 ), IOSM_POST = (( 4 ) | ( 0x4000 | 0x1000 )), IOSM_UNDO = 5, IOSM_FINI = 6, IOSM_PKGINSTALL = (( 7 ) | ( 0x4000 | 0x1000 )), IOSM_PKGERASE = (( 8 ) | ( 0x4000 | 0x1000 )), IOSM_PKGBUILD = (( 9 ) | ( 0x4000 | 0x1000 )), IOSM_PKGCOMMIT = (( 10 ) | ( 0x4000 | 0x1000 )), IOSM_PKGUNDO = (( 11 ) | ( 0x4000 | 0x1000 )), IOSM_CREATE = (( 17 ) | ( 0x4000 | 0x1000 )), IOSM_MAP = (( 18 ) | ( 0x4000 | 0x1000 )), IOSM_MKDIRS = (( 19 ) | 0x4000 ), IOSM_RMDIRS = (( 20 ) | 0x4000 ), IOSM_MKLINKS = (( 21 ) | 0x4000 ), IOSM_NOTIFY = (( 22 ) | ( 0x4000 | 0x1000 )), IOSM_DESTROY = (( 23 ) | ( 0x4000 | 0x1000 )), IOSM_VERIFY = (( 24 ) | ( 0x4000 | 0x1000 )), IOSM_COMMIT = (( 25 ) | ( 0x4000 | 0x1000 )), IOSM_UNLINK = (( 33 ) | ( 0x4000 | 0x2000 )), IOSM_RENAME = (( 34 ) | ( 0x4000 | 0x2000 )), IOSM_MKDIR = (( 35 ) | ( 0x4000 | 0x2000 )), IOSM_RMDIR = (( 36 ) | ( 0x4000 | 0x2000 )), IOSM_LSETFCON = (( 39 ) | ( 0x4000 | 0x2000 )), IOSM_CHOWN = (( 40 ) | ( 0x4000 | 0x2000 )), IOSM_LCHOWN = (( 41 ) | ( 0x4000 | 0x2000 )), IOSM_CHMOD = (( 42 ) | ( 0x4000 | 0x2000 )), IOSM_UTIME = (( 43 ) | ( 0x4000 | 0x2000 )), IOSM_SYMLINK = (( 44 ) | ( 0x4000 | 0x2000 )), IOSM_LINK = (( 45 ) | ( 0x4000 | 0x2000 )), IOSM_MKFIFO = (( 46 ) | ( 0x4000 | 0x2000 )), IOSM_MKNOD = (( 47 ) | ( 0x4000 | 0x2000 )), IOSM_LSTAT = (( 48 ) | ( 0x4000 | 0x2000 )), IOSM_STAT = (( 49 ) | ( 0x4000 | 0x2000 )), IOSM_READLINK = (( 50 ) | ( 0x4000 | 0x2000 )), IOSM_CHROOT = (( 51 ) | ( 0x4000 | 0x2000 )), IOSM_NEXT = (( 65 ) | ( 0x4000 | 0x1000 )), IOSM_EAT = (( 66 ) | ( 0x4000 | 0x1000 )), IOSM_POS = (( 67 ) | ( 0x4000 | 0x1000 )), IOSM_PAD = (( 68 ) | ( 0x4000 | 0x1000 )), IOSM_TRAILER = (( 69 ) | ( 0x4000 | 0x1000 )), IOSM_HREAD = (( 70 ) | ( 0x4000 | 0x1000 )), IOSM_HWRITE = (( 71 ) | ( 0x4000 | 0x1000 )), IOSM_DREAD = (( 72 ) | ( 0x4000 | 0x2000 )), IOSM_DWRITE = (( 73 ) | ( 0x4000 | 0x2000 )), IOSM_ROPEN = (( 129 ) | ( 0x4000 | 0x2000 )), IOSM_READ = (( 130 ) | ( 0x4000 | 0x2000 )), IOSM_RCLOSE = (( 131 ) | ( 0x4000 | 0x2000 )), IOSM_WOPEN = (( 132 ) | ( 0x4000 | 0x2000 )), IOSM_WRITE = (( 133 ) | ( 0x4000 | 0x2000 )), IOSM_WCLOSE = (( 134 ) | ( 0x4000 | 0x2000 )) } |
Functions | |
const char * | iosmFileStageString (iosmFileStage a) |
Return formatted string representation of file stages. More... | |
const char * | iosmFileActionString (iosmFileAction a) |
Return formatted string representation of file disposition. More... | |
char * | iosmStrerror (int rc) |
Return formatted error message on payload handling failure. More... | |
IOSM_t | newIOSM (void) |
Create I/O state machine instance. More... | |
IOSM_t | freeIOSM (IOSM_t iosm) |
Destroy I/O state machine instance. More... | |
int | iosmSetup (IOSM_t iosm, iosmFileStage goal, const char *afmt, const void *_ts, const void *_fi, FD_t cfd, unsigned int *archiveSize, const char **failedFile) |
Load external data into I/O state machine. More... | |
int | iosmTeardown (IOSM_t iosm) |
Clean I/O state machine. More... | |
void * | iosmGetTs (const IOSM_t iosm) |
Retrieve transaction set from I/O state machine iterator. More... | |
void * | iosmGetFi (const IOSM_t iosm) |
Retrieve transaction element file info from I/O state machine iterator. More... | |
int | iosmMapPath (IOSM_t iosm) |
Map next file path and action. More... | |
int | iosmMapAttrs (IOSM_t iosm) |
Map file stat(2) info. More... | |
int | iosmFileActionSkipped (iosmFileAction action) |
Is the file going to be skipped? More... | |
int | iosmNext (IOSM_t iosm, iosmFileStage nstage) |
File state machine driver. More... | |
int | iosmStage (IOSM_t iosm, iosmFileStage stage) |
File state machine driver. More... | |
Variables | |
int | _iosm_debug |
int(* | _iosmNext )(IOSM_t iosm, iosmFileStage nstage) |
Vector to iosmNext. More... | |
File state machine to handle archive I/O and system call's.
Definition in file iosm.h.
#define _fd | ( | _a | ) | ((_a) | (IOSM_INTERNAL | IOSM_DEAD)) |
#define _fi | ( | _a | ) | ((_a) | IOSM_INTERNAL) |
#define _fs | ( | _a | ) | ((_a) | (IOSM_INTERNAL | IOSM_SYSCALL)) |
#define _fv | ( | _a | ) | ((_a) | IOSM_VERBOSE) |
#define _IOSM_INTERNAL /* XXX expose internals for unit tests. */ |
#define IOSM_DEAD 0x1000 |
Definition at line 108 of file iosm.h.
Referenced by fsmStage(), and iosmStage().
#define IOSM_INTERNAL 0x4000 |
Definition at line 106 of file iosm.h.
Referenced by fsmStage(), and iosmStage().
#define IOSM_SYSCALL 0x2000 |
Definition at line 107 of file iosm.h.
Referenced by fsmStage(), and iosmStage().
#define IOSM_VERBOSE 0x8000 |
Definition at line 105 of file iosm.h.
Referenced by fsmStage(), and iosmStage().
#define IOSMERR_CHECK_ERRNO 0x00008000 |
Definition at line 64 of file iosm.h.
Referenced by iosmStrerror().
typedef enum iosmFileAction_e iosmFileAction |
File disposition(s) during package install/erase processing.
typedef enum iosmFileStage_e iosmFileStage |
typedef struct iosmIterator_s* IOSMI_t |
typedef enum iosmMapFlags_e iosmMapFlags |
enum iosmErrorReturns_e |
enum iosmFileAction_e |
File disposition(s) during package install/erase processing.
enum iosmFileStage_e |
enum iosmMapFlags_e |
Destroy I/O state machine instance.
iosm | I/O state machine |
Definition at line 580 of file iosm.c.
References _free(), iosm_s::dnlx, freeHardLink(), iosm_s::iter, iosm_s::ldn, iosm_s::li, iosm_s::links, mapFreeIterator(), hardLink_s::next, and iosm_s::path.
int iosmFileActionSkipped | ( | iosmFileAction | action | ) |
Is the file going to be skipped?
iosm | I/O state machine |
Definition at line 2672 of file iosm.c.
References IOSM_SKIPPING.
Referenced by dnlInitIterator(), fsmCommitLinks(), fsmMakeLinks(), fsmStage(), handleInstInstalledFile(), handleOverlappedFiles(), iosmCommitLinks(), iosmMakeLinks(), iosmStage(), rpmtsAddFingerprints(), rpmtsSkipFiles(), and saveHardLink().
const char* iosmFileActionString | ( | iosmFileAction | a | ) |
Return formatted string representation of file disposition.
a | file disposition |
Definition at line 2677 of file iosm.c.
References FA_ALTNAME, FA_BACKUP, FA_COPYIN, FA_COPYOUT, FA_CREATE, FA_ERASE, FA_SAVE, FA_SKIP, FA_SKIPCOLOR, FA_SKIPNETSHARED, FA_SKIPNSTATE, and FA_UNKNOWN.
const char* iosmFileStageString | ( | iosmFileStage | a | ) |
Return formatted string representation of file stages.
a | file stage |
Definition at line 2697 of file iosm.c.
References IOSM_CHMOD, IOSM_CHOWN, IOSM_CHROOT, IOSM_COMMIT, IOSM_CREATE, IOSM_DESTROY, IOSM_DREAD, IOSM_DWRITE, IOSM_EAT, IOSM_FINI, IOSM_HREAD, IOSM_HWRITE, IOSM_INIT, IOSM_LCHOWN, IOSM_LINK, IOSM_LSETFCON, IOSM_LSTAT, IOSM_MAP, IOSM_MKDIR, IOSM_MKDIRS, IOSM_MKFIFO, IOSM_MKLINKS, IOSM_MKNOD, IOSM_NEXT, IOSM_NOTIFY, IOSM_PAD, IOSM_PKGBUILD, IOSM_PKGCOMMIT, IOSM_PKGERASE, IOSM_PKGINSTALL, IOSM_PKGUNDO, IOSM_POS, IOSM_POST, IOSM_PRE, IOSM_PROCESS, IOSM_RCLOSE, IOSM_READ, IOSM_READLINK, IOSM_RENAME, IOSM_RMDIR, IOSM_RMDIRS, IOSM_ROPEN, IOSM_STAT, IOSM_SYMLINK, IOSM_TRAILER, IOSM_UNDO, IOSM_UNKNOWN, IOSM_UNLINK, IOSM_UTIME, IOSM_VERIFY, IOSM_WCLOSE, IOSM_WOPEN, and IOSM_WRITE.
Referenced by fsmStage(), and iosmStage().
void* iosmGetFi | ( | const IOSM_t | iosm | ) |
Retrieve transaction element file info from I/O state machine iterator.
iosm | I/O state machine |
Definition at line 97 of file iosm.c.
References iosmIterator_s::fi, and iosm_s::iter.
Referenced by dnlInitIterator(), iosmMapAttrs(), iosmMapFContext(), iosmMapPath(), iosmMkdirs(), iosmStage(), saveHardLink(), and writeFile().
void* iosmGetTs | ( | const IOSM_t | iosm | ) |
Retrieve transaction set from I/O state machine iterator.
iosm | I/O state machine |
Referenced by iosmStage(), and iosmTeardown().
int iosmMapAttrs | ( | IOSM_t | iosm | ) |
Map file stat(2) info.
iosm | I/O state machine |
Definition at line 949 of file iosm.c.
References _, iosm_s::digest, iosm_s::digestlen, iosm_s::fdigest, iosm_s::fdigestalgo, dnli_s::fi, gnameToGid(), iosm_s::goal, dnli_s::i, IOSM_MAP_GID, IOSM_MAP_MODE, IOSM_MAP_TYPE, IOSM_MAP_UID, IOSM_PKGINSTALL, iosmGetFi(), iosm_s::ix, iosm_s::mapFlags, iosm_s::nofdigests, rpmlog(), RPMLOG_WARNING, iosm_s::sb, and unameToUid().
Referenced by iosmStage().
int iosmMapPath | ( | IOSM_t | iosm | ) |
Map next file path and action.
iosm | I/O state machine |
Definition at line 858 of file iosm.c.
References _free(), iosm_s::action, iosm_s::adding, iosm_s::astriplen, iosm_s::baseName, iosm_s::dirName, FA_ALTNAME, FA_BACKUP, FA_COPYIN, FA_COPYOUT, FA_CREATE, FA_ERASE, FA_SAVE, FA_SKIP, FA_SKIPCOLOR, FA_SKIPNETSHARED, FA_SKIPNSTATE, FA_UNKNOWN, iosm_s::fflags, dnli_s::fi, dnli_s::i, IOSM_MAP_PATH, iosmFsPath(), iosmGetFi(), iosm_s::ix, iosm_s::mapFlags, iosm_s::nsuffix, iosm_s::osuffix, iosm_s::path, RPMFILE_GHOST, RPMFILE_STATE_NETSHARED, RPMFILE_STATE_NOTINSTALLED, RPMFILE_STATE_WRONGCOLOR, rpmteType(), iosm_s::sb, iosm_s::subdir, iosm_s::suffix, SUFFIX_RPMNEW, SUFFIX_RPMORIG, SUFFIX_RPMSAVE, and TR_REMOVED.
Referenced by iosmStage().
int iosmNext | ( | IOSM_t | iosm, |
iosmFileStage | nstage | ||
) |
File state machine driver.
iosm | I/O state machine |
nstage | next stage |
Definition at line 461 of file iosm.c.
References iosmStage(), iosm_s::multithreaded, iosm_s::nstage, rpmsqJoin(), and rpmsqThread().
Referenced by extractRegular(), iosmCommitLinks(), iosmMakeLinks(), iosmMkdirs(), iosmRmdirs(), iosmSetup(), iosmStage(), saveHardLink(), writeFile(), and writeLinkedFile().
int iosmSetup | ( | IOSM_t | iosm, |
iosmFileStage | goal, | ||
const char * | afmt, | ||
const void * | _ts, | ||
const void * | _fi, | ||
FD_t | cfd, | ||
unsigned int * | archiveSize, | ||
const char ** | failedFile | ||
) |
Load external data into I/O state machine.
iosm | I/O state machine |
goal | |
afmt | archive format (NULL uses cpio) |
_ts | transaction set |
_fi | transaction element file info |
cfd | payload descriptor |
archiveSize | pointer to archive size |
failedFile | pointer to first file name that failed. |
Definition at line 669 of file iosm.c.
References _iosm_debug, _iosm_threads, _iosmNext, _tsmask, iosm_s::adding, iosm_s::archiveSize, arHeaderRead(), arHeaderWrite(), arSetup(), arTrailerWrite(), iosm_s::blksize, iosm_s::cfd, iosm_s::commit, cpioHeaderRead(), cpioHeaderWrite(), cpioTrailerWrite(), iosm_s::debug, FA_COPYOUT, iosm_s::failedFile, fdGetCpioPos(), fdLink(), fdSetCpioPos(), dnli_s::fi, iosm_s::goal, iosm_s::headerRead, iosm_s::headerWrite, IOSM_CREATE, IOSM_PKGBUILD, IOSM_PKGCOMMIT, IOSM_PKGERASE, IOSM_PKGINSTALL, iosmNext(), iosmUNSAFE, iosm_s::iter, mapInitIterator(), iosm_s::multithreaded, iosm_s::nofcontexts, iosm_s::nofdigests, iosm_s::rc, dnli_s::reverse, RPMCALLBACK_INST_START, rpmteType(), RPMTRANS_FLAG_NOCONTEXTS, RPMTRANS_FLAG_NOFDIGESTS, rpmtsFlags(), rpmtsGetTid(), rpmtsLink(), rpmtsNotify(), iosm_s::sufbuf, TAR_BLOCK_SIZE, tarHeaderRead(), tarHeaderWrite(), tarTrailerWrite(), TR_ADDED, TR_REMOVED, iosm_s::trailerWrite, and iosmIterator_s::ts.
int iosmStage | ( | IOSM_t | iosm, |
iosmFileStage | stage | ||
) |
File state machine driver.
iosm | I/O state machine |
stage | next stage |
Definition at line 1632 of file iosm.c.
References _, _fafilter, _free(), iosm_s::action, alloca(), iosm_s::astriplen, iosm_s::blksize, iosm_s::cfd, Chmod(), Chown(), iosm_s::commit, CPIO_TRAILER, hardLink_s::createdPath, iosm_s::debug, iosm_s::diskchecked, iosm_s::dnlx, errno, iosm_s::exists, extractRegular(), FA_ERASE, FA_UNKNOWN, Fadvise(), iosm_s::failedFile, Fclose(), iosm_s::fcontext, fdGetCpioPos(), fdSetCpioPos(), FDSTAT_DIGEST, fdstat_op(), Ferror(), iosm_s::fflags, dnli_s::fi, hardLink_s::filex, Fopen(), Fread(), freeHardLink(), Fwrite(), iosm_s::goal, iosm_s::headerRead, iosm_s::headerWrite, dnli_s::i, IOSM_ALL_HARDLINKS, IOSM_CHMOD, IOSM_CHOWN, IOSM_CHROOT, IOSM_COMMIT, IOSM_CREATE, IOSM_DEAD, IOSM_DESTROY, IOSM_DREAD, IOSM_DWRITE, IOSM_EAT, IOSM_FINI, IOSM_FOLLOW_SYMLINKS, IOSM_HREAD, IOSM_HWRITE, IOSM_INIT, IOSM_INTERNAL, IOSM_LCHOWN, IOSM_LINK, IOSM_LSETFCON, IOSM_LSTAT, IOSM_MAP, IOSM_MKDIR, IOSM_MKDIRS, IOSM_MKFIFO, IOSM_MKLINKS, IOSM_MKNOD, IOSM_NEXT, IOSM_NOTIFY, IOSM_PAD, IOSM_PAYLOAD_EXTRACT, IOSM_PAYLOAD_LIST, IOSM_PKGBUILD, IOSM_PKGCOMMIT, IOSM_PKGERASE, IOSM_PKGINSTALL, IOSM_POS, IOSM_POST, IOSM_PRE, IOSM_PROCESS, IOSM_RCLOSE, IOSM_READ, IOSM_READLINK, IOSM_RENAME, IOSM_RMDIR, IOSM_RMDIRS, IOSM_ROPEN, IOSM_SBIT_CHECK, IOSM_STAT, IOSM_SYMLINK, IOSM_SYSCALL, IOSM_TRAILER, IOSM_UNDO, IOSM_UNKNOWN, IOSM_UNLINK, IOSM_UTIME, IOSM_VERBOSE, IOSM_VERIFY, IOSM_WCLOSE, IOSM_WOPEN, IOSM_WRITE, iosmCommitLinks(), IOSMERR_CHMOD_FAILED, IOSMERR_CHOWN_FAILED, IOSMERR_ENOENT, IOSMERR_ENOTEMPTY, IOSMERR_HDR_TRAILER, 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, iosmFileActionSkipped(), iosmFileStageString(), iosmFsPath(), iosmGetFi(), iosmGetTs(), iosmMakeLinks(), iosmMapAttrs(), iosmMapFContext(), iosmMapPath(), iosmMkdirs(), iosmNext(), iosmRmdirs(), iosmUNSAFE, IS_DEV_LOG, iosm_s::iter, iosm_s::ix, Lchown(), iosm_s::ldn, iosm_s::ldnalloc, iosm_s::ldnlen, iosm_s::li, Link(), hardLink_s::linkIndex, iosm_s::links, hardLink_s::linksLeft, iosm_s::lpath, Lstat(), mapFind(), iosm_s::mapFlags, mapNextIterator(), Mkdir(), iosm_s::mkdirsdone, Mkfifo(), Mknod(), hardLink_s::next, hardLink_s::nlink, iosm_s::nsuffix, iosm_s::op_digest, iosm_s::opath, iosm_s::osb, iosm_s::osuffix, iosm_s::path, iosm_s::postpone, iosm_s::rc, iosm_s::rdb, iosm_s::rdbuf, iosm_s::rdlen, iosm_s::rdnb, iosm_s::rdsize, Readlink(), Rename(), iosm_s::repackaged, iosm_s::rfd, Rmdir(), RPMCALLBACK_INST_PROGRESS, RPMFILE_GHOST, RPMFILE_MISSINGOK, rpmlog(), RPMLOG_DEBUG, RPMLOG_ERR, RPMLOG_WARNING, rpmswAdd(), rpmsxLsetfilecon(), rpmtsNotify(), S_ISLNK, S_ISSOCK, saveHardLink(), hardLink_s::sb, iosm_s::sb, iosm_s::stage, Stat(), stpcpy(), iosm_s::strict_erasures, iosm_s::subdir, iosm_s::sufbuf, iosm_s::suffix, Symlink(), iosm_s::trailerWrite, Unlink(), urlPath(), Utime(), iosm_s::wfd, iosm_s::wrb, iosm_s::wrbuf, writeFile(), writeLinkedFile(), iosm_s::wrlen, iosm_s::wrnb, iosm_s::wrsize, xmalloc, and xstrdup().
Referenced by dnlNextIterator(), fsmStage(), and iosmNext().
char* iosmStrerror | ( | int | rc | ) |
Return formatted error message on payload handling failure.
rc | error code |
Definition at line 2763 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().
int iosmTeardown | ( | IOSM_t | iosm | ) |
Clean I/O state machine.
iosm | I/O state machine |
Definition at line 802 of file iosm.c.
References _free(), iosm_s::cfd, iosm_s::debug, iosm_s::failedFile, fdFree(), IOSM_DESTROY, iosmGetTs(), iosmUNSAFE, iosm_s::iter, iosm_s::lmtab, mapFreeIterator(), iosm_s::op_digest, iosm_s::rc, rpmswAdd(), RPMTS_OP_DIGEST, rpmtsFree(), rpmtsOp(), and iosmIterator_s::ts.
IOSM_t newIOSM | ( | void | ) |
int(* _iosmNext) (IOSM_t iosm, iosmFileStage nstage) |
Vector to iosmNext.
Definition at line 83 of file iosm.c.
Referenced by arHeaderRead(), arHeaderWrite(), arRead(), arTrailerWrite(), arWrite(), cpioHeaderRead(), cpioHeaderWrite(), cpioRead(), cpioTrailerWrite(), cpioWrite(), fsmSetup(), iosmSetup(), tarHeaderWrite(), tarHeaderWriteName(), tarRead(), tarTrailerWrite(), and tarWrite().