]> git.ipfire.org Git - pakfire.git/commitdiff
file: Don't fail on non-implemented CF protection check
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 9 Sep 2023 17:03:44 +0000 (17:03 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 9 Sep 2023 17:03:44 +0000 (17:03 +0000)
See: #13084 - Implement CF protection check
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/file.c

index ea3e276cf96c95fdb2399c84643acc9e87c49875..a07da888ec71a8f4b09c323ef839308b006fc428 100644 (file)
@@ -2656,6 +2656,12 @@ static int __pakfire_file_check_cf_protection_x86(struct pakfire_file* file,
        return 0;
 }
 
+static int __pakfire_file_check_cf_protection_aarch64(struct pakfire_file* file,
+               const int endianess, const uint32_t type, const char* payload) {
+       # warning TODO
+       return 0;
+}
+
 static int pakfire_file_check_cf_protection_callback(struct pakfire_file* file,
                Elf* elf, const Elf_Scn* section, const GElf_Shdr* shdr, Elf_Data* data) {
        GElf_Ehdr ehdr = {};
@@ -2720,13 +2726,11 @@ static int pakfire_file_check_cf_protection_callback(struct pakfire_file* file,
                }
 
                switch (ehdr.e_machine) {
-#if 0
                        case EM_AARCH64:
                                r = __pakfire_file_check_cf_protection_aarch64(file, endianess, type, payload);
                                if (r)
                                        return r;
                                break;
-#endif
 
                        case EM_X86_64:
                                r = __pakfire_file_check_cf_protection_x86(file, endianess, type, payload);
@@ -2735,7 +2739,7 @@ static int pakfire_file_check_cf_protection_callback(struct pakfire_file* file,
                                break;
 
                        default:
-                               ERROR(file->pakfire, "Unsupported ELF type\n");
+                               ERROR(file->pakfire, "Unsupported ELF type (%d)\n", ehdr.e_machine);
                                return 1;
                }