policycoreutils-2.4-11

- audit2allow, audit2why - ignore setlocale errors (#1208529)
This commit is contained in:
Petr Lautrbach 2015-09-02 08:34:22 +02:00
parent 6719f8ed42
commit 45b6c21434
2 changed files with 45 additions and 18 deletions

View File

@ -9,7 +9,7 @@ index 962ac12..6a9c40c 100644
INOTIFYH = $(shell ls /usr/include/sys/inotify.h 2>/dev/null)
diff --git a/policycoreutils-2.4/audit2allow/audit2allow b/policycoreutils-2.4/audit2allow/audit2allow
index c9713a2..4796fad 100644
index c9713a2..ffdbc2e 100644
--- a/policycoreutils-2.4/audit2allow/audit2allow
+++ b/policycoreutils-2.4/audit2allow/audit2allow
@@ -1,4 +1,4 @@
@ -18,7 +18,19 @@ index c9713a2..4796fad 100644
# Authors: Karl MacMillan <kmacmillan@mentalrootkit.com>
# Authors: Dan Walsh <dwalsh@redhat.com>
#
@@ -135,13 +135,13 @@ class AuditToPolicy:
@@ -31,7 +31,10 @@ import sepolgen.module as module
from sepolgen.sepolgeni18n import _
import selinux.audit2why as audit2why
import locale
-locale.setlocale(locale.LC_ALL, '')
+try:
+ locale.setlocale(locale.LC_ALL, '')
+except:
+ pass
class AuditToPolicy:
VERSION = "%prog .1"
@@ -135,13 +138,13 @@ class AuditToPolicy:
elif self.__options.audit:
try:
messages = audit.get_audit_msgs()
@ -34,7 +46,7 @@ index c9713a2..4796fad 100644
sys.stderr.write('could not run ausearch - "%s"\n' % str(e))
sys.exit(1)
else:
@@ -152,7 +152,7 @@ class AuditToPolicy:
@@ -152,7 +155,7 @@ class AuditToPolicy:
if filename is not None:
try:
f = open(filename)
@ -43,7 +55,7 @@ index c9713a2..4796fad 100644
sys.stderr.write('could not open file %s - "%s"\n' % (filename, str(e)))
sys.exit(1)
@@ -214,7 +214,7 @@ class AuditToPolicy:
@@ -214,7 +217,7 @@ class AuditToPolicy:
try:
fd = open(filename, "w")
@ -52,7 +64,7 @@ index c9713a2..4796fad 100644
sys.stderr.write("could not write output file: %s\n" % str(e))
sys.exit(1)
@@ -225,8 +225,8 @@ class AuditToPolicy:
@@ -225,8 +228,8 @@ class AuditToPolicy:
try:
mc.create_module_package(filename, self.__options.refpolicy)
@ -63,7 +75,7 @@ index c9713a2..4796fad 100644
sys.exit(1)
sys.stdout.write(_("******************** IMPORTANT ***********************\n"))
@@ -240,44 +240,44 @@ class AuditToPolicy:
@@ -240,44 +243,44 @@ class AuditToPolicy:
rc = i.type
data = i.data
if rc >= 0:
@ -129,7 +141,7 @@ index c9713a2..4796fad 100644
continue
audit2why.finish()
@@ -288,8 +288,8 @@ class AuditToPolicy:
@@ -288,8 +291,8 @@ class AuditToPolicy:
if self.__options.audit2why:
try:
return self.__output_audit2why()
@ -140,7 +152,7 @@ index c9713a2..4796fad 100644
sys.exit(1)
g = policygen.PolicyGenerator()
@@ -348,11 +348,11 @@ class AuditToPolicy:
@@ -348,11 +351,11 @@ class AuditToPolicy:
self.__output()
except KeyboardInterrupt:
sys.exit(0)
@ -157,7 +169,7 @@ index c9713a2..4796fad 100644
if __name__ == "__main__":
diff --git a/policycoreutils-2.4/audit2allow/audit2why b/policycoreutils-2.4/audit2allow/audit2why
index 323eddd..a078587 100644
index 323eddd..0fa4c26 100644
--- a/policycoreutils-2.4/audit2allow/audit2why
+++ b/policycoreutils-2.4/audit2allow/audit2why
@@ -1,4 +1,4 @@
@ -166,7 +178,19 @@ index 323eddd..a078587 100644
# Authors: Karl MacMillan <kmacmillan@mentalrootkit.com>
# Authors: Dan Walsh <dwalsh@redhat.com>
#
@@ -135,13 +135,13 @@ class AuditToPolicy:
@@ -31,7 +31,10 @@ import sepolgen.module as module
from sepolgen.sepolgeni18n import _
import selinux.audit2why as audit2why
import locale
-locale.setlocale(locale.LC_ALL, '')
+try:
+ locale.setlocale(locale.LC_ALL, '')
+except:
+ pass
class AuditToPolicy:
VERSION = "%prog .1"
@@ -135,13 +138,13 @@ class AuditToPolicy:
elif self.__options.audit:
try:
messages = audit.get_audit_msgs()
@ -182,7 +206,7 @@ index 323eddd..a078587 100644
sys.stderr.write('could not run ausearch - "%s"\n' % str(e))
sys.exit(1)
else:
@@ -152,7 +152,7 @@ class AuditToPolicy:
@@ -152,7 +155,7 @@ class AuditToPolicy:
if filename is not None:
try:
f = open(filename)
@ -191,7 +215,7 @@ index 323eddd..a078587 100644
sys.stderr.write('could not open file %s - "%s"\n' % (filename, str(e)))
sys.exit(1)
@@ -214,7 +214,7 @@ class AuditToPolicy:
@@ -214,7 +217,7 @@ class AuditToPolicy:
try:
fd = open(filename, "w")
@ -200,7 +224,7 @@ index 323eddd..a078587 100644
sys.stderr.write("could not write output file: %s\n" % str(e))
sys.exit(1)
@@ -225,8 +225,8 @@ class AuditToPolicy:
@@ -225,8 +228,8 @@ class AuditToPolicy:
try:
mc.create_module_package(filename, self.__options.refpolicy)
@ -211,7 +235,7 @@ index 323eddd..a078587 100644
sys.exit(1)
sys.stdout.write(_("******************** IMPORTANT ***********************\n"))
@@ -240,43 +240,43 @@ class AuditToPolicy:
@@ -240,43 +243,43 @@ class AuditToPolicy:
rc = i.type
data = i.data
if rc >= 0:
@ -275,7 +299,7 @@ index 323eddd..a078587 100644
continue
audit2why.finish()
@@ -287,8 +287,8 @@ class AuditToPolicy:
@@ -287,8 +290,8 @@ class AuditToPolicy:
if self.__options.audit2why:
try:
return self.__output_audit2why()
@ -286,7 +310,7 @@ index 323eddd..a078587 100644
sys.exit(1)
g = policygen.PolicyGenerator()
@@ -347,11 +347,11 @@ class AuditToPolicy:
@@ -347,11 +350,11 @@ class AuditToPolicy:
self.__output()
except KeyboardInterrupt:
sys.exit(0)

View File

@ -7,7 +7,7 @@
Summary: SELinux policy core utilities
Name: policycoreutils
Version: 2.4
Release: 10%{?dist}
Release: 11%{?dist}
License: GPLv2
Group: System Environment/Base
# https://github.com/SELinuxProject/selinux/wiki/Releases
@ -18,7 +18,7 @@ Source2: policycoreutils_man_ru2.tar.bz2
Source3: system-config-selinux.png
Source4: sepolicy-icons.tgz
# use make-rhat-patches.sh to create following patches from https://github.com/fedora-selinux/selinux/
# HEAD https://github.com/fedora-selinux/selinux/commit/2540625875ebdfe0ef48798437288e8a07aa853d
# HEAD https://github.com/fedora-selinux/selinux/commit/c8400be1e608ae21a27568d70d93e70e4dc808b6
Patch: policycoreutils-rhat.patch
Patch1: sepolgen-rhat.patch
Obsoletes: policycoreutils < 2.0.61-2
@ -400,6 +400,9 @@ The policycoreutils-restorecond package contains the restorecond service.
%systemd_postun_with_restart restorecond.service
%changelog
* Wed Sep 02 2015 Petr Lautrbach <plautrba@redhat.com> 2.4-11
- audit2allow, audit2why - ignore setlocale errors (#1208529)
* Fri Aug 21 2015 Petr Lautrbach <plautrba@redhat.com> 2.4-10
- Port sandbox to GTK 3 and fix issue with Xephyr