summaryrefslogtreecommitdiffstats
path: root/lib/libalpm
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2014-01-27 23:37:49 +0100
committerAllan McRae <allan@archlinux.org>2014-03-03 02:25:54 +0100
commitf27fad9b890d2696201e1df2356dd4d66f813ddd (patch)
tree5960e6066be42c8088262daef226afb234ca3f12 /lib/libalpm
parenta7da2a47c3f71f52ad1214b4ae78e716ee488a5a (diff)
downloadpacman-f27fad9b890d2696201e1df2356dd4d66f813ddd.tar.gz
pacman-f27fad9b890d2696201e1df2356dd4d66f813ddd.tar.xz
Check if a file is in the package's file list before extracting
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/add.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index f38afef8..1199d300 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -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);
}