rpm
5.4.10
|
![]() |
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 stayl was here, now he's not. or@r edhat .com | |
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. |
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... |
Macros | |
#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. |
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 *_iter) |
Destroy file info iterator. | |
static void * | mapInitIterator (rpmfi fi, int reverse) |
Create file info iterator. | |
static int | mapNextIterator (void *_iter) |
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 *_dnli) |
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 |
|
inlinestatic |
Definition at line 294 of file fsm.c.
References dnli_s::fi.
Referenced by fsmMkdirs(), and fsmRmdirs().
|
static |
Destroy directory name iterator.
_dnli | directory name iterator |
NULL | always |
Definition at line 282 of file fsm.c.
References _free(), and dnli_s::active.
Referenced by fsmMkdirs(), and fsmRmdirs().
|
inlinestatic |
Definition at line 302 of file fsm.c.
References dnli_s::isave.
Referenced by fsmMkdirs(), and fsmRmdirs().
|
static |
Create directory name iterator.
fsm | file state machine data |
reverse | traverse directory names in reverse order? |
Definition at line 316 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(), and fsmRmdirs().
|
static |
Return next directory name (from file info).
dnli | directory name iterator |
Definition at line 403 of file fsm.c.
References dnli_s::active, dnli_s::fi, dnli_s::i, dnli_s::isave, and dnli_s::reverse.
Referenced by fsmMkdirs(), and fsmRmdirs().
|
static |
Create file from payload stream.
fsm | file state machine data |
Definition at line 972 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().
|
static |
Destroy set of hard links.
li | set of hard links |
Definition at line 541 of file fsm.c.
References _free(), hardLink_s::filex, and hardLink_s::nsuffix.
Referenced by freeFSM(), and fsmStage().
|
static |
Commit hard linked file set atomically.
fsm | file state machine data |
Definition at line 1336 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 |
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 109 of file fsm.c.
References iosm_s::baseName, iosm_s::dirName, stpcpy(), and xmalloc.
Referenced by fsmMapPath(), and fsmStage().
|
static |
Create pending hard links to existing file.
fsm | file state machine data |
Definition at line 1275 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 |
Commit hard linked file set atomically.
iosm | file state machine data |
Definition at line 1370 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 |
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 118 of file iosm.c.
References iosm_s::baseName, iosm_s::dirName, stpcpy(), and xmalloc.
Referenced by iosmMapPath(), and iosmStage().
|
static |
Create pending hard links to existing file.
iosm | file state machine data |
Definition at line 1309 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 |
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().
|
static |
Locate archive path in file info.
iter | file info iterator |
fsmPath | archive path |
Definition at line 239 of file fsm.c.
References cpioStrCmp(), iosmIterator_s::fi, iosmIterator_s::i, mapNextIterator(), and rpmfiFC().
Referenced by fsmStage().
|
static |
Destroy file info iterator.
_iter | file info iterator |
NULL | always |
Definition at line 141 of file fsm.c.
References _free(), iosmIterator_s::fi, rpmfiUnlink(), rpmtsFree(), and iosmIterator_s::ts.
Referenced by freeFSM(), and fsmTeardown().
|
static |
Create file info iterator.
fi | transaction element file info |
reverse | iterate in reverse order? |
Definition at line 163 of file fsm.c.
References iosmIterator_s::fi, iosmIterator_s::i, iosmIterator_s::isave, reverse, iosmIterator_s::reverse, rpmfiLink(), and xcalloc().
Referenced by fsmSetup().
|
static |
Return next index into file info.
_iter | file info iterator |
Definition at line 183 of file fsm.c.
References iosmIterator_s::fi, iosmIterator_s::i, iosmIterator_s::isave, and iosmIterator_s::reverse.
Referenced by fsmStage(), and mapFind().
|
static |
Save hard link in chain.
fsm | file state machine data |
Definition at line 455 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, hardLink_s::nsuffix, iosm_s::nsuffix, iosm_s::path, hardLink_s::sb, iosm_s::sb, and xcalloc().
Referenced by fsmStage().
|
static |
Write next item to payload stream.
fsm | file state machine data |
writeData | should data be written? |
Definition at line 1066 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(), and writeLinkedFile().
|
static |
Write set of linked files to payload stream.
fsm | file state machine data |
Definition at line 1201 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().