diff --git a/src/manifest.c b/src/manifest.c index 38e54bf1..acba8911 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -983,45 +983,6 @@ void manifest_free_array(struct file **array) FREE(array); } -static bool is_version_data(const char *filename) -{ - if (str_cmp(filename, "/usr/lib/os-release") == 0 || - str_cmp(filename, "/usr/share/clear/version") == 0 || - str_cmp(filename, "/usr/share/clear/versionstamp") == 0 || - str_cmp(filename, DEFAULT_VERSION_URL_PATH) == 0 || - str_cmp(filename, DEFAULT_CONTENT_URL_PATH) == 0 || - str_cmp(filename, DEFAULT_FORMAT_PATH) == 0 || - str_cmp(filename, "/usr/share/clear/update-ca/Swupd_Root.pem") == 0 || - str_cmp(filename, "/usr/share/clear/os-core-update-index") == 0 || - str_cmp(filename, "/usr/share/clear/allbundles/os-core") == 0) { - return true; - } - return false; -} - -int enforce_compliant_manifest(struct file **a, struct file **b, int searchsize, int size) -{ - struct file **found; - int ret = 0; - - qsort(b, size, sizeof(struct file *), cmp_file_filename_ptr); - info("Checking manifest uniqueness...\n"); - for (int i = 0; i < searchsize; i++) { - found = bsearch(a[i], b, size, sizeof(struct file *), bsearch_file_helper); - if (found) { - if (is_version_data(a[i]->filename)) { - continue; - } - if (hash_equal(a[i]->hash, (*found)->hash)) { - continue; - } - error("Conflict found for file: %s\n", a[i]->filename); - ret++; - } - } - return ret; // If collisions were found, so manifest is purely additive -} - long get_manifest_list_contentsize(struct list *manifests) { long total_size = 0; diff --git a/src/swupd.h b/src/swupd.h index 9d4f5b29..ad5c26a6 100644 --- a/src/swupd.h +++ b/src/swupd.h @@ -381,7 +381,6 @@ enum swupd_code third_party_execute_check_update(void); enum swupd_code third_party_execute_update(void); extern struct file **manifest_files_to_array(struct manifest *manifest); -extern int enforce_compliant_manifest(struct file **a, struct file **b, int searchsize, int size); extern void manifest_free_array(struct file **array); extern enum swupd_code print_update_conf_info(void);