From: <mad...@us...> - 2006-11-29 21:11:25
|
Revision: 2113 http://svn.sourceforge.net/selinux/?rev=2113&view=rev Author: madmethod Date: 2006-11-29 13:11:24 -0800 (Wed, 29 Nov 2006) Log Message: ----------- Author: Daniel J Walsh Email: dw...@re... Subject: More small fixes to policycoreutils Date: Wed, 22 Nov 2006 16:21:41 -0500 Joshua Brindle wrote: > Daniel J Walsh wrote: >> Fixes to make sure module name is all alphabet charaters. >> Added > > Still non-standard > Fine, I will go with your standard. Acked-By: Joshua Brindle <jbr...@tr...> Acked-By: Stephen Smalley <sd...@ty...> Modified Paths: -------------- trunk/policycoreutils/audit2allow/audit2allow Modified: trunk/policycoreutils/audit2allow/audit2allow =================================================================== --- trunk/policycoreutils/audit2allow/audit2allow 2006-11-29 21:09:39 UTC (rev 2112) +++ trunk/policycoreutils/audit2allow/audit2allow 2006-11-29 21:11:24 UTC (rev 2113) @@ -29,6 +29,7 @@ if __name__ == '__main__': import commands, sys, os, getopt, selinux import gettext + import re try: gettext.install('policycoreutils') except: @@ -59,6 +60,11 @@ print msg sys.exit(1) + def verify_module(module): + m = re.findall("[^a-zA-Z0-9]", module) + if len(m) != 0: + usage(_("Alphanumeric 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,27 @@ 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: + rc, type = selinux.selinux_getpolicytype() + cmd = "make -f /usr/share/selinux/%s/include/Makefile %s.pp" % (type, 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]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ssm...@us...> - 2008-01-23 20:25:20
|
Revision: 2742 http://selinux.svn.sourceforge.net/selinux/?rev=2742&view=rev Author: ssmalley Date: 2008-01-23 12:25:18 -0800 (Wed, 23 Jan 2008) Log Message: ----------- Tidy up the output. Modified Paths: -------------- trunk/policycoreutils/audit2allow/audit2allow Modified: trunk/policycoreutils/audit2allow/audit2allow =================================================================== --- trunk/policycoreutils/audit2allow/audit2allow 2008-01-23 20:24:15 UTC (rev 2741) +++ trunk/policycoreutils/audit2allow/audit2allow 2008-01-23 20:25:18 UTC (rev 2742) @@ -249,18 +249,18 @@ continue if rc == audit2why.BOOLEAN: if len(bools) > 1: - print "\tOne of the following booleans being set incorrectly." + print "\tOne of the following booleans was set incorrectly." for b in bools: print "\n\tBoolean %s is %d. Allow access by executing:" % (b[0], not b[1]) print "\t# setsebool -P %s %d" % (b[0], b[1]) else: - print "\tThe boolean %s set incorrectly. Allow access by executing:" % bools[0][0] + print "\tThe boolean %s was set incorrectly. Allow access by executing:" % bools[0][0] print "\t# setsebool -P %s %d\n" % (bools[0][0], bools[0][1]) continue if rc == audit2why.TERULE: - print "\t\tMissing or disabled type enforcingment (TE) allow rule.\n" + print "\t\tMissing or disabled type enforcing (TE) allow rule.\n" print "\t\tYou can use audit2allow to generate the missing allow rules and/or load policy to allow this access.\n" continue This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ssm...@us...> - 2008-03-18 20:35:35
|
Revision: 2851 http://selinux.svn.sourceforge.net/selinux/?rev=2851&view=rev Author: ssmalley Date: 2008-03-18 13:35:33 -0700 (Tue, 18 Mar 2008) Log Message: ----------- Author: Daniel J Walsh Email: dw...@re... Subject: Audit2allow/audit2why patch for policycoreutils. Date: Tue, 18 Mar 2008 11:27:06 -0400 Reveals dontaudit rules in policy. Modified Paths: -------------- trunk/policycoreutils/audit2allow/audit2allow Modified: trunk/policycoreutils/audit2allow/audit2allow =================================================================== --- trunk/policycoreutils/audit2allow/audit2allow 2008-03-18 20:28:49 UTC (rev 2850) +++ trunk/policycoreutils/audit2allow/audit2allow 2008-03-18 20:35:33 UTC (rev 2851) @@ -247,6 +247,11 @@ print "\t\tPossible mismatch between this policy and the one under which the audit message was generated.\n" print "\t\tPossible mismatch between current in-memory boolean settings vs. permanent ones.\n" continue + if rc == audit2why.DONTAUDIT: + print "\t\tUnknown - should be dontaudit'd by active policy\n", + print "\t\tPossible mismatch between this policy and the one under which the audit message was generated.\n" + print "\t\tPossible mismatch between current in-memory boolean settings vs. permanent ones.\n" + continue if rc == audit2why.BOOLEAN: if len(bools) > 1: print "\tOne of the following booleans was set incorrectly." This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |