|
|
71cd55 |
From 859857def94bd6c8ad9e9ecce88c85d19dc19933 Mon Sep 17 00:00:00 2001
|
|
|
71cd55 |
From: James Carter <jwcart2@gmail.com>
|
|
|
71cd55 |
Date: Thu, 11 Mar 2021 11:56:44 -0500
|
|
|
71cd55 |
Subject: [PATCH] libsepol: Remove unnecessary copying of declarations from
|
|
|
71cd55 |
link.c
|
|
|
71cd55 |
|
|
|
71cd55 |
At one point link_modules() might have needed this initial copying,
|
|
|
71cd55 |
but now it serves no purpose, so remove it.
|
|
|
71cd55 |
|
|
|
71cd55 |
Signed-off-by: James Carter <jwcart2@gmail.com>
|
|
|
71cd55 |
---
|
|
|
71cd55 |
libsepol/src/link.c | 30 ------------------------------
|
|
|
71cd55 |
1 file changed, 30 deletions(-)
|
|
|
71cd55 |
|
|
|
71cd55 |
diff --git a/libsepol/src/link.c b/libsepol/src/link.c
|
|
|
71cd55 |
index 83bbc8a5c7d1..bdc1fcbf59d3 100644
|
|
|
71cd55 |
--- a/libsepol/src/link.c
|
|
|
71cd55 |
+++ b/libsepol/src/link.c
|
|
|
71cd55 |
@@ -2573,36 +2573,6 @@ int link_modules(sepol_handle_t * handle,
|
|
|
71cd55 |
goto cleanup;
|
|
|
71cd55 |
}
|
|
|
71cd55 |
|
|
|
71cd55 |
- /* copy all types, declared and required */
|
|
|
71cd55 |
- for (i = 0; i < len; i++) {
|
|
|
71cd55 |
- state.cur = modules[i];
|
|
|
71cd55 |
- state.cur_mod_name = modules[i]->policy->name;
|
|
|
71cd55 |
- ret =
|
|
|
71cd55 |
- hashtab_map(modules[i]->policy->p_types.table,
|
|
|
71cd55 |
- type_copy_callback, &state);
|
|
|
71cd55 |
- if (ret) {
|
|
|
71cd55 |
- retval = ret;
|
|
|
71cd55 |
- goto cleanup;
|
|
|
71cd55 |
- }
|
|
|
71cd55 |
- }
|
|
|
71cd55 |
-
|
|
|
71cd55 |
- /* then copy everything else, including aliases, and fixup attributes */
|
|
|
71cd55 |
- for (i = 0; i < len; i++) {
|
|
|
71cd55 |
- state.cur = modules[i];
|
|
|
71cd55 |
- state.cur_mod_name = modules[i]->policy->name;
|
|
|
71cd55 |
- ret =
|
|
|
71cd55 |
- copy_identifiers(&state, modules[i]->policy->symtab, NULL);
|
|
|
71cd55 |
- if (ret) {
|
|
|
71cd55 |
- retval = ret;
|
|
|
71cd55 |
- goto cleanup;
|
|
|
71cd55 |
- }
|
|
|
71cd55 |
- }
|
|
|
71cd55 |
-
|
|
|
71cd55 |
- if (policydb_index_others(state.handle, state.base, 0)) {
|
|
|
71cd55 |
- ERR(state.handle, "Error while indexing others");
|
|
|
71cd55 |
- goto cleanup;
|
|
|
71cd55 |
- }
|
|
|
71cd55 |
-
|
|
|
71cd55 |
/* copy and remap the module's data over to base */
|
|
|
71cd55 |
for (i = 0; i < len; i++) {
|
|
|
71cd55 |
state.cur = modules[i];
|
|
|
71cd55 |
--
|
|
|
71cd55 |
2.32.0
|
|
|
71cd55 |
|