Compare commits

..

No commits in common. "103a58825e37d5bfef0d660c5ec9e41a869a8d31" and "63ef9a236d4e11d22fd60cd67f3b637f213b095d" have entirely different histories.

5 changed files with 79 additions and 44 deletions

BIN
4.4.0.tar.gz Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,43 +1,43 @@
From c2df1a843136f2eced9bbc13e766024d560a97ee Mon Sep 17 00:00:00 2001
From e47d19f4985098ca316eea4a383510d419ec6055 Mon Sep 17 00:00:00 2001
From: Vit Mojzis <vmojzis@redhat.com>
Date: Fri, 26 Apr 2019 15:27:25 +0200
Subject: [PATCH] Do not export/use setools.InfoFlowAnalysis and
setools.DomainTransitionAnalysis
dta and infoflow modules require networkx which brings lot of
dependencies.
dta and infoflow modules require networkx which brings lot of dependencies.
These dependencies are not necessary for setools module itself as it's
used in policycoreutils.
Therefore it's better to use setools.infoflow.InfoFlowAnalysis and
setools.dta.DomainTransitionAnalysis and let the package containing
sedta and seinfoflow to require python3-networkx
---
sedta | 6 +++---
sedta | 5 +++--
seinfoflow | 4 ++--
setools/__init__.py | 4 ----
setoolsgui/apol/dta.py | 2 +-
setoolsgui/apol/infoflow.py | 2 +-
5 files changed, 7 insertions(+), 11 deletions(-)
tests/dta.py | 2 +-
tests/infoflow.py | 2 +-
7 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/sedta b/sedta
index ffd9ede..30ff7f8 100755
index 57070098fe10..51890ea8ea73 100755
--- a/sedta
+++ b/sedta
@@ -10,9 +10,9 @@ import logging
@@ -23,9 +23,10 @@ import logging
import signal
import setools
+import setools.dta
-
-def print_transition(trans: setools.DomainTransition) -> None:
+def print_transition(trans: setools.dta.DomainTransition) -> None:
print()
if trans.transition:
@@ -104,7 +104,7 @@ else:
print("Domain transition rule(s):")
for t in trans.transition:
@@ -114,7 +115,7 @@ else:
try:
p = setools.SELinuxPolicy(args.policy)
@ -47,11 +47,11 @@ index ffd9ede..30ff7f8 100755
if args.shortest_path or args.all_paths:
if args.shortest_path:
diff --git a/seinfoflow b/seinfoflow
index 5f4e764..f5b231d 100755
index 0ddcfdc7c1fb..8321718b2640 100755
--- a/seinfoflow
+++ b/seinfoflow
@@ -4,7 +4,7 @@
# SPDX-License-Identifier: GPL-2.0-only
@@ -17,7 +17,7 @@
# along with SETools. If not, see <http://www.gnu.org/licenses/>.
#
-import setools
@ -59,7 +59,7 @@ index 5f4e764..f5b231d 100755
import argparse
import sys
import logging
@@ -91,7 +91,7 @@ elif args.booleans is not None:
@@ -102,7 +102,7 @@ elif args.booleans is not None:
try:
p = setools.SELinuxPolicy(args.policy)
m = setools.PermissionMap(args.map)
@ -69,10 +69,10 @@ index 5f4e764..f5b231d 100755
if args.shortest_path or args.all_paths:
diff --git a/setools/__init__.py b/setools/__init__.py
index ad9b36a..5cb5e0f 100644
index d72d343e7e79..642485b9018d 100644
--- a/setools/__init__.py
+++ b/setools/__init__.py
@@ -77,12 +77,8 @@ from .pcideviceconquery import PcideviceconQuery
@@ -91,12 +91,8 @@ from .pcideviceconquery import PcideviceconQuery
from .devicetreeconquery import DevicetreeconQuery
# Information Flow Analysis
@ -86,10 +86,10 @@ index ad9b36a..5cb5e0f 100644
from .diff import PolicyDifference
diff --git a/setoolsgui/apol/dta.py b/setoolsgui/apol/dta.py
index a78d960..e71c70a 100644
index 62dbf04d9a5e..0ea000e790f0 100644
--- a/setoolsgui/apol/dta.py
+++ b/setoolsgui/apol/dta.py
@@ -11,7 +11,7 @@ from PyQt5.QtCore import pyqtSignal, Qt, QStringListModel, QThread
@@ -24,7 +24,7 @@ from PyQt5.QtCore import pyqtSignal, Qt, QStringListModel, QThread
from PyQt5.QtGui import QPalette, QTextCursor
from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog, \
QTreeWidgetItem
@ -99,10 +99,10 @@ index a78d960..e71c70a 100644
from ..logtosignal import LogHandlerToSignal
from .analysistab import AnalysisSection, AnalysisTab
diff --git a/setoolsgui/apol/infoflow.py b/setoolsgui/apol/infoflow.py
index fb9b409..738f1b8 100644
index 28009aa2329c..92d350bf727c 100644
--- a/setoolsgui/apol/infoflow.py
+++ b/setoolsgui/apol/infoflow.py
@@ -13,7 +13,7 @@ from PyQt5.QtCore import pyqtSignal, Qt, QStringListModel, QThread
@@ -26,7 +26,7 @@ from PyQt5.QtCore import pyqtSignal, Qt, QStringListModel, QThread
from PyQt5.QtGui import QPalette, QTextCursor
from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog, \
QTreeWidgetItem
@ -111,6 +111,32 @@ index fb9b409..738f1b8 100644
from setools.exception import UnmappedClass, UnmappedPermission
from ..logtosignal import LogHandlerToSignal
diff --git a/tests/dta.py b/tests/dta.py
index a0cc9381469c..177e6fb0b961 100644
--- a/tests/dta.py
+++ b/tests/dta.py
@@ -18,7 +18,7 @@
import os
import unittest
-from setools import DomainTransitionAnalysis
+from setools.dta import DomainTransitionAnalysis
from setools import TERuletype as TERT
from setools.exception import InvalidType
from setools.policyrep import Type
diff --git a/tests/infoflow.py b/tests/infoflow.py
index aa0e44a7e4f8..fca2848aeca5 100644
--- a/tests/infoflow.py
+++ b/tests/infoflow.py
@@ -18,7 +18,7 @@
import os
import unittest
-from setools import InfoFlowAnalysis
+from setools.infoflow import InfoFlowAnalysis
from setools import TERuletype as TERT
from setools.exception import InvalidType
from setools.permmap import PermissionMap
--
2.27.0
2.30.0

View File

@ -0,0 +1,24 @@
From a2faa263c9dd8bcf51465861046e0406a84975c0 Mon Sep 17 00:00:00 2001
From: Petr Lautrbach <plautrba@redhat.com>
Date: Thu, 2 Apr 2020 16:06:14 +0200
Subject: [PATCH] Require networkx on package level
It allows us to ship python3-setools without dependency on python3-networkx
---
setup.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/setup.py b/setup.py
index 457c83049ca5..4bfd438002bb 100644
--- a/setup.py
+++ b/setup.py
@@ -170,5 +170,5 @@ setup(name='setools',
# setup also requires libsepol and libselinux
# C libraries and headers to compile.
setup_requires=['setuptools', 'Cython>=0.27'],
- install_requires=['setuptools', 'networkx>=2.0']
+ install_requires=['setuptools']
)
--
2.26.0.rc2

View File

@ -1,5 +1,5 @@
Name: setools
Version: 4.4.3
Version: 4.4.0
Release: 1
Summary: Policy Analysis Tools for SELinux
License: GPLv2
@ -9,13 +9,14 @@ Source1: setools.pam
Source2: apol.desktop
Patch0: Do-not-export-use-setools.InfoFlowAnalysis-and-setoo.patch
Patch1: Require-networkx-on-package-level.patch
BuildRequires: flex bison glibc-devel gcc swig git python3-setuptools
BuildRequires: qt5-qtbase-devel python3-devel
BuildRequires: libsepol-devel >= 3.2 libsepol-static >= 3.2 libselinux-devel
BuildRequires: python3-Cython
BuildRequires: python3-setuptools python3-networkx checkpolicy
Obsoletes: setools < %{version}, setools-devel < %{version}
BuildRequires: python3-setuptools
Obsoletes: setools < 4.0.0, setools-devel < 4.0.0
%description
SETools consists of a number of SELinux policy analysis tools, both graphical
@ -73,10 +74,9 @@ Gui packages for setools.
%py3_install
%check
sed -i "s#from setools import InfoFlowAnalysis#from setools.infoflow import InfoFlowAnalysis#" ./tests/test_conditionalinfoflow.py
sed -i "s#from setools import InfoFlowAnalysis#from setools.infoflow import InfoFlowAnalysis#" ./tests/test_infoflow.py
sed -i "s#from setools import DomainTransitionAnalysis#from setools.dta import DomainTransitionAnalysis#" ./tests/test_dta.py
%if %{?_with_check:1}%{!?_with_check:0}
%{__python3} setup.py test
%endif
%files
@ -111,21 +111,6 @@ sed -i "s#from setools import DomainTransitionAnalysis#from setools.dta import D
%{_mandir}/ru/man1/*
%changelog
* Wed Aug 16 2023 dillon chen <dillon.chen@gmail.com> - 4.4.3-1
- update setools to 4.4.3
* Fir Aug 04 2023 jinlun <jinlun@huawei.com> - 4.4.2-2
- fix in the test phase error
* Thu Jul 20 2023 jinlun <jinlun@huawei.com> - 4.4.2-1
- update setools to 4.4.2
* Thu Feb 16 2023 jinlun <jinlun@huawei.com> - 4.4.0-3
- add code check
* Tue Aug 2 2022 xuwenlong <xuwenlong16@huawei.com> - 4.4.0-2
- change release for rebulid
* Sat Jan 22 2022 panxiaohe <panxiaohe@huawei.com> - 4.4.0-1
- update setools to 4.4.0
- add requires python3-networkx and python3-qt5 for subpackages