SELinux userspace 3.5-rc3 release

Resolves: rhbz#2145224, rhbz#2152806
This commit is contained in:
Petr Lautrbach 2023-02-14 17:57:49 +01:00
parent 584de92cc9
commit 9eca638f88
12 changed files with 31 additions and 102 deletions

1
.gitignore vendored
View File

@ -343,3 +343,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 ef92b4c912e3f7ec5bf37dede18451e736fc79b1 Mon Sep 17 00:00:00 2001
From 31ccf6f0fc5e77870f496fac4bea94a6ba2e5c30 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.39.0
2.39.1

View File

@ -1,4 +1,4 @@
From bc692fe683bf89a2065620d0f070b1d71a672dd7 Mon Sep 17 00:00:00 2001
From 837c347bbee5db90d11144363525113edc8baed3 Mon Sep 17 00:00:00 2001
From: Dan Walsh <dwalsh@redhat.com>
Date: Mon, 21 Apr 2014 13:54:40 -0400
Subject: [PATCH] Fix STANDARD_FILE_CONTEXT section in man pages
@ -10,7 +10,7 @@ Signed-off-by: Miroslav Grepl <mgrepl@redhat.com>
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/python/sepolicy/sepolicy/manpage.py b/python/sepolicy/sepolicy/manpage.py
index 1bff8f9acb49..586553bd4d9a 100755
index a488dcbf54f2..7d90ffb5a22f 100755
--- a/python/sepolicy/sepolicy/manpage.py
+++ b/python/sepolicy/sepolicy/manpage.py
@@ -679,10 +679,13 @@ Default Defined Ports:""")
@ -43,5 +43,5 @@ index 1bff8f9acb49..586553bd4d9a 100755
self.fd.write(r"""
.I The following file types are defined for %(domainname)s:
--
2.39.0
2.39.1

View File

@ -1,4 +1,4 @@
From 8c4d5bbcca80017c9a9aa412c2d05a19f6dbf47e Mon Sep 17 00:00:00 2001
From f21d5f9316094015c81339d25d69d3dc7150bd8a Mon Sep 17 00:00:00 2001
From: Miroslav Grepl <mgrepl@redhat.com>
Date: Mon, 12 May 2014 14:11:22 +0200
Subject: [PATCH] If there is no executable we don't want to print a part of
@ -10,7 +10,7 @@ Content-type: text/plain
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/python/sepolicy/sepolicy/manpage.py b/python/sepolicy/sepolicy/manpage.py
index 586553bd4d9a..4c2c46f8c804 100755
index 7d90ffb5a22f..11809dcede43 100755
--- a/python/sepolicy/sepolicy/manpage.py
+++ b/python/sepolicy/sepolicy/manpage.py
@@ -737,7 +737,8 @@ SELinux %(domainname)s policy is very flexible allowing users to setup their %(d
@ -24,5 +24,5 @@ index 586553bd4d9a..4c2c46f8c804 100755
.B STANDARD FILE CONTEXT
--
2.39.0
2.39.1

View File

@ -1,4 +1,4 @@
From 8520b97020f80e271f49d67db1af06dfe3c9d4a3 Mon Sep 17 00:00:00 2001
From 9e22ab3619d68277c89926f3f31e37a9101ca082 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.39.0
2.39.1

View File

@ -1,4 +1,4 @@
From 3ae2b2ade26eae1326222c532bf8a72e54b5c28e Mon Sep 17 00:00:00 2001
From be8bd714f37e6114661f02df4ddb7cb7b25cd0a1 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.39.0
2.39.1

View File

@ -1,4 +1,4 @@
From a573ce33bb4c84497884d0f6251e764dc5dec60f Mon Sep 17 00:00:00 2001
From f4b78eeb59ae1ef4b5926c004debce04ee28dfe7 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.39.0
2.39.1

View File

@ -1,4 +1,4 @@
From f2592c2be7bfd28ef694ccb07753d72d050b1194 Mon Sep 17 00:00:00 2001
From 604a275f53750e4c1e1101bd53c4fd448cc0b5e3 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.39.0
2.39.1

View File

@ -1,4 +1,4 @@
From fcbea75dc27541ac754d0b247cf92a9e503192f7 Mon Sep 17 00:00:00 2001
From b9b94a3254905518f00c4746c0bd712921af31cb Mon Sep 17 00:00:00 2001
From: Petr Lautrbach <plautrba@redhat.com>
Date: Mon, 27 Feb 2017 17:12:39 +0100
Subject: [PATCH] sepolicy: Drop old interface file_type_is_executable(f) and
@ -12,7 +12,7 @@ Content-type: text/plain
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/python/sepolicy/sepolicy/manpage.py b/python/sepolicy/sepolicy/manpage.py
index 4c2c46f8c804..984a5107d59c 100755
index 11809dcede43..543fef6c8d13 100755
--- a/python/sepolicy/sepolicy/manpage.py
+++ b/python/sepolicy/sepolicy/manpage.py
@@ -127,8 +127,24 @@ def gen_domains():
@ -60,5 +60,5 @@ index 4c2c46f8c804..984a5107d59c 100755
if f in self.fcdict:
mpaths = mpaths + self.fcdict[f]["regex"]
--
2.39.0
2.39.1

View File

@ -1,74 +0,0 @@
From 38a0c330a652af92d66ee5f77e6c797a631ff07e 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
Content-type: text/plain
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 e2d5c11a0ca9..c177cdfc529d 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.39.1

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
@ -39,7 +39,6 @@ Patch0005: 0005-sepolicy-generate-Handle-more-reserved-port-types.patch
Patch0006: 0006-sandbox-Use-matchbox-window-manager-instead-of-openb.patch
Patch0007: 0007-Use-SHA-2-instead-of-SHA-1.patch
Patch0008: 0008-sepolicy-Drop-old-interface-file_type_is_executable-.patch
Patch0009: 0009-python-sepolicy-Cache-conditional-rule-queries.patch
# Patch list end
Obsoletes: policycoreutils < 2.0.61-2
Conflicts: filesystem < 3, selinux-policy-base < 3.13.1-138
@ -74,7 +73,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/
@ -445,6 +444,9 @@ The policycoreutils-restorecond package contains the restorecond service.
%systemd_postun_with_restart restorecond.service
%changelog
* Tue Feb 14 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) = e01e8df47a51832f203c316cf19301bc448e89ea489ba520bc021a9960
SHA512 (policycoreutils-po.tgz) = d803a466c245ea58a2fb4c8b6680e6e96b1852d5cd8a0ed2782406e36462fc240e6b46e8efb70f8e7e78f792533d5f725b793e9efb216cddaf2046901bdb9f42
SHA512 (python-po.tgz) = c7ebb27e7de6ebc0452ece828d6fe3cf3a18b60a190625f0f2fab046549143a7499eda1b92b2cd1a134885fdac338278c4f6d617674d81d2fd3814484fde5e52
SHA512 (sandbox-po.tgz) = 1049c61551d22f8a5d2de131e6b3030e86072c27bac29af890f54cbdb8bf358f3adb77488f3160e33dc98aba81af4ab2296c8eb76490651fe7d12838b9988c43
SHA512 (selinux-3.5-rc2.tar.gz) = 1b4ac2527b76858886c975dbaaae0ee8e30412f63d5c9b0996abf74c215697c4b8faeef4191e46f3faee427e4c96344a064faddaaeacec8e8a54956b3747700a
SHA512 (selinux-3.5-rc3.tar.gz) = 3e542c40fab3fd6480f85acbbd5ca9169c5a50c2d59cf31cba9aca4aea41fdeaec77e81faff375319f8617bc38f91e5497d550f3ad6610c71d743e6ca46d3c77