From 640cc382869d4c06e8367f80893f88c00c416274 Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Aug 07 2017 11:44:45 +0000 Subject: libsepol-2.7-1 - Update to upstream release 2017-08-04 --- diff --git a/.gitignore b/.gitignore index 729b9f5..93a94e0 100644 --- a/.gitignore +++ b/.gitignore @@ -167,3 +167,4 @@ libsepol-2.0.41.tgz /libsepol-2.5-rc1.tar.gz /libsepol-2.5.tar.gz /libsepol-2.6.tar.gz +/libsepol-2.7.tar.gz diff --git a/libsepol-fedora.patch b/libsepol-fedora.patch index 62d24e6..e69de29 100644 --- a/libsepol-fedora.patch +++ b/libsepol-fedora.patch @@ -1,146 +0,0 @@ -diff --git libsepol-2.6/src/assertion.c libsepol-2.6/src/assertion.c -index a4be880..121bf8c 100644 ---- libsepol-2.6/src/assertion.c -+++ libsepol-2.6/src/assertion.c -@@ -222,7 +222,7 @@ static int report_assertion_avtab_matches(avtab_key_t *k, avtab_datum_t *d, void - ebitmap_node_t *snode, *tnode; - unsigned int i, j; - -- if (k->specified != AVTAB_ALLOWED) -+ if ((k->specified & AVTAB_ALLOWED) == 0) - return 0; - - if (!match_any_class_permissions(avrule->perms, k->target_class, d->data)) -@@ -455,7 +455,7 @@ static int check_assertion_avtab_match(avtab_key_t *k, avtab_datum_t *d, void *a - avrule_t *avrule = a->avrule; - avtab_t *avtab = a->avtab; - -- if (k->specified != AVTAB_ALLOWED) -+ if ((k->specified & AVTAB_ALLOWED) == 0) - goto exit; - - if (!match_any_class_permissions(avrule->perms, k->target_class, d->data)) -diff --git libsepol-2.6/src/boolean_record.c libsepol-2.6/src/boolean_record.c -index 8b64413..a194704 100644 ---- libsepol-2.6/src/boolean_record.c -+++ libsepol-2.6/src/boolean_record.c -@@ -15,7 +15,7 @@ struct sepol_bool { - - struct sepol_bool_key { - /* This boolean's name */ -- const char *name; -+ char *name; - }; - - int sepol_bool_key_create(sepol_handle_t * handle, -@@ -30,7 +30,12 @@ int sepol_bool_key_create(sepol_handle_t * handle, - return STATUS_ERR; - } - -- tmp_key->name = name; -+ tmp_key->name = strdup(name); -+ if (!tmp_key->name) { -+ ERR(handle, "out of memory, " "could not create boolean key"); -+ free(tmp_key); -+ return STATUS_ERR; -+ } - - *key_ptr = tmp_key; - return STATUS_SUCCESS; -@@ -62,6 +67,9 @@ int sepol_bool_key_extract(sepol_handle_t * handle, - - void sepol_bool_key_free(sepol_bool_key_t * key) - { -+ if (!key) -+ return; -+ free(key->name); - free(key); - } - -diff --git libsepol-2.6/src/expand.c libsepol-2.6/src/expand.c -index 004a029..1d7558e 100644 ---- libsepol-2.6/src/expand.c -+++ libsepol-2.6/src/expand.c -@@ -937,7 +937,7 @@ int mls_semantic_range_expand(mls_semantic_range_t * sr, mls_range_t * r, - return -1; - - if (mls_semantic_level_expand(&sr->level[1], &r->level[1], p, h) < 0) { -- mls_semantic_level_destroy(&sr->level[0]); -+ mls_level_destroy(&r->level[0]); - return -1; - } - -diff --git libsepol-2.6/src/iface_record.c libsepol-2.6/src/iface_record.c -index 09adeb7..6d56835 100644 ---- libsepol-2.6/src/iface_record.c -+++ libsepol-2.6/src/iface_record.c -@@ -20,7 +20,7 @@ struct sepol_iface { - struct sepol_iface_key { - - /* Interface name */ -- const char *name; -+ char *name; - }; - - /* Key */ -@@ -36,7 +36,12 @@ int sepol_iface_key_create(sepol_handle_t * handle, - return STATUS_ERR; - } - -- tmp_key->name = name; -+ tmp_key->name = strdup(name); -+ if (!tmp_key->name) { -+ ERR(handle, "out of memory, could not create interface key"); -+ free(tmp_key); -+ return STATUS_ERR; -+ } - - *key_ptr = tmp_key; - return STATUS_SUCCESS; -@@ -68,6 +73,9 @@ int sepol_iface_key_extract(sepol_handle_t * handle, - - void sepol_iface_key_free(sepol_iface_key_t * key) - { -+ if (!key) -+ return; -+ free(key->name); - free(key); - } - -diff --git libsepol-2.6/src/user_record.c libsepol-2.6/src/user_record.c -index c59c54b..d72d4c7 100644 ---- libsepol-2.6/src/user_record.c -+++ libsepol-2.6/src/user_record.c -@@ -24,7 +24,7 @@ struct sepol_user { - - struct sepol_user_key { - /* This user's name */ -- const char *name; -+ char *name; - }; - - int sepol_user_key_create(sepol_handle_t * handle, -@@ -40,7 +40,12 @@ int sepol_user_key_create(sepol_handle_t * handle, - return STATUS_ERR; - } - -- tmp_key->name = name; -+ tmp_key->name = strdup(name); -+ if (!tmp_key->name) { -+ ERR(handle, "out of memory, could not create selinux user key"); -+ free(tmp_key); -+ return STATUS_ERR; -+ } - - *key_ptr = tmp_key; - return STATUS_SUCCESS; -@@ -71,6 +76,9 @@ int sepol_user_key_extract(sepol_handle_t * handle, - - void sepol_user_key_free(sepol_user_key_t * key) - { -+ if (!key) -+ return; -+ free(key->name); - free(key); - } - diff --git a/libsepol.spec b/libsepol.spec index b3c9466..b58e9ed 100644 --- a/libsepol.spec +++ b/libsepol.spec @@ -1,15 +1,15 @@ Summary: SELinux binary policy manipulation library Name: libsepol -Version: 2.6 -Release: 5%{?dist} +Version: 2.7 +Release: 1%{?dist} License: LGPLv2+ Group: System Environment/Libraries -Source: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20161014/libsepol-2.6.tar.gz +Source: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20170804/libsepol-2.7.tar.gz # download https://raw.githubusercontent.com/fedora-selinux/scripts/master/selinux/make-fedora-selinux-patch.sh # run: -# $ VERSION=2.6 ./make-fedora-selinux-patch.sh libsepol -# HEAD https://github.com/fedora-selinux/selinux/commit/601a1d1363fe4137ff3a2991c546f7a0ccfec4cb -Patch1: libsepol-fedora.patch +# $ VERSION=2.7 ./make-fedora-selinux-patch.sh libsepol +# HEAD https://github.com/fedora-selinux/selinux/commit/70a12c5e7b56a81223d67ce2469292826b84efe9 +# Patch1: libsepol-fedora.patch URL: https://github.com/SELinuxProject/selinux/wiki BuildRequires: flex @@ -106,6 +106,9 @@ exit 0 %{_libdir}/libsepol.so.1 %changelog +* Mon Aug 07 2017 Petr Lautrbach - 2.7-1 +- Update to upstream release 2017-08-04 + * Thu Aug 03 2017 Fedora Release Engineering - 2.6-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild diff --git a/sources b/sources index d4a3407..8ae933c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libsepol-2.6.tar.gz) = 17d007857634e3d581fcc9bafcbb75674a06e382bb258c2c6b3656c141d71493699c42b78c8e1917c628476aeb8ead73bb86e8ccf43d7ce59aa0b7884bea132a +SHA512 (libsepol-2.7.tar.gz) = 1d308c17bfea2659f9dc4877ab685449a5a33dff7260e62b603cde9551bed2010360b71a896c6dfcdb8b9fe86ecebc9f6b3225e6c3573a80fca8578a9d561b47