From bc2c12a08fb944aeb5bf75b89694d3ef82578000 Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Thu, 10 Dec 2015 18:48:10 +0100 Subject: [PATCH] libselinux-2.4-6 - Build libselinux without rpm_execcon() (#1284019) --- libselinux-rpm_execcon.patch | 31 +++++++++++++++++++++++++++++++ libselinux.spec | 8 +++++++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 libselinux-rpm_execcon.patch diff --git a/libselinux-rpm_execcon.patch b/libselinux-rpm_execcon.patch new file mode 100644 index 0000000..4358112 --- /dev/null +++ b/libselinux-rpm_execcon.patch @@ -0,0 +1,31 @@ +diff -up libselinux/include/selinux/selinux.h.rpm_execcon libselinux/include/selinux/selinux.h +--- libselinux/include/selinux/selinux.h.rpm_execcon 2015-12-02 21:18:25.000000000 +0100 ++++ libselinux/include/selinux/selinux.h 2015-12-10 17:50:09.861577967 +0100 +@@ -601,10 +601,12 @@ void fini_selinuxmnt(void); + * program, falling back to a new context with the specified type. */ + extern int setexecfilecon(const char *filename, const char *fallback_type); + ++#ifndef DISABLE_RPM + /* Execute a helper for rpm in an appropriate security context. */ + extern int rpm_execcon(unsigned int verified, + const char *filename, + char *const argv[], char *const envp[]); ++#endif + + /* Returns whether a file context is customizable, and should not + be relabeled . */ +diff -up libselinux/src/Makefile.rpm_execcon libselinux/src/Makefile +--- libselinux/src/Makefile.rpm_execcon 2015-12-02 21:18:25.000000000 +0100 ++++ libselinux/src/Makefile 2015-12-10 17:51:26.158784386 +0100 +@@ -85,9 +85,9 @@ ifneq (,$(filter i386,$(ARCH))) + TLSFLAGS += -mno-tls-direct-seg-refs + endif + +-SWIG = swig -Wall -python -o $(SWIGCOUT) -outdir ./ ++SWIG = swig -Wall -python -o $(SWIGCOUT) -outdir ./ $(EMFLAGS) + +-SWIGRUBY = swig -Wall -ruby -o $(SWIGRUBYCOUT) -outdir ./ ++SWIGRUBY = swig -Wall -ruby -o $(SWIGRUBYCOUT) -outdir ./ $(EMFLAGS) + + all: $(LIBA) $(LIBSO) $(LIBPC) + diff --git a/libselinux.spec b/libselinux.spec index 9e61e60..62698c8 100644 --- a/libselinux.spec +++ b/libselinux.spec @@ -9,7 +9,7 @@ Summary: SELinux library and simple utilities Name: libselinux Version: 2.4 -Release: 5%{?dist} +Release: 6%{?dist} License: Public Domain Group: System Environment/Libraries # https://github.com/SELinuxProject/selinux/wiki/Releases @@ -20,6 +20,8 @@ Url: https://github.com/SELinuxProject/selinux/wiki # use make-rhat-patches.sh to create following patches from https://github.com/fedora-selinux/selinux/ # HEAD https://github.com/fedora-selinux/selinux/commit/8c09d34e464e79a602fb9c9408554279aede3b6b Patch1: libselinux-rhat.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1284019 +Patch10: libselinux-rpm_execcon.patch BuildRequires: pkgconfig python-devel ruby-devel ruby libsepol-static >= %{libsepolver} swig pcre-devel xz-devel %if 0%{?with_python3} BuildRequires: python3-devel @@ -103,6 +105,7 @@ needed for developing SELinux applications. %prep %setup -q %patch1 -p1 -b .rhat +%patch10 -p1 -b .rhat %build export LDFLAGS="%{?__global_ldflags}" @@ -248,6 +251,9 @@ rm -rf %{buildroot} %{ruby_vendorarchdir}/selinux.so %changelog +* Thu Dec 10 2015 Petr Lautrbach - 2.4-6 +- Build libselinux without rpm_execcon() (#1284019) + * Thu Oct 15 2015 Robert Kuska - 2.4-5 - Rebuilt for Python3.5 rebuild