fi->fuser = _free(fi->fuser);
fi->fgroup = _free(fi->fgroup);
- fi->mapflags = CPIO_MAP_PATH |
- CPIO_MAP_TYPE | CPIO_MAP_MODE | CPIO_MAP_UID | CPIO_MAP_GID;
- if (isSrc)
- fi->mapflags |= CPIO_FOLLOW_SYMLINKS;
-
/* Make the cpio list */
for (i = 0, flp = fl->fileList; i < fi->fc; i++, flp++) {
char * b;
}
}
- fi->mapflags = CPIO_MAP_PATH | CPIO_MAP_MODE | CPIO_MAP_UID | CPIO_MAP_GID;
-
fi->astriplen = 0;
fi->striplen = 0;
}
fi->striplen = p ? strlen(p) + 1 : 1;
}
- fi->mapflags =
- CPIO_MAP_PATH | CPIO_MAP_MODE | CPIO_MAP_UID | CPIO_MAP_GID | (fi->mapflags & CPIO_SBIT_CHECK);
{ struct rpmtd_s filenames;
rpmTag ftag = RPMTAG_FILENAMES;
fi->actions = xcalloc(fi->fc, sizeof(*fi->actions));
/* XXX TR_REMOVED needs CPIO_MAP_{ABSOLUTE,ADDDOT} CPIO_ALL_HARDLINKS */
- fi->mapflags =
- CPIO_MAP_PATH | CPIO_MAP_MODE | CPIO_MAP_UID | CPIO_MAP_GID;
+
+ /* Figure out mapflags:
+ * - path, mode, uid and gid are used by everything
+ * - all binary packages get SBIT_CHECK set
+ * - if archive size is not known, we're only building this package,
+ * different rules apply
+ */
+ fi->mapflags = CPIO_MAP_PATH | CPIO_MAP_MODE | CPIO_MAP_UID | CPIO_MAP_GID;
+ if (asize) {
+ if (!headerIsSource(h)) fi->mapflags |= CPIO_SBIT_CHECK;
+ } else {
+ fi->mapflags |= CPIO_MAP_TYPE;
+ if (headerIsSource(h)) fi->mapflags |= CPIO_FOLLOW_SYMLINKS;
+ }
_hgfi(h, RPMTAG_FILELINKTOS, &td, defFlags, fi->flinks);
_hgfi(h, RPMTAG_FILELANGS, &td, defFlags, fi->flangs);
if (XFA_SKIPPING(fi->actions[fileNum]))
continue;
- if (!(fi->mapflags & CPIO_SBIT_CHECK)) {
- rpm_mode_t omode = rpmfiFMode(otherFi);
- if (S_ISREG(omode) && (omode & 06000) != 0) {
- fi->mapflags |= CPIO_SBIT_CHECK;
- }
- }
-
if (rpmfiCompare(otherFi, fi)) {
int rConflicts;
case TR_REMOVED:
break;
}
- /* check for s-bit files to be removed */
- if (rpmteType(p) == TR_REMOVED) {
- fi = rpmfiInit(fi, 0);
- while ((i = rpmfiNext(fi)) >= 0) {
- rpm_mode_t mode;
- if (XFA_SKIPPING(fi->actions[i]))
- continue;
- (void) rpmfiSetFX(fi, i);
- mode = rpmfiFMode(fi);
- if (S_ISREG(mode) && (mode & 06000) != 0) {
- fi->mapflags |= CPIO_SBIT_CHECK;
- }
- }
- }
(void) rpmswExit(rpmtsOp(ts, RPMTS_OP_FINGERPRINT), fc);
}
pi = rpmtsiFree(pi);
char * fstates = fi->fstates;
rpmFileAction * actions = fi->actions;
sharedFileInfo replaced = fi->replaced;
- cpioMapFlags mapflags = fi->mapflags;
rpmte savep;
int numShared = 0;
fi->actions = actions;
if (replaced != NULL)
fi->replaced = replaced;
- if (mapflags & CPIO_SBIT_CHECK)
- fi->mapflags |= CPIO_SBIT_CHECK;
p->fi = fi;
}
}