Check if a file is in the package's file list before extracting

Signed-off-by: Florian Pritz <bluewind@xinu.at>
This commit is contained in:
Florian Pritz 2014-01-27 23:37:49 +01:00 committed by Allan McRae
parent a7da2a47c3
commit f27fad9b89
1 changed files with 5 additions and 0 deletions

View File

@ -178,6 +178,11 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive,
archive_read_data_skip(archive);
return 0;
} else {
if (!alpm_filelist_contains(&newpkg->files, entryname)) {
_alpm_log(handle, ALPM_LOG_WARNING, _("file not found in file list for package %s. skipping extraction of %s\n"),
newpkg->name, entryname);
return 0;
}
/* build the new entryname relative to handle->root */
snprintf(filename, PATH_MAX, "%s%s", handle->root, entryname);
}