char ** failedFile)
{
FSM_t fsm = xcalloc(1, sizeof(*fsm));
- int isSrc = rpmteIsSource(te);
fsm->ix = -1;
fsm->goal = goal;
fsm->iter = mapInitIterator(ts, te, fi);
fsm->sehandle = rpmtsSELabelHandle(ts);
+ /* common flags for all modes */
fsm->mapFlags = CPIO_MAP_PATH | CPIO_MAP_MODE | CPIO_MAP_UID | CPIO_MAP_GID;
- if (goal == FSM_PKGBUILD) {
- fsm->mapFlags |= CPIO_MAP_TYPE;
- if (isSrc) {
- fsm->mapFlags |= CPIO_FOLLOW_SYMLINKS;
- }
- } else {
- if (!isSrc) {
- fsm->mapFlags |= CPIO_SBIT_CHECK;
- }
- }
if (fsm->goal == FSM_PKGINSTALL || fsm->goal == FSM_PKGBUILD) {
fsm->bufsize = 8 * BUFSIZ;
int saveerrno = errno;
int rc = 0;
+ if (!rpmteIsSource(te))
+ fsm->mapFlags |= CPIO_SBIT_CHECK;
+
if (archive == NULL)
rc = CPIOERR_INTERNAL;
FSM_t fsm = fsmNew(FSM_PKGERASE, ts, te, fi, failedFile);
int rc = 0;
+ if (!rpmteIsSource(te))
+ fsm->mapFlags |= CPIO_SBIT_CHECK;
+
while (!rc) {
/* Clean fsm, free'ing memory. */
fsmReset(fsm);
rpmcpio_t archive = rpmcpioOpen(cfd, O_WRONLY);
int rc = 0;
+ fsm->mapFlags |= CPIO_MAP_TYPE;
+ if (rpmteIsSource(te))
+ fsm->mapFlags |= CPIO_FOLLOW_SYMLINKS;
+
if (archive == NULL) {
rc = CPIOERR_INTERNAL;
} else {