From: Daniel J Walsh <dwalsh@redhat.com>
To: Joshua Brindle <jbrindle@tresys.com>
Cc: Stephen Smalley <sds@tycho.nsa.gov>,
Karl MacMillan <kmacmillan@mentalrootkit.com>,
"Christopher J. PeBenito" <cpebenito@tresys.com>,
SE Linux <selinux@tycho.nsa.gov>
Subject: Re: More small fixes to policycoreutils
Date: Wed, 22 Nov 2006 15:05:22 -0500 [thread overview]
Message-ID: <4564AD82.5080300@redhat.com> (raw)
In-Reply-To: <6FE441CD9F0C0C479F2D88F959B015885C7D9F@exchange.columbia.tresys.com>
[-- Attachment #1: Type: text/plain, Size: 115 bytes --]
Fixes to make sure module name is all alphabet charaters.
Fixes to generate Reference Policy modules correctly.
[-- Attachment #2: audit2allow.diff --]
[-- Type: text/x-patch, Size: 2620 bytes --]
diff --exclude-from=exclude --exclude='*.po' --exclude='*.pot' -N -u -r nsapolicycoreutils/audit2allow/audit2allow policycoreutils-1.33.4/audit2allow/audit2allow
--- nsapolicycoreutils/audit2allow/audit2allow 2006-11-16 17:14:29.000000000 -0500
+++ policycoreutils-1.33.4/audit2allow/audit2allow 2006-11-22 14:51:29.000000000 -0500
@@ -25,6 +25,7 @@
#
#
from avc import *
+import re
if __name__ == '__main__':
import commands, sys, os, getopt, selinux
@@ -59,6 +60,11 @@
print msg
sys.exit(1)
+ def verify_module(module):
+ m = re.findall("[^a-zA-Z]", module)
+ if len(m) != 0:
+ usage(_("Alphabetic Charaters Only"))
+
def errorExit(error):
sys.stderr.write("%s: " % sys.argv[0])
sys.stderr.write("%s\n" % error)
@@ -125,10 +131,12 @@
if module != "" or a[0] == "-":
usage()
module = a
+ verify_module(module)
if o == "-M":
if module != "" or output_ind or a[0] == "-":
usage()
module = a
+ verify_module(module)
outfile = a+".te"
buildPP = 1
if not os.path.exists("/usr/bin/checkmodule"):
@@ -184,22 +192,26 @@
output.write(serules.out(requires, module))
output.flush()
if buildPP:
- cmd = "checkmodule %s -m -o %s.mod %s.te" % (get_mls_flag(), module, module)
- print _("Compiling policy")
- print cmd
- rc = commands.getstatusoutput(cmd)
- if rc[0] == 0:
- cmd = "semodule_package -o %s.pp -m %s.mod" % (module, module)
- if fc_file != "":
- cmd = "%s -f %s" % (cmd, fc_file)
-
+ if ref_ind:
+ cmd = "make -f /usr/share/selinux/devel/Makefile %s.pp" % module
+ print _("Compiling policy")
+ print cmd
+ rc = commands.getstatusoutput(cmd)
+ else:
+ cmd = "checkmodule %s -m -o %s.mod %s.te" % (get_mls_flag(), module, module)
+ print _("Compiling policy")
print cmd
rc = commands.getstatusoutput(cmd)
if rc[0] == 0:
- print _("\n******************** IMPORTANT ***********************\n")
- print (_("In order to load this newly created policy package into the kernel,\nyou are required to execute \n\nsemodule -i %s.pp\n\n") % module)
- else:
- errorExit(rc[1])
+ cmd = "semodule_package -o %s.pp -m %s.mod" % (module, module)
+ if fc_file != "":
+ cmd = "%s -f %s" % (cmd, fc_file)
+
+ print cmd
+ rc = commands.getstatusoutput(cmd)
+ if rc[0] == 0:
+ print _("\n******************** IMPORTANT ***********************\n")
+ print (_("In order to load this newly created policy package into the kernel,\nyou are required to execute \n\nsemodule -i %s.pp\n\n") % module)
else:
errorExit(rc[1])
next prev parent reply other threads:[~2006-11-22 20:05 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-14 15:06 Multiple small fixes to policycoreutils Daniel J Walsh
2006-11-14 16:13 ` Christopher J. PeBenito
2006-11-14 16:18 ` Daniel J Walsh
2006-11-14 19:19 ` Christopher J. PeBenito
2006-11-14 20:09 ` Daniel J Walsh
2006-11-15 18:34 ` Karl MacMillan
2006-11-15 19:38 ` Joshua Brindle
2006-11-15 20:16 ` Daniel J Walsh
2006-11-15 20:18 ` Joshua Brindle
2006-11-15 22:01 ` Karl MacMillan
2006-11-16 0:05 ` Joshua Brindle
2006-11-16 22:15 ` Karl MacMillan
2006-11-17 0:50 ` Joshua Brindle
2006-11-17 12:02 ` Daniel J Walsh
2006-11-20 17:10 ` Karl MacMillan
2006-11-20 17:36 ` More " Daniel J Walsh
2006-11-20 18:28 ` Joshua Brindle
2006-11-20 20:14 ` Karl MacMillan
2006-11-20 20:25 ` Stephen Smalley
2006-11-21 3:54 ` Joshua Brindle
2006-11-21 14:35 ` Karl MacMillan
2006-11-21 14:37 ` Karl MacMillan
2006-11-20 21:58 ` Daniel J Walsh
2006-11-21 13:53 ` Stephen Smalley
2006-11-22 19:16 ` Daniel J Walsh
2006-11-22 19:22 ` Joshua Brindle
2006-11-22 20:05 ` Daniel J Walsh [this message]
2006-11-22 20:31 ` Joshua Brindle
2006-11-22 21:21 ` Daniel J Walsh
2006-11-28 19:37 ` Joshua Brindle
2006-11-29 21:18 ` Joshua Brindle
2006-11-22 20:06 ` Daniel J Walsh
2006-11-22 20:34 ` Joshua Brindle
2006-11-22 21:10 ` Daniel J Walsh
2006-11-22 20:07 ` Daniel J Walsh
2006-11-22 20:35 ` Joshua Brindle
2006-11-22 20:08 ` Daniel J Walsh
2006-11-22 20:36 ` Joshua Brindle
2006-11-22 20:10 ` Daniel J Walsh
2006-11-22 20:36 ` Joshua Brindle
2006-11-22 21:07 ` Daniel J Walsh
2006-11-27 13:39 ` Joshua Brindle
2006-11-21 21:13 ` Stephen Smalley
2006-11-15 16:13 ` Multiple " Joshua Brindle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4564AD82.5080300@redhat.com \
--to=dwalsh@redhat.com \
--cc=cpebenito@tresys.com \
--cc=jbrindle@tresys.com \
--cc=kmacmillan@mentalrootkit.com \
--cc=sds@tycho.nsa.gov \
--cc=selinux@tycho.nsa.gov \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.