libselinux: bump to 2.7
PATCH 1/8 libselinux: bump to 2.7
remove patch as it's in this release.
--- ...src-regex.c-support-old-compilers-for-the.patch | 47 ---------------------- package/libselinux/libselinux.hash | 4 +- package/libselinux/libselinux.mk | 4 +- 3 files changed, 4 insertions(+), 51 deletions(-) delete mode 100644 package/libselinux/0001-libselinux-src-regex.c-support-old-compilers-for-the.patch
package/libselinux/0001-libselinux-src-regex.c-support-old-compilers-for-the.patch deleted +0 -47
@@ -1,47 +0,0 @@ -From e0803c0bdbb1abf06b6b5bb1b52fdb733505b8f7 Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni <[email protected]> -Date: Wed, 25 Jan 2017 22:41:02 +1300 -Subject: [PATCH] src/regex.c: support old compilers for the endian - check - -libselinux 2.6 has added some code in regex.c that uses __BYTE_ORDER__ -to determine the system endianness. Unfortunately, this definition -provided directly by the compiler doesn't exist in older gcc versions -such as gcc 4.4. - -In order to address this, this commit extends the logic to use -<endian.h> definitions if __BYTE_ORDER__ is not provided by the -compiler. This allows libselinux to build properly with gcc 4.4. - -Signed-off-by: Thomas Petazzoni <[email protected]> ---- - src/regex.c | 13 ++++++++++++- - 1 file changed, 12 insertions(+), 1 deletion(-) - -diff --git a/src/regex.c b/src/regex.c -index a3b427b..0c5ad27 100644 ---- a/src/regex.c -+++ b/src/regex.c -@@ -13,7 +13,18 @@ - #endif - - #ifndef __BYTE_ORDER__ --#error __BYTE_ORDER__ not defined. Unable to determine endianness. -+ -+/* If the compiler doesn't define __BYTE_ORDER__, try to use the C -+ * library <endian.h> header definitions. */ -+#include <endian.h> -+#ifndef __BYTE_ORDER -+#error Neither __BYTE_ORDER__ nor __BYTE_ORDER defined. Unable to determine endianness. -+#endif -+ -+#define __ORDER_LITTLE_ENDIAN __LITTLE_ENDIAN -+#define __ORDER_BIG_ENDIAN __BIG_ENDIAN -+#define __BYTE_ORDER__ __BYTE_ORDER -+ - #endif - - #ifdef USE_PCRE2 --- -2.7.4 -
package/libselinux/libselinux.hash +2 -2
@@ -1,2 +1,2 @@ -# Locally computed -sha256 4ea2dde50665c202253ba5caac7738370ea0337c47b251ba981c60d24e1a118a libselinux-2.6.tar.gz +# From: https://github.com/SELinuxProject/selinux/wiki/Releases +sha256 d0fec0769b3ad60aa7baf9b9a4b7a056827769dc2dadda0dc0eb59b3d1c18c57 libselinux-2.7.tar.gz
package/libselinux/libselinux.mk +2 -2
@@ -4,8 +4,8 @@ # ################################################################################ -LIBSELINUX_VERSION = 2.6 -LIBSELINUX_SITE = https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20161014 +LIBSELINUX_VERSION = 2.7 +LIBSELINUX_SITE = https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20170804 LIBSELINUX_LICENSE = Public Domain LIBSELINUX_LICENSE_FILES = LICENSE
Signature · 1 line
2.13.6
PATCH 2/8 libsemanage: bump to 2.7
--- package/libsemanage/libsemanage.hash | 4 ++-- package/libsemanage/libsemanage.mk | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
package/libsemanage/libsemanage.hash +2 -2
@@ -1,2 +1,2 @@ -# Locally computed -sha256 4f81541047290b751f2ffb926fcd381c186f22db18d9fe671b0b4a6a54e8cfce libsemanage-2.6.tar.gz +# From: https://github.com/SELinuxProject/selinux/wiki/Releases +sha256 07e9477714ce6a4557a1fe924ea4cb06501b62d0fa0e3c0dc32a2cf47cb8d476 libsemanage-2.7.tar.gz
package/libsemanage/libsemanage.mk +2 -2
@@ -4,8 +4,8 @@ # ################################################################################ -LIBSEMANAGE_VERSION = 2.6 -LIBSEMANAGE_SITE = https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20161014 +LIBSEMANAGE_VERSION = 2.7 +LIBSEMANAGE_SITE = https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20170804 LIBSEMANAGE_LICENSE = LGPL-2.1+ LIBSEMANAGE_LICENSE_FILES = COPYING LIBSEMANAGE_DEPENDENCIES = host-bison host-flex audit libselinux ustr bzip2
Signature · 1 line
2.13.6
PATCH 3/8 libsepol: bump to 2.7
In reply to Adam DuskettAlso refresh patches to work with new version.
--- package/libsepol/0001-support-static-only.patch | 32 +++++++++++++++---------- package/libsepol/0003-revert-ln-relative.patch | 18 ++++++++++---- package/libsepol/libsepol.hash | 4 ++-- package/libsepol/libsepol.mk | 4 ++-- 4 files changed, 37 insertions(+), 21 deletions(-)
package/libsepol/0001-support-static-only.patch +19 -13
@@ -1,4 +1,7 @@ -Add support for static-only build +From 2140db697c7f1da2a0a3f7bbcb14c1a0dade84e5 Mon Sep 17 00:00:00 2001 +From: Adam Duskett <[email protected]> +Date: Mon, 9 Oct 2017 16:28:12 -0400 +Subject: [PATCH] Add support for static-only build Instead of unconditionally building shared libraries, this patch improves the libsepol build system with a "STATIC" variable, which
@@ -7,30 +10,30 @@ libraries. It allows to support cases where the target architecture does not have support for shared libraries. Signed-off-by: Thomas Petazzoni <[email protected]> -Signed-off-by: Adam Duskett <[email protected]> - -Index: b/src/Makefile -=================================================================== +Signed-off-by: Adam Duskett <[email protected]> +--- + src/Makefile | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Makefile b/src/Makefile -index db6c2ba..0006285 100644 +index 819d261..040921d 100644 --- a/src/Makefile +++ b/src/Makefile -@@ -30,8 +30,12 @@ LOBJS += $(sort $(patsubst %.c,%.lo,$(wildcard $(CILDIR)/src/*.c) $(CIL_GENERATE - override CFLAGS += -I$(CILDIR)/include +@@ -40,7 +40,12 @@ LDFLAGS += -undefined dynamic_lookup + LN=gln endif +-all: $(LIBA) $(LIBSO) $(LIBPC) +ALL_TARGETS = $(LIBA) $(LIBPC) +ifeq ($(STATIC),) +ALL_TARGETS += $(LIBSO) +endif - --all: $(LIBA) $(LIBSO) $(LIBPC) ++ +all: $(ALL_TARGETS) - + $(LIBA): $(OBJS) -@@ -66,11 +70,13 @@ +@@ -82,11 +87,13 @@ endif install: all test -d $(LIBDIR) || install -m 755 -d $(LIBDIR) install -m 644 $(LIBA) $(LIBDIR)
@@ -41,8 +44,11 @@ index db6c2ba..0006285 100644 +ifeq ($(STATIC),) + test -d $(SHLIBDIR) || install -m 755 -d $(SHLIBDIR) + install -m 755 $(LIBSO) $(SHLIBDIR) - ln -sf --relative $(SHLIBDIR)/$(LIBSO) $(LIBDIR)/$(TARGET) + $(LN) -sf --relative $(SHLIBDIR)/$(LIBSO) $(LIBDIR)/$(TARGET) +endif relabel: /sbin/restorecon $(SHLIBDIR)/$(LIBSO) +-- +2.13.6 +
package/libsepol/0003-revert-ln-relative.patch +14 -4
@@ -1,4 +1,7 @@ -Makefile: revert libsepol: use ln --relative to create .so symlinks +From 16b2b0e21e10727065042a1baabd1a887757c65c Mon Sep 17 00:00:00 2001 +From: Adam Duskett <[email protected]> +Date: Mon, 9 Oct 2017 16:29:36 -0400 +Subject: [PATCH] Makefile: revert libsepol: use ln --relative to create .so symlinks This reverts 71393a181d63c9baae5fe8dcaeb9411d1f253998
@@ -9,16 +12,23 @@ they are maintained (up to 10 years in some cases?). For the sake of Buildroot, revert the upstream patch. Signed-off-by: "Yann E. MORIN" <[email protected]> +--- + src/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) -diff -durN a/src/Makefile b/src/Makefile +diff --git a/src/Makefile b/src/Makefile +index 040921d..e811c9e 100644 --- a/src/Makefile +++ b/src/Makefile -@@ -77,7 +77,7 @@ +@@ -92,7 +92,7 @@ install: all ifeq ($(STATIC),) test -d $(SHLIBDIR) || install -m 755 -d $(SHLIBDIR) install -m 755 $(LIBSO) $(SHLIBDIR) -- ln -sf --relative $(SHLIBDIR)/$(LIBSO) $(LIBDIR)/$(TARGET) +- $(LN) -sf --relative $(SHLIBDIR)/$(LIBSO) $(LIBDIR)/$(TARGET) + cd $(LIBDIR) && ln -sf ../../`basename $(SHLIBDIR)`/$(LIBSO) $(TARGET) endif relabel: +-- +2.13.6 +
package/libsepol/libsepol.hash +2 -2
@@ -1,2 +1,2 @@ -# From https://github.com/SELinuxProject/selinux/wiki/Releases -sha256 d856d6506054f52abeaa3543ea2f2344595a3dc05d0d873ed7f724f7a16b1874 libsepol-2.6.tar.gz +# From: https://github.com/SELinuxProject/selinux/wiki/Releases +sha256 d69d3bd8ec901a3bd5adf2be2fb47fb1a685ed73066ab482e7e505371a48f9e7 libsepol-2.7.tar.gz
package/libsepol/libsepol.mk +2 -2
@@ -4,8 +4,8 @@ # ################################################################################ -LIBSEPOL_VERSION = 2.6 -LIBSEPOL_SITE = https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20161014 +LIBSEPOL_VERSION = 2.7 +LIBSEPOL_SITE = https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20170804 LIBSEPOL_LICENSE = LGPL-2.1+ LIBSEPOL_LICENSE_FILES = COPYING
Signature · 1 line
2.13.6
PATCH 4/8 Checkpolicy: bump to 2.7
In reply to Adam DuskettAlso remove patch, as it's in this release.
--- .../0001-checkpolicy-remove-lfl-from-LDLIBS.patch | 58 ---------------------- package/checkpolicy/checkpolicy.hash | 2 +- package/checkpolicy/checkpolicy.mk | 4 +- 3 files changed, 3 insertions(+), 61 deletions(-) delete mode 100644 package/checkpolicy/0001-checkpolicy-remove-lfl-from-LDLIBS.patch
package/checkpolicy/0001-checkpolicy-remove-lfl-from-LDLIBS.patch deleted +0 -58
@@ -1,58 +0,0 @@ -From 4d215a1e8111e14f6074f7abe2559800b6f4838c Mon Sep 17 00:00:00 2001 -From: Adam Duskett <[email protected]> -Date: Sat, 20 May 2017 11:01:08 -0400 -Subject: [PATCH] checkpolicy: remove -lfl from LDLIBSlogin - -When building checkpolicy/test, the linker reports the following error: -cc dispol.o -lfl /usr/src/selinux/DESTDIR/usr/lib/libsepol.a --L/usr/src/selinux/DESTDIR/usr/lib -o dispol -/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/../../../../lib/libfl.so: -undefined reference to `yylex' -collect2: error: ld returned 1 exit status - -According to flex documentation -(https://github.com/westes/flex/blob/master/doc/flex.texi), -lfl is used -to provide an implementation for yywrap(). However every flex file now -uses "%option noyywrap", which makes -lfl no longer mandatory. Remove -this option from checkpolicy Makefiles. - - -Backported from: -https://patchwork.kernel.org/patch/9450549/ - -Original author: Nicolas Iooss <[email protected]> -Signed-off-by: Adam Duskett <[email protected]> ---- - Makefile | 2 +- - test/Makefile | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/Makefile b/Makefile -index 53a3074..875cf00 100644 ---- a/Makefile -+++ b/Makefile -@@ -20,7 +20,7 @@ CHECKOBJS = y.tab.o lex.yy.o queue.o module_compiler.o parse_util.o \ - CHECKPOLOBJS = $(CHECKOBJS) checkpolicy.o - CHECKMODOBJS = $(CHECKOBJS) checkmodule.o - --LDLIBS=$(LIBDIR)/libsepol.a -lfl -+LDLIBS=$(LIBDIR)/libsepol.a - - GENERATED=lex.yy.c y.tab.c y.tab.h - -diff --git a/test/Makefile b/test/Makefile -index c2367e1..e7bd717 100644 ---- a/test/Makefile -+++ b/test/Makefile -@@ -9,7 +9,7 @@ INCLUDEDIR ?= $(PREFIX)/include - CFLAGS ?= -g -Wall -W -Werror -O2 -pipe - override CFLAGS += -I$(INCLUDEDIR) - --LDLIBS=-lfl $(LIBDIR)/libsepol.a -L$(LIBDIR) -+LDLIBS=$(LIBDIR)/libsepol.a -L$(LIBDIR) - - all: dispol dismod - --- -2.9.3 -
package/checkpolicy/checkpolicy.hash +1 -1
@@ -1,2 +1,2 @@ # https://github.com/SELinuxProject/selinux/wiki/Releases -sha256 0bebd18688ca8027b1b3b4ff1532c0626f1fe49883ae6cb74d9d385940e74157 checkpolicy-2.6.tar.gz +sha256 5413479f1dcde866c19896b4dbfec315d822aa431606e1d03c944408984c3201 checkpolicy-2.7.tar.gz
package/checkpolicy/checkpolicy.mk +2 -2
@@ -4,8 +4,8 @@ # ################################################################################ -CHECKPOLICY_VERSION = 2.6 -CHECKPOLICY_SITE = https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20161014 +CHECKPOLICY_VERSION = 2.7 +CHECKPOLICY_SITE = https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20170804 CHECKPOLICY_LICENSE = GPL-2.0 CHECKPOLICY_LICENSE_FILES = COPYING
Signature · 1 line
2.13.6
PATCH 5/8 policycoreutils: bump to 2.7
In reply to Adam DuskettPolicycoreutils was broken up into several packages, as such several changes needed to happen for this patch to work:
- Remove patches 3, 4, and 5 as they no longer apply.
- Refresh patches 1 and 2 to work with version 2.7
- Remove semodule_${deps,expand,link,package} and sestatus from the makedirs in the mk file.
- Remove restorecond from the make and config file. (Seperate package)
- Remove Audit2allow from the make and config file. (In a different package)
--- ...IR-to-all-paths-that-use-an-absolute-path.patch | 121 ++----------- .../0002-Add-PREFIX-to-host-paths.patch | 200 ++++----------------- .../0003-Remove-hardcoded-arch-variable.patch | 43 ----- ...licy-python-install-arguments-to-be-a-var.patch | 42 ----- .../0005-Check-to-see-if-DBUS-is-enabled.patch | 56 ------ package/policycoreutils/Config.in | 43 ----- package/policycoreutils/policycoreutils.hash | 2 +- package/policycoreutils/policycoreutils.mk | 35 +--- 8 files changed, 51 insertions(+), 491 deletions(-) delete mode 100644 package/policycoreutils/0003-Remove-hardcoded-arch-variable.patch delete mode 100644 package/policycoreutils/0004-Change-sepolicy-python-install-arguments-to-be-a-var.patch delete mode 100644 package/policycoreutils/0005-Check-to-see-if-DBUS-is-enabled.patch
package/policycoreutils/0001-Add-DESTDIR-to-all-paths-that-use-an-absolute-path.patch +14 -107
@@ -1,3 +1,8 @@ +From 85763549c53b2907dab094163f1404b2233f8029 Mon Sep 17 00:00:00 2001 +From: Adam Duskett <[email protected]> +Date: Mon, 9 Oct 2017 16:51:20 -0400 +Subject: [PATCH] Add DESTDIR to setfiles + The addition of this patch makes the use of DESTDIR mandatory as there are conditional checks which would fail if it's not defined.
@@ -9,123 +14,25 @@ Signed-off-by: Clayton Shotwell <[email protected]> Signed-off-by: Niranjan Reddy <[email protected]> Signed-off-by: Adam Duskett <[email protected]> Signed-off-by: Adam Duskett <[email protected]> +refresh for 2.7 +Signed-off-by: Adam Duskett <[email protected]> --- - policycoreutils/Makefile | 2 +- - policycoreutils/newrole/Makefile | 4 ++-- - policycoreutils/restorecond/Makefile | 5 +++-- - policycoreutils/run_init/Makefile | 4 ++-- - policycoreutils/sepolicy/Makefile | 2 +- - policycoreutils/sestatus/Makefile | 2 +- - policycoreutils/setfiles/Makefile | 4 ++-- - 7 files changed, 12 insertions(+), 11 deletions(-) + setfiles/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/Makefile b/Makefile -index 962ac12..0634a2a 100644 ---- a/Makefile -+++ b/Makefile -@@ -1,6 +1,6 @@ - SUBDIRS = sepolicy setfiles semanage load_policy newrole run_init sandbox secon audit2allow sestatus semodule_package semodule semodule_link semodule_expand semodule_deps sepolgen-ifgen setsebool scripts po man gui hll - --INOTIFYH = $(shell ls /usr/include/sys/inotify.h 2>/dev/null) -+INOTIFYH = $(shell ls $(DESTDIR)/usr/include/sys/inotify.h 2>/dev/null) - - ifeq (${INOTIFYH}, /usr/include/sys/inotify.h) - SUBDIRS += restorecond -diff --git a/newrole/Makefile b/newrole/Makefile -index 646cd4d..f124a6a 100644 ---- a/newrole/Makefile -+++ b/newrole/Makefile -@@ -4,8 +4,8 @@ BINDIR ?= $(PREFIX)/bin - MANDIR ?= $(PREFIX)/share/man - ETCDIR ?= $(DESTDIR)/etc - LOCALEDIR = /usr/share/locale --PAMH = $(shell ls /usr/include/security/pam_appl.h 2>/dev/null) --AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null) -+PAMH = $(shell ls $(DESTDIR)/usr/include/security/pam_appl.h 2>/dev/null) -+AUDITH = $(shell ls $(DESTDIR)/usr/include/libaudit.h 2>/dev/null) - # Enable capabilities to permit newrole to generate audit records. - # This will make newrole a setuid root program. - # The capabilities used are: CAP_AUDIT_WRITE. -diff --git a/restorecond/Makefile b/restorecond/Makefile -index f99e1e7..92a4a4d 100644 ---- a/restorecond/Makefile -+++ b/restorecond/Makefile -@@ -11,11 +11,12 @@ autostart_DATA = sealertauto.desktop - INITDIR ?= $(DESTDIR)/etc/rc.d/init.d - SELINUXDIR = $(DESTDIR)/etc/selinux - --DBUSFLAGS = -DHAVE_DBUS -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/lib/dbus-1.0/include -+DBUSFLAGS = -DHAVE_DBUS -I$(DESTDIR)/usr/include/dbus-1.0 -I$(DESTDIR)/usr/lib64/dbus-1.0/include -I$(DESTDIR)/usr/lib/dbus-1.0/include - DBUSLIB = -ldbus-glib-1 -ldbus-1 - - CFLAGS ?= -g -Werror -Wall -W --override CFLAGS += -I$(PREFIX)/include $(DBUSFLAGS) -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/lib/glib-2.0/include -+override CFLAGS += -I$(DESTDIR)/usr/include $(DBUSFLAGS) -I$(DESTDIR)/usr/include/glib-2.0 \ -+-I$(DESTDIR)/usr/lib64/glib-2.0/include -I$(DESTDIR)/usr/lib/glib-2.0/include - - LDLIBS += -lselinux $(DBUSLIB) -lglib-2.0 -L$(LIBDIR) - -diff --git a/run_init/Makefile b/run_init/Makefile -index 5815a08..c81179b 100644 ---- a/run_init/Makefile -+++ b/run_init/Makefile -@@ -5,8 +5,8 @@ SBINDIR ?= $(PREFIX)/sbin - MANDIR ?= $(PREFIX)/share/man - ETCDIR ?= $(DESTDIR)/etc - LOCALEDIR ?= /usr/share/locale --PAMH = $(shell ls /usr/include/security/pam_appl.h 2>/dev/null) --AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null) -+PAMH = $(shell ls $(DESTDIR)/usr/include/security/pam_appl.h 2>/dev/null) -+AUDITH = $(shell ls $(DESTDIR)/usr/include/libaudit.h 2>/dev/null) - - CFLAGS ?= -Werror -Wall -W - override CFLAGS += -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\"" -diff --git a/sepolicy/Makefile b/sepolicy/Makefile -index 39d46e8..6624373 100644 ---- a/sepolicy/Makefile -+++ b/sepolicy/Makefile -@@ -12,7 +12,7 @@ LOCALEDIR ?= /usr/share/locale - BASHCOMPLETIONDIR ?= $(DESTDIR)/usr/share/bash-completion/completions - SHAREDIR ?= $(PREFIX)/share/sandbox - CFLAGS ?= -Wall -Werror -Wextra -W --override CFLAGS += -I$(PREFIX)/include -DPACKAGE="policycoreutils" -DSHARED -shared -+override CFLAGS = $(LDFLAGS) -I$(DESTDIR)/usr/include -DPACKAGE="policycoreutils" -Wall -Werror -Wextra -W -DSHARED -shared - - BASHCOMPLETIONS=sepolicy-bash-completion.sh - -diff --git a/sestatus/Makefile b/sestatus/Makefile -index c04ff00..e10c32c 100644 ---- a/sestatus/Makefile -+++ b/sestatus/Makefile -@@ -6,7 +6,7 @@ ETCDIR ?= $(DESTDIR)/etc - LIBDIR ?= $(PREFIX)/lib - - CFLAGS ?= -Werror -Wall -W --override CFLAGS += -I$(PREFIX)/include -D_FILE_OFFSET_BITS=64 -+override CFLAGS += -I$(DESTDIR)/usr/include -D_FILE_OFFSET_BITS=64 - LDLIBS = -lselinux -L$(LIBDIR) - - all: sestatus diff --git a/setfiles/Makefile b/setfiles/Makefile -index 98f4f7d..eb26ed0 100644 +index c08e2dd..36c0638 100644 --- a/setfiles/Makefile +++ b/setfiles/Makefile -@@ -3,13 +3,13 @@ PREFIX ?= $(DESTDIR)/usr +@@ -3,7 +3,7 @@ PREFIX ?= $(DESTDIR)/usr SBINDIR ?= $(DESTDIR)/sbin MANDIR = $(PREFIX)/share/man LIBDIR ?= $(PREFIX)/lib --AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null) -+AUDITH = $(shell ls $(DESTDIR)/usr/include/libaudit.h 2>/dev/null) +-AUDITH ?= $(shell test -f /usr/include/libaudit.h && echo y) ++AUDITH ?= $(shell test -f $(DESTDIR)/include/libaudit.h && echo y) - PROGRESS_STEP=$(shell grep "^\#define STAR_COUNT" restore.h | awk -S '{ print $$3 }') ABORT_ON_ERRORS=$(shell grep "^\#define ABORT_ON_ERRORS" setfiles.c | awk -S '{ print $$3 }') - CFLAGS ?= -g -Werror -Wall -W --override CFLAGS += -I$(PREFIX)/include -+override CFLAGS += -I$(DESTDIR)/usr/include - LDLIBS = -lselinux -lsepol -L$(LIBDIR) - - ifeq ($(AUDITH), /usr/include/libaudit.h) -- -2.7.4 +2.13.6
package/policycoreutils/0002-Add-PREFIX-to-host-paths.patch +30 -170
237 lines not on this page · raw message
package/policycoreutils/0003-Remove-hardcoded-arch-variable.patch deleted +0 -43
43 lines not on this page · raw message
package/policycoreutils/0004-Change-sepolicy-python-install-arguments-to-be-a-var.patch deleted +0 -42
42 lines not on this page · raw message
package/policycoreutils/0005-Check-to-see-if-DBUS-is-enabled.patch deleted +0 -56
56 lines not on this page · raw message
package/policycoreutils/Config.in +0 -43
54 lines not on this page · raw message
package/policycoreutils/policycoreutils.hash +1 -1
@@ -1,2 +1,2 @@ # https://github.com/SELinuxProject/selinux/wiki/Releases -sha256 68891b376f5048edc53c6ccb2fca44da3dc7f4563f4b6894e201d70c04a05a29 policycoreutils-2.6.tar.gz +sha256 0a1b8a4a323b854981c6755ff025fe98a0f1cff307f109abb260f0490f13e4f4 policycoreutils-2.7.tar.gz
package/policycoreutils/policycoreutils.mk +6 -29
@@ -4,8 +4,8 @@ # ################################################################################ -POLICYCOREUTILS_VERSION = 2.6 -POLICYCOREUTILS_SITE = https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20161014 +POLICYCOREUTILS_VERSION = 2.7 +POLICYCOREUTILS_SITE = https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20170804 POLICYCOREUTILS_LICENSE = GPL-2.0 POLICYCOREUTILS_LICENSE_FILES = COPYING
@@ -41,28 +41,8 @@ POLICYCOREUTILS_MAKE_OPTS += \ POLICYCOREUTILS_MAKE_DIRS = \ load_policy newrole run_init \ - secon semodule semodule_deps \ - semodule_expand semodule_link \ - semodule_package sepolgen-ifgen \ - sestatus setfiles setsebool - -ifeq ($(BR2_PACKAGE_POLICYCOREUTILS_RESTORECOND),y) -POLICYCOREUTILS_MAKE_DIRS += restorecond -POLICYCOREUTILS_DEPENDENCIES += libglib2 -endif - -ifeq ($(BR2_PACKAGE_POLICYCOREUTILS_AUDIT2ALLOW),y) -ifeq ($(BR2_PACKAGE_PYTHON3),y) -POLICYCOREUTILS_DEPENDENCIES += python3 -POLICYCOREUTILS_MAKE_OPTS += PYLIBVER="python$(PYTHON3_VERSION_MAJOR)" -else -POLICYCOREUTILS_DEPENDENCIES += python -POLICYCOREUTILS_MAKE_OPTS += PYLIBVER="python$(PYTHON_VERSION_MAJOR)" -endif - -POLICYCOREUTILS_DEPENDENCIES += sepolgen checkpolicy -POLICYCOREUTILS_MAKE_DIRS += audit2allow -endif + secon semodule sestatus setfiles \ + setsebool # We need to pass DESTDIR at build time because it's used by # policycoreutils build system to find headers and libraries.
@@ -112,10 +92,8 @@ endif # Note: We are only building the programs required by the refpolicy build HOST_POLICYCOREUTILS_MAKE_DIRS = \ - load_policy semodule semodule_deps \ - semodule_expand semodule_link \ - semodule_package setfiles restorecond \ - audit2allow scripts semanage sepolicy + load_policy semodule setfiles \ + scripts semanage sepolicy define HOST_POLICYCOREUTILS_BUILD_CMDS $(foreach d,$(HOST_POLICYCOREUTILS_MAKE_DIRS),
@@ -128,7 +106,6 @@ define HOST_POLICYCOREUTILS_INSTALL_CMDS $(MAKE) -C $(@D)/$(d) $(HOST_POLICYCOREUTILS_MAKE_OPTS) install ) # Fix python paths - $(SED) 's%/usr/bin/%$(HOST_DIR)/bin/%g' $(HOST_DIR)/bin/audit2allow $(SED) 's%/usr/bin/%$(HOST_DIR)/bin/%g' $(HOST_DIR)/bin/sepolgen-ifgen $(SED) 's%/usr/bin/%$(HOST_DIR)/bin/%g' $(HOST_DIR)/bin/sepolicy endef
Signature · 1 line
2.13.6
PATCH 5/8 policycoreutils: bump to 2.7
Hi Adam,
Quoted 9 lines · Adam Duskett
Policycoreutils was broken up into several packages, as such several changes needed to happen for this patch to work:
- Remove patches 3, 4, and 5 as they no longer apply.
- Refresh patches 1 and 2 to work with version 2.7
- Remove semodule_${deps,expand,link,package} and sestatus from the makedirs in the mk file.
- Remove restorecond from the make and config file. (Seperate package)
- Remove Audit2allow from the make and config file. (In a different package)
Like for sepolgen, you'll need to create Config.in.legacy entries for those two.
Obviously that implies that the order of the patches should be different as
well: selinux-python and restorecond must come before this one.
Quoted 29 lines
Signed-off-by Adam Duskett <[email protected]>--- ...IR-to-all-paths-that-use-an-absolute-path.patch | 121 ++----------- .../0002-Add-PREFIX-to-host-paths.patch | 200 ++++----------------- .../0003-Remove-hardcoded-arch-variable.patch | 43 ----- ...licy-python-install-arguments-to-be-a-var.patch | 42 ----- .../0005-Check-to-see-if-DBUS-is-enabled.patch | 56 ------ package/policycoreutils/Config.in | 43 ----- package/policycoreutils/policycoreutils.hash | 2 +- package/policycoreutils/policycoreutils.mk | 35 +--- 8 files changed, 51 insertions(+), 491 deletions(-) delete mode 100644 package/policycoreutils/0003-Remove-hardcoded-arch-variable.patch delete mode 100644 package/policycoreutils/0004-Change-sepolicy-python-install-arguments-to-be-a-var.patch delete mode 100644 package/policycoreutils/0005-Check-to-see-if-DBUS-is-enabled.patchpackage/policycoreutils/0001-Add-DESTDIR-to-all-paths-that-use-an-absolute-path.patch +5
-0@@ -1,3 +1,8 @@ +From 85763549c53b2907dab094163f1404b2233f8029 Mon Sep 17 00:00:00 2001 +From: Adam Duskett <[email protected]> +Date: Mon, 9 Oct 2017 16:51:20 -0400 +Subject: [PATCH] Add DESTDIR to setfiles + The addition of this patch makes the use of DESTDIR mandatory as there are conditional checks which would fail if it's not defined.
package/policycoreutils/0001-Add-DESTDIR-to-all-paths-that-use-an-absolute-path.patch Signed-off-by: Clayton Shotwell <[email protected]> · line 17
Quoted 4 lines
package/policycoreutils/0001-Add-DESTDIR-to-all-paths-that-use-an-absolute-path.patch +1
-0@@ -9,123 +14,25 @@ Signed-off-by: Clayton Shotwell <[email protected]> Signed-off-by: Niranjan Reddy <[email protected]> Signed-off-by: Adam Duskett <[email protected]> Signed-off-by: Adam Duskett <[email protected]> +refresh for 2.7
We normally format this like so:
[Adam: refresh for 2.7]
However, since you're already the author of this patch, it's not required.
Also, there is no need to repeat your Sob 3 times, just one is sufficient.
package/policycoreutils/0001-Add-DESTDIR-to-all-paths-that-use-an-absolute-path.patch Signed-off-by: Clayton Shotwell <[email protected]> · line 18
Quoted 8 lines
package/policycoreutils/0001-Add-DESTDIR-to-all-paths-that-use-an-absolute-path.patch +1
-6+Signed-off-by: Adam Duskett <[email protected]> --- - policycoreutils/Makefile | 2 +- - policycoreutils/newrole/Makefile | 4 ++-- - policycoreutils/restorecond/Makefile | 5 +++-- - policycoreutils/run_init/Makefile | 4 ++-- - policycoreutils/sepolicy/Makefile | 2 +- - policycoreutils/sestatus/Makefile | 2 +-
So they fixed things in all these other Makefiles? Great!
Quoted 4 lines
package/policycoreutils/0001-Add-DESTDIR-to-all-paths-that-use-an-absolute-path.patch +2
-2- policycoreutils/setfiles/Makefile | 4 ++-- - 7 files changed, 12 insertions(+), 11 deletions(-) + setfiles/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-)
[snip]
Quoted 15 lines
package/policycoreutils/0002-Add-PREFIX-to-host-paths.patch +3
-3@@ -1,6 +1,6 @@ -From 7f99a727cdb8160d49bb0d0554fc88787980c971 Mon Sep 17 00:00:00 2001 -From: Adam Duskett <[email protected]> -Date: Thu, 14 Jul 2016 13:16:03 -0400 +From a221304344b3f9db7e86d928cf97d77542bcf456 Mon Sep 17 00:00:00 2001 +From: Adam Duskett <[email protected]> +Date: Mon, 9 Oct 2017 16:47:19 -0400 Subject: [PATCH] Add PREFIX to host paths Updates the remaining hardcoded host paths used in the build to be
package/policycoreutils/0002-Add-PREFIX-to-host-paths.patch Updated to work with version 2.5 · line 15
Quoted 6 lines
package/policycoreutils/0002-Add-PREFIX-to-host-paths.patch +2
-1@@ -11,201 +11,61 @@ Updated to work with version 2.5 Signed-off-by: Clayton Shotwell <[email protected]> Signed-off-by: Niranjan Reddy <[email protected]> Signed-off-by: Adam Duskett <[email protected]> -Signed-off-by: Adam Duskett <[email protected]> +refresh for 2.7 +Signed-off-by: Adam Duskett <[email protected]>
Same comments here, of course.
Regards,
Arnout
[snip]
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH 6/8 sepolgen: Remove package
In reply to Adam Duskettsepolgen has been consolidated into the selinux-python package for version 2.7.
--- package/Config.in | 1 - package/sepolgen/Config.in | 19 ---------------- package/sepolgen/sepolgen.hash | 2 -- package/sepolgen/sepolgen.mk | 49 ------------------------------------------ 4 files changed, 71 deletions(-) delete mode 100644 package/sepolgen/Config.in delete mode 100644 package/sepolgen/sepolgen.hash delete mode 100644 package/sepolgen/sepolgen.mk
package/Config.in +0 -1
@@ -1840,7 +1840,6 @@ menu "Security" source "package/paxtest/Config.in" source "package/policycoreutils/Config.in" source "package/refpolicy/Config.in" - source "package/sepolgen/Config.in" source "package/setools/Config.in" endmenu
package/sepolgen/Config.in deleted +0 -19
@@ -1,19 +0,0 @@ -config BR2_PACKAGE_SEPOLGEN - bool "sepolgen" - depends on BR2_USE_WCHAR # python3 - depends on BR2_USE_MMU # python3 - depends on BR2_TOOLCHAIN_HAS_THREADS # python3 - depends on !BR2_STATIC_LIBS # python3 - select BR2_PACKAGE_PYTHON3 if !BR2_PACKAGE_PYTHON - help - This package contains a Python module that forms the core of - the modern audit2allow (which is a part of the package - policycoreutils). It contains infrastructure for parsing - SELinux related messages as produced by the audit system. - It has facilities for generating policy based on required - access. - -comment "sepolgen needs a toolchain w/ wchar, threads, dynamic library" - depends on BR2_USE_MMU - depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || \ - BR2_STATIC_LIBS
package/sepolgen/sepolgen.hash deleted +0 -2
@@ -1,2 +0,0 @@ -# https://github.com/SELinuxProject/selinux/wiki/Releases -sha256 6a327b1576d914e57ad796a541a7a9bcceefb14c445355559993de0fdb8e7a60 sepolgen-2.6.tar.gz
package/sepolgen/sepolgen.mk deleted +0 -49
49 lines not on this page · raw message
Signature · 1 line
2.13.6
PATCH 6/8 sepolgen: Remove package
Hi Adam,
Quoted 2 lines · Adam Duskett
sepolgen has been consolidated into the selinux-python package for version 2.7.
We want people to be able to upgrade their Buildroot by doing:
git pull
make menuconfig
i.e. they should not loose any package that they previously had.
In this case, people who previously had sepolgen selected will now NOT have it
anymore if they didn't have selinux-python selected.
Therefore, you need to create an entry in Config.in.legacy that selects
selinux-python. Its help text should have what you had in the commit message here.
Regards,
Arnout
Quoted 11 lines
Signed-off-by Adam Duskett <[email protected]>--- package/Config.in | 1 - package/sepolgen/Config.in | 19 ---------------- package/sepolgen/sepolgen.hash | 2 -- package/sepolgen/sepolgen.mk | 49 ------------------------------------------ 4 files changed, 71 deletions(-) delete mode 100644 package/sepolgen/Config.in delete mode 100644 package/sepolgen/sepolgen.hash delete mode 100644 package/sepolgen/sepolgen.mk
[snip]
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH 7/8 restorecond: new package
In reply to Adam Duskettrestorecond is now a seperate package released by the SELinux maintainers.
restorecond is a daemon that watches for file creation and then sets the default SELinux file context for that file.
--- DEVELOPERS | 1 + package/Config.in | 1 + package/restorecond/Config.in | 12 +++++++++ package/restorecond/restorecond.hash | 2 ++ package/restorecond/restorecond.mk | 48 ++++++++++++++++++++++++++++++++++++ 5 files changed, 64 insertions(+) create mode 100644 package/restorecond/Config.in create mode 100644 package/restorecond/restorecond.hash create mode 100644 package/restorecond/restorecond.mk
DEVELOPERS +1 -0
@@ -41,6 +41,7 @@ F: package/libsepol/ F: package/nginx-naxsi/ F: package/policycoreutils/ F: package/python-mutagen/ +F: package/restorecond/ F: package/refpolicy/ F: package/sepolgen/ F: package/setools/
package/Config.in +1 -0
@@ -1840,6 +1840,7 @@ menu "Security" source "package/paxtest/Config.in" source "package/policycoreutils/Config.in" source "package/refpolicy/Config.in" + source "package/restorecond/Config.in" source "package/setools/Config.in" endmenu
package/restorecond/Config.in new file +12 -0
@@ -0,0 +1,12 @@ +config BR2_PACKAGE_RESTORECOND + bool "restorecond" + depends on BR2_PACKAGE_DBUS # dbus-glib + depends on BR2_USE_WCHAR # glib2 + depends on BR2_TOOLCHAIN_HAS_THREADS # glib2 + depends on BR2_USE_MMU # glib2 + select BR2_PACKAGE_LIBSELINUX + select BR2_PACKAGE_DBUS_GLIB + select BR2_PACKAGE_LIBGLIB2 + help + restorecond is a daemon that watches for file creation and then sets the + default SELinux file context for that file.
package/restorecond/restorecond.hash new file +2 -0
@@ -0,0 +1,2 @@ +# https://github.com/SELinuxProject/selinux/wiki/Releases +sha256 cb8e0a8d706cb2c1f105125f3514dffffefcbcfb49199183a7f91ab0bdf1f24d restorecond-2.7.tar.gz
package/restorecond/restorecond.mk new file +48 -0
48 lines not on this page · raw message
Signature · 1 line
2.13.6
PATCH 7/8 restorecond: new package
Quoted 6 lines · Adam Duskett
restorecond is now a seperate package released by the SELinux maintainers.
restorecond is a daemon that watches for file creation and then sets the default SELinux file context for that file.
Signed-off-by Adam Duskett <[email protected]>
[snip]
package/restorecond/Config.in line 11
Quoted 11 lines
package/restorecond/Config.in new file +11
-0+config BR2_PACKAGE_RESTORECOND + bool "restorecond" + depends on BR2_PACKAGE_DBUS # dbus-glib + depends on BR2_USE_WCHAR # glib2 + depends on BR2_TOOLCHAIN_HAS_THREADS # glib2 + depends on BR2_USE_MMU # glib2 + select BR2_PACKAGE_LIBSELINUX + select BR2_PACKAGE_DBUS_GLIB + select BR2_PACKAGE_LIBGLIB2 + help + restorecond is a daemon that watches for file creation and then sets the
This line is too long. Did you run check_package?
Quoted 1 line
package/restorecond/Config.in new file +1
-0+ default SELinux file context for that file.
[snip]
package/restorecond/restorecond.mk line 16
Quoted 5 lines
package/restorecond/restorecond.mk new file +5
-0+RESTORECOND_DEPENDENCIES = libglib2 libselinux dbus-glib + +RESTORECOND_MAKE_OPTS += \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS) -U_FILE_OFFSET_BITS" \
You should carry over the comment about _FILE_OFFSET_BITS.
package/restorecond/restorecond.mk line 21
Quoted 5 lines
package/restorecond/restorecond.mk new file +5
-0+ CPPFLAGS="$(TARGET_CPPFLAGS) -U_FILE_OFFSET_BITS" \ + ARCH="$(BR2_ARCH)" + +# We need to pass DESTDIR at build time because it's used by +# RESTORECOND build system to find headers and libraries.
restorecond (lower case)
Regards,
Arnout
Quoted 28 lines
package/restorecond/restorecond.mk new file +27
-0+define RESTORECOND_BUILD_CMDS + $(MAKE) -C $(@D) $(RESTORECOND_MAKE_OPTS) DESTDIR=$(STAGING_DIR) all +endef + +define RESTORECOND_INSTALL_INIT_SYSV + $(INSTALL) -m 0755 -D $(@D)/restorecond.init \ + $(TARGET_DIR)/etc/init.d/restorecond +endef + +define RESTORECOND_INSTALL_INIT_SYSTEMD + $(INSTALL) -m 0644 -D $(@D)/restorecond.service \ + $(TARGET_DIR)/usr/lib/systemd/system/restorecond.service + + $(INSTALL) -m 0600 -D $(@D)/org.selinux.Restorecond.service \ + $(TARGET_DIR)/etc/systemd/system/org.selinux.Restorecond.service +endef + +define RESTORECOND_INSTALL_TARGET_CMDS + $(INSTALL) -m 0644 -D $(@D)/restorecond.conf $(TARGET_DIR)/etc/selinux + $(INSTALL) -m 0644 -D $(@D)/restorecond_user.conf $(TARGET_DIR)/etc/selinux + $(INSTALL) -m 0755 -D $(@D)/restorecond $(TARGET_DIR)/usr/sbin +endef + + + +$(eval $(generic-package)) +$(eval $(host-generic-package))
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH 8/8 selinux-python: new package
In reply to Adam DuskettThe python utilities that were previously in policycoreutils are now maintained in a seperate package called selinux-python. This package includes:
- audit2allow
- chcat
- semanage
- sepolgen
- sepolicy
Currently, only audit2allow and sepolgen are selectable.
--- DEVELOPERS | 1 + package/Config.in | 1 + package/selinux-python/Config.in | 47 ++++++++++++++++++++++++++ package/selinux-python/selinux-python.hash | 2 ++ package/selinux-python/selinux-python.mk | 53 ++++++++++++++++++++++++++++++ 5 files changed, 104 insertions(+) create mode 100644 package/selinux-python/Config.in create mode 100644 package/selinux-python/selinux-python.hash create mode 100644 package/selinux-python/selinux-python.mk
DEVELOPERS +1 -0
@@ -43,6 +43,7 @@ F: package/policycoreutils/ F: package/python-mutagen/ F: package/restorecond/ F: package/refpolicy/ +F: package/selinux-python/ F: package/sepolgen/ F: package/setools/ F: package/sngrep/
package/Config.in +1 -0
@@ -1841,6 +1841,7 @@ menu "Security" source "package/policycoreutils/Config.in" source "package/refpolicy/Config.in" source "package/restorecond/Config.in" + source "package/selinux-python/Config.in" source "package/setools/Config.in" endmenu
package/selinux-python/Config.in new file +47 -0
47 lines not on this page · raw message
package/selinux-python/selinux-python.hash new file +2 -0
@@ -0,0 +1,2 @@ +# https://github.com/SELinuxProject/selinux/wiki/Releases +sha256 4217cb965ecda96c91e15ffcc2e7ddd13ecc2bf5631100f3cd072a7616f140ed selinux-python-2.7.tar.gz
package/selinux-python/selinux-python.mk new file +53 -0
53 lines not on this page · raw message
Signature · 1 line
2.13.6
PATCH 8/8 selinux-python: new package
Quoted 1 line · Adam Duskett
The python utilities that were previously in policycoreutils are now maintained
^ and sepolgen
Quoted 11 lines
in a seperate package called selinux-python. This package includes:
- audit2allow
- chcat
- semanage
- sepolgen
- sepolicyCurrently, only audit2allow and sepolgen are selectable.
Signed-off-by Adam Duskett <[email protected]>
[snip]
package/selinux-python/Config.in line 5
Quoted 11 lines
package/selinux-python/Config.in new file +5
-0@@ -0,0 +1,47 @@ +menuconfig BR2_PACKAGE_SELINUX_PYTHON + bool "SELinux Python packages" + help + A set of SELinux tools written in python that help with + managing a system with SELinux enabled.
Since nothing will be built unless one of the tools is selected, this should
probably be mentioned in the help text.
Quoted 6 lines
package/selinux-python/Config.in new file +6
-0+ + https://github.com/SELinuxProject/selinux/wiki + +if BR2_PACKAGE_SELINUX_PYTHON + +comment "packages"
package/selinux-python/Config.in line 21
Quoted 10 lines
package/selinux-python/Config.in new file +10
-0+ +config BR2_PACKAGE_SELINUX_PYTHON_AUDIT2ALLOW + bool "audit2allow" + depends on BR2_USE_WCHAR # python3, sepolgen + depends on BR2_USE_MMU # python3, sepolgen + depends on BR2_TOOLCHAIN_HAS_THREADS # python3, sepolgen, checkpolicy + depends on !BR2_STATIC_LIBS # python3, sepolgen + depends on BR2_TOOLCHAIN_USES_GLIBC # checkpolicy + depends on !BR2_arc # checkpolicy + select BR2_PACKAGE_SEPOLGEN
Didn't you just remove sepolgen?
package/selinux-python/Config.in line 23
Quoted 2 lines
package/selinux-python/Config.in new file +2
-0+ select BR2_PACKAGE_CHECKPOLICY + select BR2_PACKAGE_PYTHON3 if !BR2_PACKAGE_PYTHON
This is more appropriate to move up to the BR2_PACKAGE_SELINUX_PYTHON level.
And then the python dependencies as well. The sepolgen comments are actually not relevant any more since sepolgen is now part of this package.
You should then also have a global comment for when selinux-python is not
available, and an additional comment for when audit2allow is not available.
However, let's take a step back here: is it really useful to have separate
options for the different tools? Isn't it easier to just install everything, excluding audit2allow if checkpolicy is not selected? Or is there a significant size difference?
Quoted 4 lines
package/selinux-python/Config.in new file +4
-0+ help + Enable audit2allow to be built + +config BR2_PACKAGE_SELINUX_PYTHON_SEPOLGEN
package/selinux-python/Config.in
Quoted 10 lines
package/selinux-python/Config.in new file +10
-0+ bool "sepolgen" + depends on BR2_USE_WCHAR # python3 + depends on BR2_USE_MMU # python3 + depends on BR2_TOOLCHAIN_HAS_THREADS # python3 + depends on !BR2_STATIC_LIBS # python3 + select BR2_PACKAGE_PYTHON3 if !BR2_PACKAGE_PYTHON + help + This package contains a Python module that forms the core of + the modern audit2allow (which is a part of the package + policycoreutils).
No it's not, it's part of this package...
Quoted 30 lines
package/selinux-python/Config.in new file +10
-0It contains infrastructure for parsing + SELinux related messages as produced by the audit system. + It has facilities for generating policy based on required + access. + +comment "sepolgen needs a toolchain w/ wchar, threads, dynamic library" + depends on BR2_USE_MMU + depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || \ + BR2_STATIC_LIBS + +endifpackage/selinux-python/selinux-python.hash new file +2
-0@@ -0,0 +1,2 @@ +# https://github.com/SELinuxProject/selinux/wiki/Releases +sha256 4217cb965ecda96c91e15ffcc2e7ddd13ecc2bf5631100f3cd072a7616f140ed selinux-python-2.7.tar.gzpackage/selinux-python/selinux-python.mk new file +5
-0@@ -0,0 +1,53 @@ +################################################################################ +# +# selinux-python +# +################################################################################
package/selinux-python/selinux-python.mk line 15
Quoted 10 lines
package/selinux-python/selinux-python.mk new file +10
-0+ +SELINUX_PYTHON_VERSION = 2.7 +SELINUX_PYTHON_SITE = https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20170804 +SELINUX_PYTHON_LICENSE = GPL-2.0 +SELINUX_PYTHON_LICENSE_FILES = COPYING + +SELINUX_PYTHON_MAKE_OPTS += \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + CPPFLAGS="$(TARGET_CPPFLAGS)" \
These two are already part of TARGET_CONFIGURE_OPTS so they shouldn't be needed.
package/selinux-python/selinux-python.mk line 22
Quoted 7 lines
package/selinux-python/selinux-python.mk new file +7
-0+ ARCH="$(BR2_ARCH)" \ + LIBDIR="$(STAGING_DIR)/usr/lib" + +ifeq ($(BR2_PACKAGE_PYTHON3),y) +HOST_SELINUX_PYTHON_DEPENDENCIES += host-python3 +HOST_SELINUX_PYTHON_MAKE_OPTS += \ + PYLIBVER="python$(PYTHON3_VERSION_MAJOR)"
There is no host-selinux-python, you only enable a target package here... And
you'd probably need this for the target package, no? Well, probably you don't or you would have noticed, so possibly this is redundant?
Hm, actually, there was a host-sepolgen so you should probably have a
host-selinux-python as well.
Regards,
Arnout
Quoted 32 lines
package/selinux-python/selinux-python.mk new file +31
-0+else +HOST_SELINUX_PYTHON_DEPENDENCIES += host-python +HOST_SELINUX_PYTHON_MAKE_OPTS += \ + PYLIBVER="python$(PYTHON_VERSION_MAJOR)" +endif + +ifeq ($(BR2_PACKAGE_SELINUX_PYTHON_AUDIT2ALLOW),y) +SELINUX_PYTHON_DEPENDENCIES += checkpolicy +SELINUX_PYTHON_MAKE_DIRS += audit2allow + +endif + +ifeq ($(BR2_PACKAGE_SELINUX_PYTHON_SEPOLGEN),y) +SELINUX_PYTHON_MAKE_DIRS += sepolgen/src/sepolgen +endif + +define SELINUX_PYTHON_BUILD_CMDS + $(foreach d,$(SELINUX_PYTHON_MAKE_DIRS), + $(MAKE) -C $(@D)/$(d) $(SELINUX_PYTHON_MAKE_OPTS) \ + DESTDIR=$(STAGING_DIR) all + ) +endef + +define SELINUX_PYTHON_INSTALL_TARGET_CMDS + $(foreach d,$(SELINUX_PYTHON_MAKE_DIRS), + $(MAKE) -C $(@D)/$(d) $(SELINUX_PYTHON_MAKE_OPTS) \ + DESTDIR=$(TARGET_DIR) install + ) +endef + +$(eval $(generic-package))
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH 8/8 selinux-python: new package
Hey Arnout
Quoted 18 lines · Arnout Vandecappelle
Quoted 1 line · Adam Duskett
The python utilities that were previously in policycoreutils are now maintained
^ and sepolgen
Quoted 11 lines
in a seperate package called selinux-python. This package includes:
- audit2allow
- chcat
- semanage
- sepolgen
- sepolicyCurrently, only audit2allow and sepolgen are selectable.
Signed-off-by Adam Duskett <[email protected]>[snip]
Quoted 15 lines
package/selinux-python/Config.in line 5
Quoted 11 lines
package/selinux-python/Config.in new file +5
-0@@ -0,0 +1,47 @@ +menuconfig BR2_PACKAGE_SELINUX_PYTHON + bool "SELinux Python packages" + help + A set of SELinux tools written in python that help with + managing a system with SELinux enabled.Since nothing will be built unless one of the tools is selected, this should
probably be mentioned in the help text.
Fair enough!
Quoted 10 lines
Quoted 10 lines
package/selinux-python/Config.in new file +10
-0+ + https://github.com/SELinuxProject/selinux/wiki + +if BR2_PACKAGE_SELINUX_PYTHON + +comment "packages" + +config BR2_PACKAGE_SELINUX_PYTHON_AUDIT2ALLOW + bool "audit2allow" + depends on BR2_USE_WCHAR # python3, sepolgen
Quoted 9 lines
package/selinux-python/Config.in line 21
Quoted 6 lines
package/selinux-python/Config.in new file +6
-0+ depends on BR2_USE_MMU # python3, sepolgen + depends on BR2_TOOLCHAIN_HAS_THREADS # python3, sepolgen, checkpolicy + depends on !BR2_STATIC_LIBS # python3, sepolgen + depends on BR2_TOOLCHAIN_USES_GLIBC # checkpolicy + depends on !BR2_arc # checkpolicy + select BR2_PACKAGE_SEPOLGENDidn't you just remove sepolgen?
Gah! So many packages! Just a typo, will fix.
Quoted 10 lines
package/selinux-python/Config.in line 23
Quoted 2 lines
package/selinux-python/Config.in new file +2
-0+ select BR2_PACKAGE_CHECKPOLICY + select BR2_PACKAGE_PYTHON3 if !BR2_PACKAGE_PYTHONThis is more appropriate to move up to the
BR2_PACKAGE_SELINUX_PYTHONlevel.
And then the python dependencies as well. The sepolgen comments are actually not relevant any more since sepolgen is now part of this package.You should then also have a global comment for when selinux-python is not
available, and an additional comment for when audit2allow is not available.
Can do.
Quoted 5 lines
However, let's take a step back here: is it really useful to have separate
options for the different tools? Isn't it easier to just install everything, excluding audit2allow if checkpolicy is not selected? Or is there a significant size difference?
It's not about the size difference. When it comes to security, and specifically about SELinux,
some people might not want all of these things enabled. I also wouldn't want all of these
tools and packages installed if I don't need them. The extra logic is minimal, and currently,
we only have audit2allow and sepolgen anyways. If a end user was to do a "git pull" and run
"make" after that, I wouldn't want a bunch of extra packages I didn't select being installed on
my filing system.
Quoted 72 lines
Quoted 4 lines
package/selinux-python/Config.in new file +4
-0+ help + Enable audit2allow to be built + +config BR2_PACKAGE_SELINUX_PYTHON_SEPOLGENpackage/selinux-python/Config.in
Quoted 10 lines
package/selinux-python/Config.in new file +10
-0+ bool "sepolgen" + depends on BR2_USE_WCHAR # python3 + depends on BR2_USE_MMU # python3 + depends on BR2_TOOLCHAIN_HAS_THREADS # python3 + depends on !BR2_STATIC_LIBS # python3 + select BR2_PACKAGE_PYTHON3 if !BR2_PACKAGE_PYTHON + help + This package contains a Python module that forms the core of + the modern audit2allow (which is a part of the package + policycoreutils).No it's not, it's part of this package...
Quoted 30 lines
package/selinux-python/Config.in new file +10
-0It contains infrastructure for parsing + SELinux related messages as produced by the audit system. + It has facilities for generating policy based on required + access. + +comment "sepolgen needs a toolchain w/ wchar, threads, dynamic library" + depends on BR2_USE_MMU + depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || \ + BR2_STATIC_LIBS + +endifpackage/selinux-python/selinux-python.hash new file +2
-0@@ -0,0 +1,2 @@ +# https://github.com/SELinuxProject/selinux/wiki/Releases +sha256 4217cb965ecda96c91e15ffcc2e7ddd13ecc2bf5631100f3cd072a7616f140ed selinux-python-2.7.tar.gzpackage/selinux-python/selinux-python.mk new file +5
-0@@ -0,0 +1,53 @@ +################################################################################ +# +# selinux-python +# +################################################################################package/selinux-python/selinux-python.mk line 15
Quoted 10 lines
package/selinux-python/selinux-python.mk new file +10
-0+ +SELINUX_PYTHON_VERSION = 2.7 +SELINUX_PYTHON_SITE = https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20170804 +SELINUX_PYTHON_LICENSE = GPL-2.0 +SELINUX_PYTHON_LICENSE_FILES = COPYING + +SELINUX_PYTHON_MAKE_OPTS += \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + CPPFLAGS="$(TARGET_CPPFLAGS)" \These two are already part of
TARGET_CONFIGURE_OPTSso they shouldn't be needed.package/selinux-python/selinux-python.mk line 22
Quoted 7 lines
package/selinux-python/selinux-python.mk new file +7
-0+ ARCH="$(BR2_ARCH)" \ + LIBDIR="$(STAGING_DIR)/usr/lib" + +ifeq ($(BR2_PACKAGE_PYTHON3),y) +HOST_SELINUX_PYTHON_DEPENDENCIES += host-python3 +HOST_SELINUX_PYTHON_MAKE_OPTS += \ + PYLIBVER="python$(PYTHON3_VERSION_MAJOR)"There is no host-selinux-python, you only enable a target package here... And
you'd probably need this for the target package, no? Well, probably you don't or you would have noticed, so possibly this is redundant?
Quoted 3 lines
Hm, actually, there was a host-sepolgen so you should probably have a
host-selinux-python as well.
Yeah, I will make sure host-selinux-python is added.
Quoted 44 lines
Regards,
ArnoutQuoted 22 lines
package/selinux-python/selinux-python.mk new file +21
-0+else +HOST_SELINUX_PYTHON_DEPENDENCIES += host-python +HOST_SELINUX_PYTHON_MAKE_OPTS += \ + PYLIBVER="python$(PYTHON_VERSION_MAJOR)" +endif + +ifeq ($(BR2_PACKAGE_SELINUX_PYTHON_AUDIT2ALLOW),y) +SELINUX_PYTHON_DEPENDENCIES += checkpolicy +SELINUX_PYTHON_MAKE_DIRS += audit2allow + +endif + +ifeq ($(BR2_PACKAGE_SELINUX_PYTHON_SEPOLGEN),y) +SELINUX_PYTHON_MAKE_DIRS += sepolgen/src/sepolgen +endif + +define SELINUX_PYTHON_BUILD_CMDS + $(foreach d,$(SELINUX_PYTHON_MAKE_DIRS), + $(MAKE) -C $(@D)/$(d) $(SELINUX_PYTHON_MAKE_OPTS) \ + DESTDIR=$(STAGING_DIR) all + )package/selinux-python/selinux-python.mk line 53
Quoted 10 lines
package/selinux-python/selinux-python.mk new file +10
-0+endef + +define SELINUX_PYTHON_INSTALL_TARGET_CMDS + $(foreach d,$(SELINUX_PYTHON_MAKE_DIRS), + $(MAKE) -C $(@D)/$(d) $(SELINUX_PYTHON_MAKE_OPTS) \ + DESTDIR=$(TARGET_DIR) install + ) +endef + +$(eval $(generic-package))--
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH 1/8 libselinux: bump to 2.7
In reply to Adam DuskettHi Adam,
Quoted 3 lines · Adam Duskett
remove patch as it's in this release.
Signed-off-by Adam Duskett <[email protected]>
[snip]
package/libselinux/libselinux.mk line 8
Quoted 4 lines
package/libselinux/libselinux.mk +2
-2-LIBSELINUX_VERSION = 2.6 -LIBSELINUX_SITE = https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20161014 +LIBSELINUX_VERSION = 2.7 +LIBSELINUX_SITE = https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20170804
You update all the individual packages in separate patches, which is excellent
for review. However, I wonder if it is really possible to update just one of them without updating the rest. Does libselinux-2.7 work with libsepol-2.7?
If not, we should probably squash all patches into one single patch while
applying. Thomas, Peter, do you agree?
With that in mind, it would probably be useful to define a globalSELINUX_VERSION and SELINUX_SITE that is used in all those packages. Then updating is only possible with all packages combined, which is harder to review but probably what we want anyway. Making this global SELINUX_VERSION and SELINUX_SITE can be done independently of this series later.
Regards,
Arnout
Quoted 4 lines
LIBSELINUX_LICENSE= Public Domain
LIBSELINUX_LICENSE_FILES= LICENSE
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH 1/8 libselinux: bump to 2.7
Hello,
Quoted 6 lines · Arnout Vandecappelle
You update all the individual packages in separate patches, which is excellent
for review. However, I wonder if it is really possible to update just one of them without updating the rest. Does libselinux-2.7 work with libsepol-2.7?If not, we should probably squash all patches into one single patch while
applying. Thomas, Peter, do you agree?
I don't really have a strong opinion. I think it's sometimes hard to achieve both full bisectability and fine-grained patches.
In the same vein, in your review of comment PATCH 5/8 on policycoreutils, you rightfully tell Adam that the patch adding the new restorecond should come *before* the bump of policycoreutils that drops the built-in restorecond functionality. This is obviously correct, but it means that there is a step where you have both the new restorecond package and the old policycoreutils package, possibly stepping on each other, or maybe even with restorecond not building (because it needs the newer version of policycoreutils or something).
So, it's probably hard to have something that is both easy to review (fine-grained patches) and bisectable (one big patch).
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH 1/8 libselinux: bump to 2.7
Quoted 23 lines · Thomas Petazzoni
Hello,
Quoted 6 lines · Arnout Vandecappelle
You update all the individual packages in separate patches, which is excellent
for review. However, I wonder if it is really possible to update just one of them without updating the rest. Does libselinux-2.7 work with libsepol-2.7?If not, we should probably squash all patches into one single patch while
applying. Thomas, Peter, do you agree?I don't really have a strong opinion. I think it's sometimes hard to achieve both full bisectability and fine-grained patches.
In the same vein, in your review of comment PATCH 5/8 on policycoreutils, you rightfully tell Adam that the patch adding the new restorecond should come *before* the bump of policycoreutils that drops the built-in restorecond functionality. This is obviously correct, but it means that there is a step where you have both the new restorecond package and the old policycoreutils package, possibly stepping on each other, or maybe even with restorecond not building (because it needs the newer version of policycoreutils or something).
Quoted 2 lines
So, it's probably hard to have something that is both easy to review (fine-grained patches) and bisectable (one big patch).
For such situations, I would prefer if they were fine-grained patches but with
a cover letter explaining that they should be squashed. Perhaps also a subject line that clarifies that, maybe even using the interactive autorebase format ("fixup: subject line of the first patch"). And of course the first patch should have the full final commit log.
I don't mind big patches in the history. Big patches on the list are not so
nice. They tend to never get reviewed.
That said, I'm not such a sucker for bisectability anyway. Bisecting is rarely
useful in Buildroot, since you usually know pretty well which commits may have broken things (and AFAIK git bisect has no option to specify "only consider patches affecting these subdirs"). And when it's a series anyway, it's pretty unlikely that the bisect gets stuck in the middle of the series.
So possibly the least effort approach is: fine-grained patches, don't comment
on their bisectability, and committer may squash if they feel like it.
So Adam, you can ignore my comments about the order of patches. You'll still
have to correct the legacy stuff however.
Regards,
Arnout
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH 1/8 libselinux: bump to 2.7
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Arnout" == Arnout Vandecappelle <[email protected]> writes:
Hi,
Quoted 5 lines
That said, I'm not such a sucker for bisectability anyway. Bisecting is rarely
useful in Buildroot, since you usually know pretty well which commits may have broken things (and AFAIK git bisect has no option to specify "only consider patches affecting these subdirs"). And when it's a series anyway, it's pretty unlikely that the bisect gets stuck in the middle of the series.
Actually it does: git bisect start -- <paths>
Quoted 2 lines
So possibly the least effort approach is: fine-grained patches, don't comment
on their bisectability, and committer may squash if they feel like it.
Agreed.
Signature · 1 line
Bye, Peter Korsgaard