SELinux userspace 3.5-rc3 release

This commit is contained in:
Petr Lautrbach 2023-02-13 17:01:45 +01:00
parent 6da7ac70cd
commit 80ecbcb7ea
9 changed files with 22 additions and 92 deletions

1
.gitignore vendored
View File

@ -346,3 +346,4 @@ policycoreutils-2.0.83.tgz
/selinux-3.4.tar.gz
/selinux-3.5-rc1.tar.gz
/selinux-3.5-rc2.tar.gz
/selinux-3.5-rc3.tar.gz

View File

@ -1,4 +1,4 @@
From 55bc2013b480f5a33803f4b41505ac2a535d2bdf Mon Sep 17 00:00:00 2001
From eabd9ffb34666ef467106ef10d8a0e98bbe35f79 Mon Sep 17 00:00:00 2001
From: Petr Lautrbach <plautrba@redhat.com>
Date: Thu, 20 Aug 2015 12:58:41 +0200
Subject: [PATCH] sandbox: add -reset to Xephyr as it works better with it in
@ -23,5 +23,5 @@ index eaa500d08143..4774528027ef 100644
cat > ~/seremote << __EOF
#!/bin/sh
--
2.38.1
2.39.1

View File

@ -1,4 +1,4 @@
From c803df861395e181ed7476df10c04a5ed0dfcdd8 Mon Sep 17 00:00:00 2001
From 4affa1d7888b8489058d2942ea4431ff65f2430e Mon Sep 17 00:00:00 2001
From: Dan Walsh <dwalsh@redhat.com>
Date: Fri, 14 Feb 2014 12:32:12 -0500
Subject: [PATCH] Don't be verbose if you are not on a tty
@ -21,5 +21,5 @@ index 166af6f360a2..ebe64563c7d7 100755
THREADS=""
RPMFILES=""
--
2.38.1
2.39.1

View File

@ -1,4 +1,4 @@
From fb3038c1159ce6bb5094bc2f9feb48554ec8081e Mon Sep 17 00:00:00 2001
From dbebbe4ff79fe790425ca8740e5ace54396671f2 Mon Sep 17 00:00:00 2001
From: Masatake YAMATO <yamato@redhat.com>
Date: Thu, 14 Dec 2017 15:57:58 +0900
Subject: [PATCH] sepolicy-generate: Handle more reserved port types
@ -68,5 +68,5 @@ index b6df3e91160b..36a3ea1196b1 100644
dict[(p['low'], p['high'], p['protocol'])] = (p['type'], p.get('range'))
return dict
--
2.38.1
2.39.1

View File

@ -1,4 +1,4 @@
From 09bf2a4318b44c895ea68d13988cb5c3dfa119ba Mon Sep 17 00:00:00 2001
From 42b676e7677d4efe5383558afb3de962948f7a1d Mon Sep 17 00:00:00 2001
From: Petr Lautrbach <plautrba@redhat.com>
Date: Wed, 18 Jul 2018 09:09:35 +0200
Subject: [PATCH] sandbox: Use matchbox-window-manager instead of openbox
@ -71,5 +71,5 @@ index 4774528027ef..c211ebc14549 100644
export DISPLAY=:$D
cat > ~/seremote << __EOF
--
2.38.1
2.39.1

View File

@ -1,4 +1,4 @@
From 7fb581c76b547b20a149c6dad3d7c51075192bd8 Mon Sep 17 00:00:00 2001
From 74e2d05df2ed090909c0ac6fd7ff7816b94d83ce Mon Sep 17 00:00:00 2001
From: Petr Lautrbach <plautrba@redhat.com>
Date: Fri, 30 Jul 2021 14:14:37 +0200
Subject: [PATCH] Use SHA-2 instead of SHA-1
@ -294,5 +294,5 @@ index bf26e161a71d..36fe6b369548 100644
and provided the
.B \-n
--
2.38.1
2.39.1

View File

@ -1,73 +0,0 @@
From d2c08d621bf8fb3bfaa4460c31d7189a20fcb9a5 Mon Sep 17 00:00:00 2001
From: Vit Mojzis <vmojzis@redhat.com>
Date: Tue, 24 Jan 2023 21:05:05 +0100
Subject: [PATCH] python/sepolicy: Cache conditional rule queries
Commit 7506771e4b630fe0ab853f96574e039055cb72eb
"add missing booleans to man pages" dramatically slowed down
"sepolicy manpage -a" by removing caching of setools rule query.
Re-add said caching and update the query to only return conditional
rules.
Before commit 7506771e:
#time sepolicy manpage -a
real 1m43.153s
# time sepolicy manpage -d httpd_t
real 0m4.493s
After commit 7506771e:
#time sepolicy manpage -a
real 1h56m43.153s
# time sepolicy manpage -d httpd_t
real 0m8.352s
After this commit:
#time sepolicy manpage -a
real 1m41.074s
# time sepolicy manpage -d httpd_t
real 0m7.358s
Signed-off-by: Vit Mojzis <vmojzis@redhat.com>
---
python/sepolicy/sepolicy/__init__.py | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/python/sepolicy/sepolicy/__init__.py b/python/sepolicy/sepolicy/__init__.py
index e2d5c11a..c177cdfc 100644
--- a/python/sepolicy/sepolicy/__init__.py
+++ b/python/sepolicy/sepolicy/__init__.py
@@ -125,6 +125,7 @@ all_attributes = None
booleans = None
booleans_dict = None
all_allow_rules = None
+all_bool_rules = None
all_transitions = None
@@ -1136,6 +1137,14 @@ def get_all_allow_rules():
all_allow_rules = search([ALLOW])
return all_allow_rules
+def get_all_bool_rules():
+ global all_bool_rules
+ if not all_bool_rules:
+ q = TERuleQuery(_pol, boolean=".*", boolean_regex=True,
+ ruletype=[ALLOW, DONTAUDIT])
+ all_bool_rules = [_setools_rule_to_dict(x) for x in q.results()]
+ return all_bool_rules
+
def get_all_transitions():
global all_transitions
if not all_transitions:
@@ -1146,7 +1155,7 @@ def get_bools(setype):
bools = []
domainbools = []
domainname, short_name = gen_short_name(setype)
- for i in map(lambda x: x['booleans'], filter(lambda x: 'booleans' in x and x['source'] == setype, search([ALLOW, DONTAUDIT]))):
+ for i in map(lambda x: x['booleans'], filter(lambda x: 'booleans' in x and x['source'] == setype, get_all_bool_rules())):
for b in i:
if not isinstance(b, tuple):
continue
--
2.37.3

View File

@ -1,7 +1,7 @@
%global libauditver 3.0
%global libsepolver 3.5-0.rc2
%global libsemanagever 3.5-0.rc2
%global libselinuxver 3.5-0.rc2
%global libsepolver 3.5-0.rc3
%global libsemanagever 3.5-0.rc3
%global libselinuxver 3.5-0.rc3
%global generatorsdir %{_prefix}/lib/systemd/system-generators
@ -11,10 +11,10 @@
Summary: SELinux policy core utilities
Name: policycoreutils
Version: 3.5
Release: 0.rc2.3%{?dist}
Release: 0.rc3.1%{?dist}
License: GPL-2.0-or-later
# https://github.com/SELinuxProject/selinux/wiki/Releases
Source0: https://github.com/SELinuxProject/selinux/releases/download/3.5-rc2/selinux-3.5-rc2.tar.gz
Source0: https://github.com/SELinuxProject/selinux/releases/download/3.5-rc3/selinux-3.5-rc3.tar.gz
URL: https://github.com/SELinuxProject/selinux
Source13: system-config-selinux.png
Source14: sepolicy-icons.tgz
@ -28,7 +28,7 @@ Source21: python-po.tgz
Source22: gui-po.tgz
Source23: sandbox-po.tgz
# https://github.com/fedora-selinux/selinux
# $ git format-patch -N 3.5-rc2 -- policycoreutils python gui sandbox dbus semodule-utils restorecond
# $ git format-patch -N 3.5-rc3 -- policycoreutils python gui sandbox dbus semodule-utils restorecond
# $ for j in [0-9]*.patch; do printf "Patch%s: %s\n" ${j/-*/} $j; done
# Patch list start
Patch0001: 0001-sandbox-add-reset-to-Xephyr-as-it-works-better-with-.patch
@ -36,7 +36,6 @@ Patch0002: 0002-Don-t-be-verbose-if-you-are-not-on-a-tty.patch
Patch0003: 0003-sepolicy-generate-Handle-more-reserved-port-types.patch
Patch0004: 0004-sandbox-Use-matchbox-window-manager-instead-of-openb.patch
Patch0005: 0005-Use-SHA-2-instead-of-SHA-1.patch
Patch0006: 0006-python-sepolicy-Cache-conditional-rule-queries.patch
# Patch list end
Obsoletes: policycoreutils < 2.0.61-2
@ -72,7 +71,7 @@ load_policy to load policies, setfiles to label filesystems, newrole
to switch roles.
%prep -p /usr/bin/bash
%autosetup -p 1 -n selinux-%{version}-rc2
%autosetup -p 1 -n selinux-%{version}-rc3
cp %{SOURCE13} gui/
tar -xvf %{SOURCE14} -C python/sepolicy/
@ -444,6 +443,9 @@ The policycoreutils-restorecond package contains the restorecond service.
%systemd_postun_with_restart restorecond.service
%changelog
* Mon Feb 13 2023 Petr Lautrbach <lautrbach@redhat.com> - 3.5-0.rc3.1
- SELinux userspace 3.5-rc3 release
* Wed Feb 8 2023 Petr Lautrbach <lautrbach@redhat.com> - 3.5-0.rc2.3
- Attach tty to selinux-autorelabel.service when AUTORELABEL=0

View File

@ -2,4 +2,4 @@ SHA512 (gui-po.tgz) = 8e0855256b825eea422b8e2b82cc0decf66b902c9930840905c5ad5dda
SHA512 (policycoreutils-po.tgz) = 66b908f7a167225bebded46f9cf92f42eb194daa2a083d48de43c2a5d33fa42724c5add0a9d029ac9d62c500f6f1c8d3bc138dd598b1fd97e609d7cc7160be72
SHA512 (python-po.tgz) = 7f2a082b77c7b4417d5d3dac35d86dd635635a9c05a80e5f9284d03604e2f2a06ec879fb29b056d1a46d3fc448cd76e6fd25196834c18a161fd6677f2e11b2be
SHA512 (sandbox-po.tgz) = 3d4b389b56bab1a6dddce9884dcebdefbefd1017fec6d987ac22a0705f409ed56722387aaca8fe7d9c468862136387bc703062e2b6de8fd102e13fed04ce811b
SHA512 (selinux-3.5-rc2.tar.gz) = 1b4ac2527b76858886c975dbaaae0ee8e30412f63d5c9b0996abf74c215697c4b8faeef4191e46f3faee427e4c96344a064faddaaeacec8e8a54956b3747700a
SHA512 (selinux-3.5-rc3.tar.gz) = 3e542c40fab3fd6480f85acbbd5ca9169c5a50c2d59cf31cba9aca4aea41fdeaec77e81faff375319f8617bc38f91e5497d550f3ad6610c71d743e6ca46d3c77