summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2010-06-07 21:05:01 (EDT)
committer graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2010-06-07 21:05:01 (EDT)
commit5161628bdab57405a6fa6eec0366439d6d375c63 (patch)
tree71cfdee4b211ffee04ddad1407d7688922832862
parentaffb6d55b8f3e21796ea86e40113c617c8d3a893 (diff)
Check that a file belongs to the package before removing it
Fixes the test case in Issue #50. git-svn-id: http://opkg.googlecode.com/svn/trunk@531 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
-rw-r--r--libopkg/opkg_remove.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libopkg/opkg_remove.c b/libopkg/opkg_remove.c
index a866c04..4920587 100644
--- a/libopkg/opkg_remove.c
+++ b/libopkg/opkg_remove.c
@@ -341,6 +341,11 @@ remove_data_files_and_list(pkg_t *pkg)
for (iter = str_list_first(installed_files); iter; iter = str_list_next(installed_files, iter)) {
file_name = (char *)iter->data;
+ owner = file_hash_get_file_owner(file_name);
+ if (owner != pkg)
+ /* File may have been claimed by another package. */
+ continue;
+
if (file_is_dir(file_name)) {
str_list_append(&installed_dirs, file_name);
continue;