From fcba095d86505e7e3957b9454d5df207118a07465c3f53e7e0f907dc218ad2bb Mon Sep 17 00:00:00 2001 From: Johannes Segitz Date: Wed, 15 Jul 2020 08:23:23 +0000 Subject: [PATCH] Accepting request 821048 from home:jsegitz:branches:security:SELinux OBS-URL: https://build.opensuse.org/request/show/821048 OBS-URL: https://build.opensuse.org/package/show/security:SELinux/libsepol?expand=0&rev=81 --- remove_cil_mem_error_handler.patch | 54 ------------------------------ 1 file changed, 54 deletions(-) delete mode 100644 remove_cil_mem_error_handler.patch diff --git a/remove_cil_mem_error_handler.patch b/remove_cil_mem_error_handler.patch deleted file mode 100644 index 60a7b06..0000000 --- a/remove_cil_mem_error_handler.patch +++ /dev/null @@ -1,54 +0,0 @@ -commit 3d32fc24d6aff360a538c63dad08ca5c957551b0 -Author: Ondrej Mosnacek -Date: Thu Jan 23 13:57:14 2020 +0100 - - libsepol: remove leftovers of cil_mem_error_handler - - Commit 4459d635b8f1 ("libsepol: Remove cil_mem_error_handler() function - pointer") replaced cil_mem_error_handler usage with inline contents of - the default handler. However, it left over the header declaration and - two callers. Convert these as well and remove the header declaration. - - This also fixes a build failure with -fno-common. - - Fixes: 4459d635b8f1 ("libsepol: Remove cil_mem_error_handler() function pointer") - Signed-off-by: Ondrej Mosnacek - -diff --git a/libsepol/cil/src/cil_mem.h b/libsepol/cil/src/cil_mem.h -index 902ce131..794f02a3 100644 ---- a/cil/src/cil_mem.h -+++ b/cil/src/cil_mem.h -@@ -36,7 +36,6 @@ void *cil_calloc(size_t num_elements, size_t element_size); - void *cil_realloc(void *ptr, size_t size); - char *cil_strdup(const char *str); - int cil_asprintf(char **strp, const char *fmt, ...); --void (*cil_mem_error_handler)(void); - - #endif /* CIL_MEM_H_ */ - -diff --git a/libsepol/cil/src/cil_strpool.c b/libsepol/cil/src/cil_strpool.c -index 97d4c4b9..2598bbf3 100644 ---- a/cil/src/cil_strpool.c -+++ b/cil/src/cil_strpool.c -@@ -80,8 +80,8 @@ char *cil_strpool_add(const char *str) - int rc = hashtab_insert(cil_strpool_tab, (hashtab_key_t)strpool_ref->str, strpool_ref); - if (rc != SEPOL_OK) { - pthread_mutex_unlock(&cil_strpool_mutex); -- (*cil_mem_error_handler)(); -- pthread_mutex_lock(&cil_strpool_mutex); -+ cil_log(CIL_ERR, "Failed to allocate memory\n"); -+ exit(1); - } - } - -@@ -104,8 +104,8 @@ void cil_strpool_init(void) - cil_strpool_tab = hashtab_create(cil_strpool_hash, cil_strpool_compare, CIL_STRPOOL_TABLE_SIZE); - if (cil_strpool_tab == NULL) { - pthread_mutex_unlock(&cil_strpool_mutex); -- (*cil_mem_error_handler)(); -- return; -+ cil_log(CIL_ERR, "Failed to allocate memory\n"); -+ exit(1); - } - } - cil_strpool_readers++;