Blame SOURCES/0049-python-Harden-tools-against-rogue-modules.patch

017072
From 72c7e9123980b003a21d51e2805529a3e90b2460 Mon Sep 17 00:00:00 2001
017072
From: Vit Mojzis <vmojzis@redhat.com>
017072
Date: Thu, 13 Oct 2022 17:33:18 +0200
017072
Subject: [PATCH] python: Harden tools against "rogue" modules
017072
017072
Python scripts present in "/usr/sbin" override regular modules.
017072
Make sure /usr/sbin is not present in PYTHONPATH.
017072
017072
Fixes:
017072
  #cat > /usr/sbin/audit.py <
017072
  import sys
017072
  print("BAD GUY!", file=sys.stderr)
017072
  sys.exit(1)
017072
  EOF
017072
  #semanage boolean -l
017072
  BAD GUY!
017072
017072
Signed-off-by: Vit Mojzis <vmojzis@redhat.com>
017072
---
017072
 python/audit2allow/audit2allow    | 2 +-
017072
 python/audit2allow/sepolgen-ifgen | 2 +-
017072
 python/chcat/chcat                | 2 +-
017072
 python/semanage/semanage          | 2 +-
017072
 python/sepolicy/sepolicy.py       | 2 +-
017072
 5 files changed, 5 insertions(+), 5 deletions(-)
017072
017072
diff --git a/python/audit2allow/audit2allow b/python/audit2allow/audit2allow
017072
index 09b06f66..eafeea88 100644
017072
--- a/python/audit2allow/audit2allow
017072
+++ b/python/audit2allow/audit2allow
017072
@@ -1,4 +1,4 @@
017072
-#!/usr/bin/python3 -Es
017072
+#!/usr/bin/python3 -EsI
017072
 # Authors: Karl MacMillan <kmacmillan@mentalrootkit.com>
017072
 # Authors: Dan Walsh <dwalsh@redhat.com>
017072
 #
017072
diff --git a/python/audit2allow/sepolgen-ifgen b/python/audit2allow/sepolgen-ifgen
017072
index be2d093b..f25f8af1 100644
017072
--- a/python/audit2allow/sepolgen-ifgen
017072
+++ b/python/audit2allow/sepolgen-ifgen
017072
@@ -1,4 +1,4 @@
017072
-#!/usr/bin/python3 -Es
017072
+#!/usr/bin/python3 -EsI
017072
 #
017072
 # Authors: Karl MacMillan <kmacmillan@mentalrootkit.com>
017072
 #
017072
diff --git a/python/chcat/chcat b/python/chcat/chcat
017072
index df2509f2..5671cec6 100755
017072
--- a/python/chcat/chcat
017072
+++ b/python/chcat/chcat
017072
@@ -1,4 +1,4 @@
017072
-#!/usr/bin/python3 -Es
017072
+#!/usr/bin/python3 -EsI
017072
 # Copyright (C) 2005 Red Hat
017072
 # see file 'COPYING' for use and warranty information
017072
 #
017072
diff --git a/python/semanage/semanage b/python/semanage/semanage
017072
index b8842d28..1f170f60 100644
017072
--- a/python/semanage/semanage
017072
+++ b/python/semanage/semanage
017072
@@ -1,4 +1,4 @@
017072
-#!/usr/bin/python3 -Es
017072
+#!/usr/bin/python3 -EsI
017072
 # Copyright (C) 2012-2013 Red Hat
017072
 # AUTHOR: Miroslav Grepl <mgrepl@redhat.com>
017072
 # AUTHOR: David Quigley <selinux@davequigley.com>
017072
diff --git a/python/sepolicy/sepolicy.py b/python/sepolicy/sepolicy.py
017072
index 8bd6a579..0c1d9641 100755
017072
--- a/python/sepolicy/sepolicy.py
017072
+++ b/python/sepolicy/sepolicy.py
017072
@@ -1,4 +1,4 @@
017072
-#!/usr/bin/python3 -Es
017072
+#!/usr/bin/python3 -EsI
017072
 # Copyright (C) 2012 Red Hat
017072
 # AUTHOR: Dan Walsh <dwalsh@redhat.com>
017072
 # see file 'COPYING' for use and warranty information
017072
-- 
017072
2.37.3
017072