diff --git a/157.patch b/157.patch new file mode 100644 index 0000000..24b6820 --- /dev/null +++ b/157.patch @@ -0,0 +1,42 @@ +From a33a2e394435316f3822e89ac9c2a9aabab17252 Mon Sep 17 00:00:00 2001 +From: Pranav Lawate +Date: Tue, 30 Sep 2025 22:29:10 +0530 +Subject: [PATCH] Fix seinfo argument parsing when policy path follows query + options + +Signed-off-by: Pranav Lawate +--- + seinfo | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/seinfo b/seinfo +index 99180c36..d04ec320 100755 +--- a/seinfo ++++ b/seinfo +@@ -12,6 +12,7 @@ import logging + import signal + import ipaddress + import warnings ++from pathlib import Path + from typing import Callable, List, Tuple + + +@@ -102,6 +103,18 @@ xen.add_argument("--devicetreecon", help="Print all devicetreecon statements.", + + args = parser.parse_args() + ++# Fix argument misparsing: when policy is None and a query option is a string, ++# check if the string is actually a policy file that is incorrectly consumed by the query option ++if not args.policy: ++ # Check all query options defined in the queries argument group ++ for action in queries._group_actions: ++ value = getattr(args, action.dest, None) ++ if isinstance(value, str) and Path(value).exists(): ++ # This query argument consumed the policy path - fix it ++ args.policy = value ++ setattr(args, action.dest, True) ++ break ++ + if args.debug: + logging.basicConfig(level=logging.DEBUG, + format='%(asctime)s|%(levelname)s|%(name)s|%(message)s') diff --git a/setools.spec b/setools.spec index 3096dc8..c27aabe 100644 --- a/setools.spec +++ b/setools.spec @@ -3,7 +3,7 @@ Name: setools Version: 4.6.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Policy analysis tools for SELinux License: GPL-2.0-only AND LGPL-2.1-only @@ -14,6 +14,8 @@ Source2: apol.desktop # Remove redundant runtime requirement on setuptools Patch: https://github.com/SELinuxProject/setools/pull/156.patch +# Fix seinfo argument parsing when policy path follows query +Patch: https://github.com/SELinuxProject/setools/pull/157.patch Obsoletes: setools < 4.0.0, setools-devel < 4.0.0 BuildRequires: flex, bison @@ -148,6 +150,9 @@ Python modules designed to facilitate SELinux policy analysis. %{_mandir}/ru/man1/apol* %changelog +* Wed Dec 03 2025 Veronika Syncakova - 4.6.0-2 +- Fix seinfo argument parsing when policy path follows query options (RHEL-118641) + * Thu Oct 23 2025 Vit Mojzis - 4.6.0-1 - SETools 4.6.0 - Drop redundant runtime requirement on python3-setuptools (redux)