Fix audit2allow -o to open file for append

- Fix the name of the spec file generated in the build script
This commit is contained in:
Dan Walsh 2013-06-04 10:53:51 -04:00
parent e90e9c6c30
commit 4f084e9fcd
2 changed files with 57 additions and 7 deletions

View File

@ -34,10 +34,20 @@ index 88635d4..fc290ea 100644
clean:
rm -f *~
diff --git a/policycoreutils/audit2allow/audit2allow b/policycoreutils/audit2allow/audit2allow
index 8e0c396..1059bea 100644
index 8e0c396..9f5185d 100644
--- a/policycoreutils/audit2allow/audit2allow
+++ b/policycoreutils/audit2allow/audit2allow
@@ -18,7 +18,7 @@
@@ -1,7 +1,8 @@
#! /usr/bin/python -Es
# Authors: Karl MacMillan <kmacmillan@mentalrootkit.com>
+# Authors: Dan Walsh <dwalsh@redhat.com>
#
-# Copyright (C) 2006-2007 Red Hat
+# Copyright (C) 2006-2013 Red Hat
# see file 'COPYING' for use and warranty information
#
# This program is free software; you can redistribute it and/or
@@ -18,7 +19,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
@ -46,7 +56,7 @@ index 8e0c396..1059bea 100644
import sepolgen.audit as audit
import sepolgen.policygen as policygen
@@ -29,6 +29,8 @@ import sepolgen.defaults as defaults
@@ -29,6 +30,8 @@ import sepolgen.defaults as defaults
import sepolgen.module as module
from sepolgen.sepolgeni18n import _
import selinux.audit2why as audit2why
@ -55,7 +65,7 @@ index 8e0c396..1059bea 100644
class AuditToPolicy:
VERSION = "%prog .1"
@@ -80,8 +82,7 @@ class AuditToPolicy:
@@ -80,8 +83,7 @@ class AuditToPolicy:
parser.add_option("--interface-info", dest="interface_info", help="file name of interface information")
parser.add_option("--debug", dest="debug", action="store_true", default=False,
help="leave generated modules for -M")
@ -65,7 +75,7 @@ index 8e0c396..1059bea 100644
help="Translates SELinux audit messages into a description of why the access was denied")
options, args = parser.parse_args()
@@ -267,12 +268,10 @@ class AuditToPolicy:
@@ -267,12 +269,10 @@ class AuditToPolicy:
continue
if rc == audit2why.CONSTRAINT:
@ -82,7 +92,16 @@ index 8e0c396..1059bea 100644
if rc == audit2why.RBAC:
print "\t\tMissing role allow rule.\n"
@@ -350,6 +349,9 @@ class AuditToPolicy:
@@ -329,7 +329,7 @@ class AuditToPolicy:
g.set_module_name(self.__options.module)
if self.__options.output:
- fd = open(self.__options.output, "w")
+ fd = open(self.__options.output, "a")
else:
fd = sys.stdout
writer.write(g.get_module(), fd)
@@ -350,6 +350,9 @@ class AuditToPolicy:
except ValueError, e:
print e
sys.exit(1)
@ -332,6 +351,33 @@ index 0000000..fcfa81d
+ <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
+ </action>
+</policyconfig>
diff --git a/policycoreutils/gui/polgengui.py b/policycoreutils/gui/polgengui.py
index 1c16f7b..b89bf1a 100644
--- a/policycoreutils/gui/polgengui.py
+++ b/policycoreutils/gui/polgengui.py
@@ -4,7 +4,7 @@
#
# Dan Walsh <dwalsh@redhat.com>
#
-# Copyright (C) 2007-2012 Red Hat
+# Copyright (C) 2007-2013 Red Hat
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -28,7 +28,12 @@ import os
import gobject
import gnome
import sys
-from sepolicy import generate
+try:
+ from sepolicy import generate
+except ValueError,e:
+ sys.stderr.write("%s: %s\n" % (e.__class__.__name__, str(e)))
+ sys.exit(1)
+
import sepolicy.interface
import commands
diff --git a/policycoreutils/gui/selinux-polgengui.8 b/policycoreutils/gui/selinux-polgengui.8
new file mode 100644
index 0000000..52bf7dd

View File

@ -7,7 +7,7 @@
Summary: SELinux policy core utilities
Name: policycoreutils
Version: 2.1.14
Release: 47%{?dist}
Release: 48%{?dist}
License: GPLv2
Group: System Environment/Base
# Based on git repository with tag 20101221
@ -311,6 +311,10 @@ The policycoreutils-restorecond package contains the restorecond service.
%systemd_postun_with_restart restorecond.service
%changelog
* Tue Jun 4 2013 Dan Walsh <dwalsh@redhat.com> - 2.1.14-48
- Fix audit2allow -o to open file for append
- Fix the name of the spec file generated in the build script
* Fri May 31 2013 Dan Walsh <dwalsh@redhat.com> - 2.1.14-47
- Fix mgrepl patch to support all semanage command parsing