*/
typedef struct FileList_s {
char * buildRoot;
- char * prefix;
int fileCount;
int processingFailed;
/* Generate the header. */
if (! isSrc) {
skipLen = 1;
- if (fl->prefix)
- skipLen += strlen(fl->prefix);
}
for (i = 0, flp = fl->fileList; i < fl->fileListRecsUsed; i++, flp++) {
if (*cpioPath == '\0')
cpioPath = "/";
- /* If we are using a prefix, validate the file */
- if (!fl->inFtw && fl->prefix) {
- const char *prefixPtr = fl->prefix;
-
- while (*prefixPtr && *cpioPath && (*cpioPath == *prefixPtr)) {
- prefixPtr++;
- cpioPath++;
- }
- if (*prefixPtr || (*cpioPath && *cpioPath != '/')) {
- rpmlog(RPMLOG_ERR, _("File doesn't match prefix (%s): %s\n"),
- fl->prefix, cpioPath);
- fl->processingFailed = 1;
- return RPMRC_FAIL;
- }
- }
-
if (statp == NULL) {
time_t now = time(NULL);
statp = &statbuf;
/* XXX spec->buildRoot == NULL, then xstrdup("") is returned */
fl.buildRoot = rpmGenPath(spec->rootDir, spec->buildRoot, NULL);
- fl.prefix = headerGetAsString(pkg->header, RPMTAG_DEFAULTPREFIX);
-
fl.fileCount = 0;
fl.processingFailed = 0;
exit:
fl.buildRoot = _free(fl.buildRoot);
- fl.prefix = _free(fl.prefix);
freeAttrRec(&fl.cur_ar);
freeAttrRec(&fl.def_ar);
fl.fileList = xcalloc((spec->numSources + 1), sizeof(*fl.fileList));
fl.processingFailed = 0;
fl.fileListRecsUsed = 0;
- fl.prefix = NULL;
fl.buildRoot = NULL;
s = getStringBuf(sourceFiles);