From 3b88ccfc1eb7887008f69eaf9c1c45b16d78c5c7 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 5 Nov 2019 15:20:52 -0500 Subject: [PATCH] import checkpolicy-2.9-1.el8 --- .checkpolicy.metadata | 2 +- .gitignore | 2 +- SOURCES/checkpolicy-fedora.patch | 28 ---------------------------- SPECS/checkpolicy.spec | 29 ++++++++++++++++------------- 4 files changed, 18 insertions(+), 43 deletions(-) delete mode 100644 SOURCES/checkpolicy-fedora.patch diff --git a/.checkpolicy.metadata b/.checkpolicy.metadata index a817727..a70ae0b 100644 --- a/.checkpolicy.metadata +++ b/.checkpolicy.metadata @@ -1 +1 @@ -f2dd3fe748373bdd9e5eed08d7a447a9f11d02ab SOURCES/checkpolicy-2.8.tar.gz +0529cd309f3a24279a7251ab2e6208b1ed6a6c3e SOURCES/checkpolicy-2.9.tar.gz diff --git a/.gitignore b/.gitignore index b9f7884..b58ecfc 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/checkpolicy-2.8.tar.gz +SOURCES/checkpolicy-2.9.tar.gz diff --git a/SOURCES/checkpolicy-fedora.patch b/SOURCES/checkpolicy-fedora.patch deleted file mode 100644 index 26040ef..0000000 --- a/SOURCES/checkpolicy-fedora.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git checkpolicy-2.8/module_compiler.c checkpolicy-2.8/module_compiler.c -index 155702f..ada7cb2 100644 ---- checkpolicy-2.8/module_compiler.c -+++ checkpolicy-2.8/module_compiler.c -@@ -802,6 +802,7 @@ int require_class(int pass) - if ((datum = calloc(1, sizeof(*datum))) == NULL || - symtab_init(&datum->permissions, PERM_SYMTAB_SIZE)) { - yyerror("Out of memory!"); -+ class_datum_destroy(datum); - return -1; - } - ret = -diff --git checkpolicy-2.8/policy_define.c checkpolicy-2.8/policy_define.c -index d8788a6..ece10e7 100644 ---- checkpolicy-2.8/policy_define.c -+++ checkpolicy-2.8/policy_define.c -@@ -1107,6 +1107,11 @@ int define_level(void) - (cat_datum_t *) hashtab_search(policydbp->p_cats. - table, - (hashtab_key_t) id); -+ if (!cdatum) { -+ yyerror2("unknown category %s", id); -+ free(id); -+ return -1; -+ } - range_start = range_end = cdatum->s.value - 1; - } - diff --git a/SPECS/checkpolicy.spec b/SPECS/checkpolicy.spec index 6e7ae62..ddee784 100644 --- a/SPECS/checkpolicy.spec +++ b/SPECS/checkpolicy.spec @@ -1,17 +1,14 @@ -%define libselinuxver 2.8-1 -%define libsepolver 2.8-1 +%define libselinuxver 2.9-1 +%define libsepolver 2.9-1 Summary: SELinux policy compiler Name: checkpolicy -Version: 2.8 -Release: 2%{?dist} +Version: 2.9 +Release: 1%{?dist} License: GPLv2 -Source: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20180524/checkpolicy-2.8.tar.gz -# download https://raw.githubusercontent.com/fedora-selinux/scripts/master/selinux/make-fedora-selinux-patch.sh -# run: -# $ VERSION=2.8 ./make-fedora-selinux-patch.sh checkpolicy -# HEAD 2b4b29f00e5f0746ff10e09686a23c6e96a11d5f -Patch1: checkpolicy-fedora.patch +Source: https://github.com/SELinuxProject/selinux/releases/download/20190315/checkpolicy-2.9.tar.gz +# git format-patch 20190315 -- checkpolicy +# i=1; for j in 00*patch; do printf "Patch%04d: %s\n" $i $j; i=$((i+1));done Conflicts: selinux-policy-base < 3.13.1-138 BuildRequires: gcc BuildRequires: byacc bison flex flex-static libsepol-static >= %{libsepolver} libselinux-devel >= %{libselinuxver} @@ -34,10 +31,11 @@ Only required for building policies. %autosetup -p 1 -n checkpolicy-%{version} %build -make clean -make LIBDIR="%{_libdir}" CFLAGS="%{optflags}" LDFLAGS="$RPM_LD_FLAGS" +%set_build_flags + +make LIBDIR="%{_libdir}" cd test -make LIBDIR="%{_libdir}" CFLAGS="%{optflags}" LDFLAGS="$RPM_LD_FLAGS" +make LIBDIR="%{_libdir}" %install mkdir -p ${RPM_BUILD_ROOT}%{_bindir} @@ -52,10 +50,15 @@ install test/dispol ${RPM_BUILD_ROOT}%{_bindir}/sedispol %{_bindir}/checkmodule %{_mandir}/man8/checkpolicy.8.gz %{_mandir}/man8/checkmodule.8.gz +%{_mandir}/ru/man8/checkpolicy.8.gz +%{_mandir}/ru/man8/checkmodule.8.gz %{_bindir}/sedismod %{_bindir}/sedispol %changelog +* Mon Mar 25 2019 Petr Lautrbach - 2.9-1 +- SELinux userspace 2.9 release + * Sun Dec 16 2018 Petr Lautrbach - 2.8-2 - destroy the class datum if it fails to initialize