[policycoreutils] sepolicy transition was blowing up. Also cleanup output when only source is specified.
Daniel J Walsh
dwalsh at fedoraproject.org
Mon Dec 17 18:22:29 UTC 2012
commit 558e4d0e2d26f48df8a54e39a3743f7c051a8adf
Author: Dan Walsh <dwalsh at redhat.com>
Date: Mon Dec 17 13:22:14 2012 -0500
sepolicy transition was blowing up. Also cleanup output when only source is specified.
- sepolicy generate should allow policy modules names that include - or _
policycoreutils-rhat.patch | 22 +++++++++++++---------
policycoreutils.spec | 6 +++++-
2 files changed, 18 insertions(+), 10 deletions(-)
---
diff --git a/policycoreutils-rhat.patch b/policycoreutils-rhat.patch
index be77b56..e690a5c 100644
--- a/policycoreutils-rhat.patch
+++ b/policycoreutils-rhat.patch
@@ -333230,10 +333230,10 @@ index 0000000..a40f37d
+selinux(8), sepolicy-generate(8), sepolicy-communicate(8), sepolicy-generate(8), sepolicy-network(8), sepolicy-transition(8)
diff --git a/policycoreutils/sepolicy/sepolicy.py b/policycoreutils/sepolicy/sepolicy.py
new file mode 100755
-index 0000000..57018a6
+index 0000000..2f562b0
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy.py
-@@ -0,0 +1,334 @@
+@@ -0,0 +1,338 @@
+#! /usr/bin/python -Es
+# Copyright (C) 2012 Red Hat
+# AUTHOR: Dan Walsh <dwalsh at redhat.com>
@@ -333493,13 +333493,17 @@ index 0000000..57018a6
+
+def transition(args):
+ from sepolicy.transition import setrans
-+ source = args.source[0]
++ source = args.source
+ if args.target:
-+ target = args.target[0]
++ for l in setrans(source, args.target):
++ print " --> ".join(l)
+ else:
-+ target = None
-+ for l in setrans(source, target):
-+ print " --> ".join(l)
++ for l in setrans(source):
++ msg = l[0]
++ for i in range(1, len(l)-1, 2):
++ msg = "%s @ %s --> %s" % (msg, l[i], l[i+1])
++ print msg
++
+
+def gen_transition_args(parser):
+ trans = parser.add_parser("transition",
@@ -333833,7 +333837,7 @@ index 0000000..a179d95
+
diff --git a/policycoreutils/sepolicy/sepolicy/generate.py b/policycoreutils/sepolicy/sepolicy/generate.py
new file mode 100644
-index 0000000..209568c
+index 0000000..7fd6dd6
--- /dev/null
+++ b/policycoreutils/sepolicy/sepolicy/generate.py
@@ -0,0 +1,1302 @@
@@ -334183,7 +334187,7 @@ index 0000000..209568c
+( self.generate_root_user_types, self.generate_root_user_rules))
+ if name == "":
+ raise ValueError(_("You must enter a name for your confined process/user"))
-+ if not name.isalnum():
++ if not re.match(r"^[a-zA-Z0-9-_]+$", name):
+ raise ValueError(_("Name must be alpha numberic with no spaces. Consider using option \"-n MODULENAME\""))
+
+ if type == CGI:
diff --git a/policycoreutils.spec b/policycoreutils.spec
index 704c914..b475834 100644
--- a/policycoreutils.spec
+++ b/policycoreutils.spec
@@ -7,7 +7,7 @@
Summary: SELinux policy core utilities
Name: policycoreutils
Version: 2.1.13
-Release: 45%{?dist}
+Release: 46%{?dist}
License: GPLv2
Group: System Environment/Base
# Based on git repository with tag 20101221
@@ -338,6 +338,10 @@ The policycoreutils-restorecond package contains the restorecond service.
%{_bindir}/systemctl try-restart restorecond.service >/dev/null 2>&1 || :
%changelog
+* Mon Dec 17 2012 Dan Walsh <dwalsh at redhat.com> - 2.1.12-46
+- sepolicy transition was blowing up. Also cleanup output when only source is specified.
+- sepolicy generate should allow policy modules names that include - or _
+
* Mon Dec 10 2012 Dan Walsh <dwalsh at redhat.com> - 2.1.12-45
- Apply patch from Miroslav to display proper range description in man pages g
- Should print warning on missing default label when run in recusive mode iff
More information about the scm-commits
mailing list