* Thu Aug 28 2008 Dan Walsh <dwalsh@redhat.com> 2.0.55-1

- Update to upstream
	* Merged semanage node support from Christian Kuester.
This commit is contained in:
Daniel J Walsh 2008-08-29 19:05:21 +00:00
parent b67978a729
commit 2a4d967daa
6 changed files with 56011 additions and 53542 deletions

View File

@ -186,3 +186,4 @@ policycoreutils-2.0.52.tgz
sepolgen-1.0.13.tgz sepolgen-1.0.13.tgz
policycoreutils-2.0.53.tgz policycoreutils-2.0.53.tgz
policycoreutils-2.0.54.tgz policycoreutils-2.0.54.tgz
policycoreutils-2.0.55.tgz

View File

@ -1,7 +1,7 @@
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/Makefile policycoreutils-2.0.54/gui/Makefile diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/Makefile policycoreutils-2.0.54/gui/Makefile
--- nsapolicycoreutils/gui/Makefile 1969-12-31 19:00:00.000000000 -0500 --- nsapolicycoreutils/gui/Makefile 1969-12-31 19:00:00.000000000 -0500
+++ policycoreutils-2.0.54/gui/Makefile 2008-08-06 18:05:28.000000000 -0400 +++ policycoreutils-2.0.54/gui/Makefile 2008-08-11 12:20:26.000000000 -0400
@@ -0,0 +1,36 @@ @@ -0,0 +1,37 @@
+# Installation directories. +# Installation directories.
+PREFIX ?= ${DESTDIR}/usr +PREFIX ?= ${DESTDIR}/usr
+SHAREDIR ?= $(PREFIX)/share/system-config-selinux +SHAREDIR ?= $(PREFIX)/share/system-config-selinux
@ -9,6 +9,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/Makefile policycoreu
+TARGETS= \ +TARGETS= \
+booleansPage.py \ +booleansPage.py \
+fcontextPage.py \ +fcontextPage.py \
+html_util.py \
+loginsPage.py \ +loginsPage.py \
+mappingsPage.py \ +mappingsPage.py \
+modulesPage.py \ +modulesPage.py \

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/Makefile policycoreutils-2.0.54/Makefile diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/Makefile policycoreutils-2.0.54/Makefile
--- nsapolicycoreutils/Makefile 2008-08-05 09:58:35.000000000 -0400 --- nsapolicycoreutils/Makefile 2008-08-28 09:34:24.000000000 -0400
+++ policycoreutils-2.0.54/Makefile 2008-08-06 18:05:28.000000000 -0400 +++ policycoreutils-2.0.54/Makefile 2008-08-06 18:05:28.000000000 -0400
@@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
-SUBDIRS = setfiles semanage load_policy newrole run_init secon audit2allow audit2why scripts sestatus semodule_package semodule semodule_link semodule_expand semodule_deps setsebool po -SUBDIRS = setfiles semanage load_policy newrole run_init secon audit2allow audit2why scripts sestatus semodule_package semodule semodule_link semodule_expand semodule_deps setsebool po
@ -8,7 +8,7 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
INOTIFYH = $(shell ls /usr/include/sys/inotify.h 2>/dev/null) INOTIFYH = $(shell ls /usr/include/sys/inotify.h 2>/dev/null)
diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/restorecond/restorecond.conf policycoreutils-2.0.54/restorecond/restorecond.conf diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/restorecond/restorecond.conf policycoreutils-2.0.54/restorecond/restorecond.conf
--- nsapolicycoreutils/restorecond/restorecond.conf 2008-08-05 09:58:27.000000000 -0400 --- nsapolicycoreutils/restorecond/restorecond.conf 2008-08-28 09:34:24.000000000 -0400
+++ policycoreutils-2.0.54/restorecond/restorecond.conf 2008-08-06 18:05:28.000000000 -0400 +++ policycoreutils-2.0.54/restorecond/restorecond.conf 2008-08-06 18:05:28.000000000 -0400
@@ -1,3 +1,4 @@ @@ -1,3 +1,4 @@
+/etc/services +/etc/services
@ -16,29 +16,36 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
/etc/samba/secrets.tdb /etc/samba/secrets.tdb
/etc/mtab /etc/mtab
diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/semanage/semanage policycoreutils-2.0.54/semanage/semanage diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/semanage/semanage policycoreutils-2.0.54/semanage/semanage
--- nsapolicycoreutils/semanage/semanage 2008-08-05 09:58:26.000000000 -0400 --- nsapolicycoreutils/semanage/semanage 2008-08-28 09:34:24.000000000 -0400
+++ policycoreutils-2.0.54/semanage/semanage 2008-08-07 08:18:35.000000000 -0400 +++ policycoreutils-2.0.54/semanage/semanage 2008-08-07 08:18:35.000000000 -0400
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
# 02111-1307 USA # 02111-1307 USA
# #
# #
-import os, sys, getopt -import os, sys, getopt
+import sys, getopt +import sys, getopt, re
import seobject import seobject
import selinux import selinux
PROGNAME="policycoreutils" PROGNAME="policycoreutils"
@@ -43,7 +43,9 @@ @@ -43,13 +43,14 @@
if __name__ == '__main__': if __name__ == '__main__':
def usage(message = ""): def usage(message = ""):
- print _(""" - print _("""
-semanage {boolean|login|user|port|interface|node|fcontext|translation} -{l|D} [-n]
+ raise ValueError(_(""" + raise ValueError(_("""
+semanage [ -S store ] -i [ input_file | - ] +semanage [ -S store ] -i [ input_file | - ]
+ +
semanage {boolean|login|user|port|interface|fcontext|translation} -{l|D} [-n] +semanage {boolean|login|user|port|interface|fcontext|translation} -{l|D} [-n]
semanage login -{a|d|m} [-sr] login_name | %groupname semanage login -{a|d|m} [-sr] login_name | %groupname
semanage user -{a|d|m} [-LrRP] selinux_name semanage user -{a|d|m} [-LrRP] selinux_name
@@ -59,6 +61,7 @@ semanage port -{a|d|m} [-tr] [ -p proto ] port | port_range
semanage interface -{a|d|m} [-tr] interface_spec
-semanage node -{a|d|m} [-tr] [ -p protocol ] [-M netmask] addr
semanage fcontext -{a|d|m} [-frst] file_spec
semanage translation -{a|d|m} [-T] level
semanage boolean -{d|m} [--on|--off|-1|-0] -F boolean | boolean_file
@@ -60,6 +61,7 @@
-a, --add Add a OBJECT record NAME -a, --add Add a OBJECT record NAME
-d, --delete Delete a OBJECT record NAME -d, --delete Delete a OBJECT record NAME
-m, --modify Modify a OBJECT record NAME -m, --modify Modify a OBJECT record NAME
@ -46,7 +53,17 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
-l, --list List the OBJECTS -l, --list List the OBJECTS
-C, --locallist List OBJECTS local customizations -C, --locallist List OBJECTS local customizations
-D, --deleteall Remove all OBJECTS local customizations -D, --deleteall Remove all OBJECTS local customizations
@@ -89,9 +92,8 @@ @@ -81,8 +83,7 @@
-p (named pipe)
-F, --file Treat target as an input file for command, change multiple settings
- -p, --proto Port protocol (tcp or udp) or internet protocol version of node (ipv4 or ipv6)
- -M, --mask Netmask
+ -p, --proto Port protocol (tcp or udp)
-P, --prefix Prefix for home directory labeling
-L, --level Default SELinux Level (MLS/MCS Systems only)
-R, --roles SELinux Roles (ex: "sysadm_r staff_r")
@@ -91,9 +92,8 @@
-s, --seuser SELinux User Name -s, --seuser SELinux User Name
-t, --type SELinux Type for the object -t, --type SELinux Type for the object
-r, --range MLS/MCS Security Range (MLS/MCS Systems only) -r, --range MLS/MCS Security Range (MLS/MCS Systems only)
@ -58,7 +75,18 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
def errorExit(error): def errorExit(error):
sys.stderr.write("%s: " % sys.argv[0]) sys.stderr.write("%s: " % sys.argv[0])
@@ -120,12 +122,53 @@ @@ -111,9 +111,7 @@
valid_option["port"] = []
valid_option["port"] += valid_everyone + [ '-t', '--type', '-r', '--range', '-p', '--proto' ]
valid_option["interface"] = []
- valid_option["interface"] += valid_everyone + [ '-t', '--type', '-r', '--range']
- valid_option["node"] = []
- valid_option["node"] += valid_everyone + [ '-M', '--mask', '-t', '--type', '-r', '--range', '-p', '--protocol']
+ valid_option["interface"] += valid_everyone + [ '-t', '--type', '-r', '--range']
valid_option["fcontext"] = []
valid_option["fcontext"] += valid_everyone + [ '-f', '--ftype', '-s', '--seuser', '-t', '--type', '-r', '--range']
valid_option["translation"] = []
@@ -124,16 +122,56 @@
valid_option["permissive"] += [ '-a', '--add', '-d', '--delete', '-l', '--list', '-h', '--help', '-n', '--noheading', '-D', '--deleteall' ] valid_option["permissive"] += [ '-a', '--add', '-d', '--delete', '-l', '--list', '-h', '--help', '-n', '--noheading', '-D', '--deleteall' ]
return valid_option return valid_option
@ -118,7 +146,11 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
serange = "" serange = ""
port = "" port = ""
proto = "" proto = ""
@@ -146,24 +189,23 @@ - mask = ""
selevel = ""
setype = ""
ftype = ""
@@ -151,24 +189,23 @@
locallist = False locallist = False
use_file = False use_file = False
store = "" store = ""
@ -135,7 +167,7 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
+ args = argv[1:] + args = argv[1:]
gopts, cmds = getopt.getopt(args, gopts, cmds = getopt.getopt(args,
- '01adf:lhmnp:s:FCDR:L:r:t:T:P:S:', - '01adf:lhmnp:s:FCDR:L:r:t:T:P:S:M:',
+ '01adf:i:lhmnp:s:FCDR:L:r:t:T:P:S:', + '01adf:i:lhmnp:s:FCDR:L:r:t:T:P:S:',
['add', ['add',
'delete', 'delete',
@ -147,7 +179,17 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
'list', 'list',
'modify', 'modify',
'noheading', 'noheading',
@@ -187,16 +229,16 @@ @@ -183,8 +220,7 @@
'roles=',
'type=',
'trans=',
- 'prefix=',
- 'mask='
+ 'prefix='
])
for o, a in gopts:
if o not in option_dict[object]:
@@ -193,16 +229,16 @@
for o,a in gopts: for o,a in gopts:
if o == "-a" or o == "--add": if o == "-a" or o == "--add":
if modify or delete: if modify or delete:
@ -167,7 +209,7 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
deleteall = True deleteall = True
if o == "-f" or o == "--ftype": if o == "-f" or o == "--ftype":
ftype=a ftype=a
@@ -205,7 +247,7 @@ @@ -211,7 +247,7 @@
use_file = True use_file = True
if o == "-h" or o == "--help": if o == "-h" or o == "--help":
@ -176,7 +218,7 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
if o == "-n" or o == "--noheading": if o == "-n" or o == "--noheading":
heading = False heading = False
@@ -215,7 +257,7 @@ @@ -221,7 +257,7 @@
if o == "-m"or o == "--modify": if o == "-m"or o == "--modify":
if delete or add: if delete or add:
@ -185,7 +227,7 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
modify = True modify = True
if o == "-S" or o == '--store': if o == "-S" or o == '--store':
@@ -223,7 +265,7 @@ @@ -229,7 +265,7 @@
if o == "-r" or o == '--range': if o == "-r" or o == '--range':
if is_mls_enabled == 0: if is_mls_enabled == 0:
@ -194,7 +236,7 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
serange = a serange = a
if o == "-l" or o == "--list": if o == "-l" or o == "--list":
@@ -231,7 +273,7 @@ @@ -237,7 +273,7 @@
if o == "-L" or o == '--level': if o == "-L" or o == '--level':
if is_mls_enabled == 0: if is_mls_enabled == 0:
@ -203,7 +245,27 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
selevel = a selevel = a
if o == "-p" or o == '--proto': if o == "-p" or o == '--proto':
@@ -286,14 +328,14 @@ @@ -252,9 +288,6 @@
if o == "-s" or o == "--seuser":
seuser = a
- if o == "-M" or o == '--mask':
- mask = a
-
if o == "-t" or o == "--type":
setype = a
@@ -277,9 +310,6 @@
if object == "interface":
OBJECT = seobject.interfaceRecords(store)
-
- if object == "node":
- OBJECT = seobject.nodeRecords(store)
if object == "fcontext":
OBJECT = seobject.fcontextRecords(store)
@@ -298,14 +328,14 @@
OBJECT.list(heading, locallist, use_file) OBJECT.list(heading, locallist, use_file)
else: else:
OBJECT.list(heading, locallist) OBJECT.list(heading, locallist)
@ -221,7 +283,7 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
target = cmds[0] target = cmds[0]
@@ -305,10 +347,7 @@ @@ -317,10 +347,7 @@
OBJECT.add(target, setrans) OBJECT.add(target, setrans)
if object == "user": if object == "user":
@ -233,7 +295,15 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
if object == "port": if object == "port":
OBJECT.add(target, proto, serange, setype) OBJECT.add(target, proto, serange, setype)
@@ -321,7 +360,7 @@ @@ -328,15 +355,12 @@
if object == "interface":
OBJECT.add(target, serange, setype)
- if object == "node":
- OBJECT.add(target, mask, proto, serange, setype)
-
if object == "fcontext":
OBJECT.add(target, setype, ftype, serange, seuser)
if object == "permissive": if object == "permissive":
OBJECT.add(target) OBJECT.add(target)
@ -242,7 +312,13 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
if modify: if modify:
if object == "boolean": if object == "boolean":
@@ -346,7 +385,7 @@ @@ -358,13 +382,10 @@
if object == "interface":
OBJECT.modify(target, serange, setype)
- if object == "node":
- OBJECT.modify(target, mask, proto, serange, setype)
-
if object == "fcontext": if object == "fcontext":
OBJECT.modify(target, setype, ftype, serange, seuser) OBJECT.modify(target, setype, ftype, serange, seuser)
@ -251,7 +327,13 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
if delete: if delete:
if object == "port": if object == "port":
@@ -358,16 +397,69 @@ @@ -373,22 +394,72 @@
elif object == "fcontext":
OBJECT.delete(target, ftype)
- elif object == "node":
- OBJECT.delete(target, mask, proto)
-
else: else:
OBJECT.delete(target) OBJECT.delete(target)
@ -326,8 +408,38 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
errorExit(error.args[1]) errorExit(error.args[1])
- except KeyboardInterrupt, error: - except KeyboardInterrupt, error:
- sys.exit(0) - sys.exit(0)
diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/semanage/semanage.8 policycoreutils-2.0.54/semanage/semanage.8
--- nsapolicycoreutils/semanage/semanage.8 2008-08-28 09:34:24.000000000 -0400
+++ policycoreutils-2.0.54/semanage/semanage.8 2008-08-05 09:58:59.000000000 -0400
@@ -3,7 +3,7 @@
semanage \- SELinux Policy Management tool
.SH "SYNOPSIS"
-.B semanage {boolean|login|user|port|interface|node|fcontext|translation} \-{l|D} [\-n] [\-S store]
+.B semanage {boolean|login|user|port|interface|fcontext|translation} \-{l|D} [\-n] [\-S store]
.br
.B semanage boolean \-{d|m} [\-\-on|\-\-off|\-1|\-0] -F boolean | boolean_file
.br
@@ -15,8 +15,6 @@
.br
.B semanage interface \-{a|d|m} [\-tr] interface_spec
.br
-.B semanage node -{a|d|m} [-tr] [ -p protocol ] [-M netmask] address
-.br
.B semanage fcontext \-{a|d|m} [\-frst] file_spec
.br
.B semanage permissive \-{a|d} type
@@ -80,7 +78,7 @@
Do not print heading when listing OBJECTS.
.TP
.I \-p, \-\-proto
-Protocol for the specified port (tcp|udp) or internet protocol version for the specified node (ipv4|ipv6).
+Protocol for the specified port (tcp|udp).
.TP
.I \-r, \-\-range
MLS/MCS Security Range (MLS/MCS Systems only)
diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/semanage/seobject.py policycoreutils-2.0.54/semanage/seobject.py diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/semanage/seobject.py policycoreutils-2.0.54/semanage/seobject.py
--- nsapolicycoreutils/semanage/seobject.py 2008-08-05 09:58:26.000000000 -0400 --- nsapolicycoreutils/semanage/seobject.py 2008-08-28 09:34:24.000000000 -0400
+++ policycoreutils-2.0.54/semanage/seobject.py 2008-08-08 17:02:42.000000000 -0400 +++ policycoreutils-2.0.54/semanage/seobject.py 2008-08-08 17:02:42.000000000 -0400
@@ -26,7 +26,6 @@ @@ -26,7 +26,6 @@
PROGNAME="policycoreutils" PROGNAME="policycoreutils"
@ -412,11 +524,11 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
+ else: + else:
+ self.sh=get_handle(store) + self.sh=get_handle(store)
+ self.transaction = False + self.transaction = False
+
- rc = semanage_connect(self.sh)
+ def deleteall(self): + def deleteall(self):
+ raise ValueError(_("Not yet implemented")) + raise ValueError(_("Not yet implemented"))
+
- rc = semanage_connect(self.sh)
+ def begin(self): + def begin(self):
+ if self.transaction: + if self.transaction:
+ return + return
@ -897,12 +1009,7 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
- raise ValueError(_("Requires prefix, roles, level or range")) - raise ValueError(_("Requires prefix, roles, level or range"))
- else: - else:
- raise ValueError(_("Requires prefix or roles")) - raise ValueError(_("Requires prefix or roles"))
+ if prefix == "" and len(roles) == 0 and serange == "" and selevel == "": -
+ if is_mls_enabled == 1:
+ raise ValueError(_("Requires prefix, roles, level or range"))
+ else:
+ raise ValueError(_("Requires prefix or roles"))
- (rc,k) = semanage_user_key_create(self.sh, name) - (rc,k) = semanage_user_key_create(self.sh, name)
- if rc < 0: - if rc < 0:
- raise ValueError(_("Could not create a key for %s") % name) - raise ValueError(_("Could not create a key for %s") % name)
@ -912,7 +1019,12 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
- raise ValueError(_("Could not check if SELinux user %s is defined") % name) - raise ValueError(_("Could not check if SELinux user %s is defined") % name)
- if not exists: - if not exists:
- raise ValueError(_("SELinux user %s is not defined") % name) - raise ValueError(_("SELinux user %s is not defined") % name)
- + if prefix == "" and len(roles) == 0 and serange == "" and selevel == "":
+ if is_mls_enabled == 1:
+ raise ValueError(_("Requires prefix, roles, level or range"))
+ else:
+ raise ValueError(_("Requires prefix or roles"))
- (rc,u) = semanage_user_query(self.sh, k) - (rc,u) = semanage_user_query(self.sh, k)
- if rc < 0: - if rc < 0:
- raise ValueError(_("Could not query user for %s") % name) - raise ValueError(_("Could not query user for %s") % name)
@ -1185,7 +1297,236 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
def get_all(self, locallist = 0): def get_all(self, locallist = 0):
ddict = {} ddict = {}
if locallist: if locallist:
@@ -1035,7 +1011,7 @@ @@ -1031,236 +1007,11 @@
rec += ", %s" % p
print rec
-class nodeRecords(semanageRecords):
- def __init__(self, store = ""):
- semanageRecords.__init__(self,store)
-
- def add(self, addr, mask, proto, serange, ctype):
- if addr == "":
- raise ValueError(_("Node Address is required"))
-
- if mask == "":
- raise ValueError(_("Node Netmask is required"))
-
- if proto == "ipv4":
- proto = 0
- elif proto == "ipv6":
- proto = 1
- else:
- raise ValueError(_("Unknown or missing protocol"))
-
-
- if is_mls_enabled == 1:
- if serange == "":
- serange = "s0"
- else:
- serange = untranslate(serange)
-
- if ctype == "":
- raise ValueError(_("SELinux Type is required"))
-
- (rc,k) = semanage_node_key_create(self.sh, addr, mask, proto)
- if rc < 0:
- raise ValueError(_("Could not create key for %s") % addr)
- if rc < 0:
- raise ValueError(_("Could not check if addr %s is defined") % addr)
-
- (rc,exists) = semanage_node_exists(self.sh, k)
- if exists:
- raise ValueError(_("Addr %s already defined") % addr)
-
- (rc,node) = semanage_node_create(self.sh)
- if rc < 0:
- raise ValueError(_("Could not create addr for %s") % addr)
-
- rc = semanage_node_set_addr(self.sh, node, proto, addr)
- (rc, con) = semanage_context_create(self.sh)
- if rc < 0:
- raise ValueError(_("Could not create context for %s") % addr)
-
- rc = semanage_node_set_mask(self.sh, node, proto, mask)
- if rc < 0:
- raise ValueError(_("Could not set mask for %s") % addr)
-
-
- rc = semanage_context_set_user(self.sh, con, "system_u")
- if rc < 0:
- raise ValueError(_("Could not set user in addr context for %s") % addr)
-
- rc = semanage_context_set_role(self.sh, con, "object_r")
- if rc < 0:
- raise ValueError(_("Could not set role in addr context for %s") % addr)
-
- rc = semanage_context_set_type(self.sh, con, ctype)
- if rc < 0:
- raise ValueError(_("Could not set type in addr context for %s") % addr)
-
- if serange != "":
- rc = semanage_context_set_mls(self.sh, con, serange)
- if rc < 0:
- raise ValueError(_("Could not set mls fields in addr context for %s") % addr)
-
- rc = semanage_node_set_con(self.sh, node, con)
- if rc < 0:
- raise ValueError(_("Could not set addr context for %s") % addr)
-
- rc = semanage_begin_transaction(self.sh)
- if rc < 0:
- raise ValueError(_("Could not start semanage transaction"))
-
- rc = semanage_node_modify_local(self.sh, k, node)
- if rc < 0:
- raise ValueError(_("Could not add addr %s") % addr)
-
- rc = semanage_commit(self.sh)
- if rc < 0:
- raise ValueError(_("Could not add addr %s") % addr)
-
- semanage_context_free(con)
- semanage_node_key_free(k)
- semanage_node_free(node)
-
- def modify(self, addr, mask, proto, serange, setype):
- if addr == "":
- raise ValueError(_("Node Address is required"))
-
- if mask == "":
- raise ValueError(_("Node Netmask is required"))
- if proto == "ipv4":
- proto = 0
- elif proto == "ipv6":
- proto = 1
- else:
- raise ValueError(_("Unknown or missing protocol"))
-
-
- if serange == "" and setype == "":
- raise ValueError(_("Requires setype or serange"))
-
- (rc,k) = semanage_node_key_create(self.sh, addr, mask, proto)
- if rc < 0:
- raise ValueError(_("Could not create key for %s") % addr)
-
- (rc,exists) = semanage_node_exists(self.sh, k)
- if rc < 0:
- raise ValueError(_("Could not check if addr %s is defined") % addr)
- if not exists:
- raise ValueError(_("Addr %s is not defined") % addr)
-
- (rc,node) = semanage_node_query(self.sh, k)
- if rc < 0:
- raise ValueError(_("Could not query addr %s") % addr)
-
- con = semanage_node_get_con(node)
-
- if serange != "":
- semanage_context_set_mls(self.sh, con, untranslate(serange))
- if setype != "":
- semanage_context_set_type(self.sh, con, setype)
-
- rc = semanage_begin_transaction(self.sh)
- if rc < 0:
- raise ValueError(_("Could not start semanage transaction"))
-
- rc = semanage_node_modify_local(self.sh, k, node)
- if rc < 0:
- raise ValueError(_("Could not modify addr %s") % addr)
-
- rc = semanage_commit(self.sh)
- if rc < 0:
- raise ValueError(_("Could not modify addr %s") % addr)
-
- semanage_node_key_free(k)
- semanage_node_free(node)
-
- def delete(self, addr, mask, proto):
- if addr == "":
- raise ValueError(_("Node Address is required"))
-
- if mask == "":
- raise ValueError(_("Node Netmask is required"))
-
- if proto == "ipv4":
- proto = 0
- elif proto == "ipv6":
- proto = 1
- else:
- raise ValueError(_("Unknown or missing protocol"))
-
- (rc,k) = semanage_node_key_create(self.sh, addr, mask, proto)
- if rc < 0:
- raise ValueError(_("Could not create key for %s") % addr)
-
- (rc,exists) = semanage_node_exists(self.sh, k)
- if rc < 0:
- raise ValueError(_("Could not check if addr %s is defined") % addr)
- if not exists:
- raise ValueError(_("Addr %s is not defined") % addr)
-
- (rc,exists) = semanage_node_exists_local(self.sh, k)
- if rc < 0:
- raise ValueError(_("Could not check if addr %s is defined") % addr)
- if not exists:
- raise ValueError(_("Addr %s is defined in policy, cannot be deleted") % addr)
-
- rc = semanage_begin_transaction(self.sh)
- if rc < 0:
- raise ValueError(_("Could not start semanage transaction"))
-
- rc = semanage_node_del_local(self.sh, k)
- if rc < 0:
- raise ValueError(_("Could not delete addr %s") % addr)
-
- rc = semanage_commit(self.sh)
- if rc < 0:
- raise ValueError(_("Could not delete addr %s") % addr)
-
- semanage_node_key_free(k)
-
- def get_all(self, locallist = 0):
- ddict = {}
- if locallist :
- (rc, self.ilist) = semanage_node_list_local(self.sh)
- else:
- (rc, self.ilist) = semanage_node_list(self.sh)
- if rc < 0:
- raise ValueError(_("Could not list addrs"))
-
- for node in self.ilist:
- con = semanage_node_get_con(node)
- addr = semanage_node_get_addr(self.sh, node)
- mask = semanage_node_get_mask(self.sh, node)
- proto = semanage_node_get_proto(node)
- if proto == 0:
- proto = "ipv4"
- elif proto == 1:
- proto = "ipv6"
- ddict[(addr[1], mask[1], proto)] = (semanage_context_get_user(con), semanage_context_get_role(con), semanage_context_get_type(con), semanage_context_get_mls(con))
-
- return ddict
-
- def list(self, heading = 1, locallist = 0):
- if heading:
- print "%-18s %-18s %-5s %-5s\n" % ("IP Address", "Netmask", "Protocol", "Context")
- ddict = self.get_all(locallist)
- keys = ddict.keys()
- keys.sort()
- if is_mls_enabled:
- for k in keys:
- val = ''
- for fields in k:
- val = val + '\t' + str(fields)
- print "%-18s %-18s %-5s %s:%s:%s:%s " % (k[0],k[1],k[2],ddict[k][0], ddict[k][1],ddict[k][2], translate(ddict[k][3], False))
- else:
- for k in keys:
- print "%-18s %-18s %-5s %s:%s:%s " % (k[0],k[1],k[2],ddict[k][0], ddict[k][1],ddict[k][2])
-
-
class interfaceRecords(semanageRecords):
def __init__(self, store = ""): def __init__(self, store = ""):
semanageRecords.__init__(self, store) semanageRecords.__init__(self, store)
@ -1194,7 +1535,7 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
if is_mls_enabled == 1: if is_mls_enabled == 1:
if serange == "": if serange == "":
serange = "s0" serange = "s0"
@@ -1089,23 +1065,20 @@ @@ -1314,23 +1065,20 @@
if rc < 0: if rc < 0:
raise ValueError(_("Could not set message context for %s") % interface) raise ValueError(_("Could not set message context for %s") % interface)
@ -1224,7 +1565,7 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
if serange == "" and setype == "": if serange == "" and setype == "":
raise ValueError(_("Requires setype or serange")) raise ValueError(_("Requires setype or serange"))
@@ -1130,22 +1103,19 @@ @@ -1355,22 +1103,19 @@
if setype != "": if setype != "":
semanage_context_set_type(self.sh, con, setype) semanage_context_set_type(self.sh, con, setype)
@ -1253,7 +1594,7 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
(rc,k) = semanage_iface_key_create(self.sh, interface) (rc,k) = semanage_iface_key_create(self.sh, interface)
if rc < 0: if rc < 0:
raise ValueError(_("Could not create key for %s") % interface) raise ValueError(_("Could not create key for %s") % interface)
@@ -1162,20 +1132,17 @@ @@ -1387,20 +1132,17 @@
if not exists: if not exists:
raise ValueError(_("Interface %s is defined in policy, cannot be deleted") % interface) raise ValueError(_("Interface %s is defined in policy, cannot be deleted") % interface)
@ -1279,7 +1620,7 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
def get_all(self, locallist = 0): def get_all(self, locallist = 0):
ddict = {} ddict = {}
if locallist: if locallist:
@@ -1234,7 +1201,7 @@ @@ -1459,7 +1201,7 @@
if target == "" or target.find("\n") >= 0: if target == "" or target.find("\n") >= 0:
raise ValueError(_("Invalid file specification")) raise ValueError(_("Invalid file specification"))
@ -1288,7 +1629,7 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
self.validate(target) self.validate(target)
if is_mls_enabled == 1: if is_mls_enabled == 1:
@@ -1275,24 +1242,22 @@ @@ -1500,24 +1242,22 @@
semanage_fcontext_set_type(fcontext, file_types[ftype]) semanage_fcontext_set_type(fcontext, file_types[ftype])
@ -1320,7 +1661,7 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
if serange == "" and setype == "" and seuser == "": if serange == "" and setype == "" and seuser == "":
raise ValueError(_("Requires setype, serange or seuser")) raise ValueError(_("Requires setype, serange or seuser"))
self.validate(target) self.validate(target)
@@ -1333,29 +1298,25 @@ @@ -1558,29 +1298,25 @@
if rc < 0: if rc < 0:
raise ValueError(_("Could not set file context for %s") % target) raise ValueError(_("Could not set file context for %s") % target)
@ -1357,7 +1698,7 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
for fcontext in flist: for fcontext in flist:
target = semanage_fcontext_get_expr(fcontext) target = semanage_fcontext_get_expr(fcontext)
@@ -1370,11 +1331,9 @@ @@ -1595,11 +1331,9 @@
raise ValueError(_("Could not delete the file context %s") % target) raise ValueError(_("Could not delete the file context %s") % target)
semanage_fcontext_key_free(k) semanage_fcontext_key_free(k)
@ -1371,7 +1712,7 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
(rc,k) = semanage_fcontext_key_create(self.sh, target, file_types[ftype]) (rc,k) = semanage_fcontext_key_create(self.sh, target, file_types[ftype])
if rc < 0: if rc < 0:
raise ValueError(_("Could not create a key for %s") % target) raise ValueError(_("Could not create a key for %s") % target)
@@ -1391,20 +1350,17 @@ @@ -1616,20 +1350,17 @@
else: else:
raise ValueError(_("File context for %s is not defined") % target) raise ValueError(_("File context for %s is not defined") % target)
@ -1397,7 +1738,7 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
def get_all(self, locallist = 0): def get_all(self, locallist = 0):
l = [] l = []
if locallist: if locallist:
@@ -1486,9 +1442,8 @@ @@ -1711,9 +1442,8 @@
def modify(self, name, value=None, use_file=False): def modify(self, name, value=None, use_file=False):
@ -1409,7 +1750,7 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
if use_file: if use_file:
fd = open(name) fd = open(name)
for b in fd.read().split("\n"): for b in fd.read().split("\n"):
@@ -1498,18 +1453,16 @@ @@ -1723,18 +1453,16 @@
try: try:
boolname, val = b.split("=") boolname, val = b.split("=")
@ -1431,7 +1772,7 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
(rc,k) = semanage_bool_key_create(self.sh, name) (rc,k) = semanage_bool_key_create(self.sh, name)
if rc < 0: if rc < 0:
@@ -1526,42 +1479,30 @@ @@ -1751,42 +1479,30 @@
if not exists: if not exists:
raise ValueError(_("Boolean %s is defined in policy, cannot be deleted") % name) raise ValueError(_("Boolean %s is defined in policy, cannot be deleted") % name)

View File

@ -1,12 +1,12 @@
%define libauditver 1.4.2-1 %define libauditver 1.4.2-1
%define libsepolver 2.0.19-1 %define libsepolver 2.0.19-1
%define libsemanagever 2.0.5-1 %define libsemanagever 2.0.27-2
%define libselinuxver 2.0.46-5 %define libselinuxver 2.0.46-5
%define sepolgenver 1.0.13 %define sepolgenver 1.0.13
Summary: SELinux policy core utilities Summary: SELinux policy core utilities
Name: policycoreutils Name: policycoreutils
Version: 2.0.54 Version: 2.0.55
Release: 6%{?dist} Release: 1%{?dist}
License: GPLv2+ License: GPLv2+
Group: System Environment/Base Group: System Environment/Base
Source: http://www.nsa.gov/selinux/archives/policycoreutils-%{version}.tgz Source: http://www.nsa.gov/selinux/archives/policycoreutils-%{version}.tgz
@ -26,7 +26,7 @@ Patch4: policycoreutils-sepolgen.patch
BuildRequires: pam-devel libsepol-static >= %{libsepolver} libsemanage-devel >= %{libsemanagever} libselinux-devel >= %{libselinuxver} libcap-devel audit-libs-devel >= %{libauditver} gettext BuildRequires: pam-devel libsepol-static >= %{libsepolver} libsemanage-devel >= %{libsemanagever} libselinux-devel >= %{libselinuxver} libcap-devel audit-libs-devel >= %{libauditver} gettext
Requires: /bin/mount /bin/egrep /bin/awk /usr/bin/diff rpm /bin/sed Requires: /bin/mount /bin/egrep /bin/awk /usr/bin/diff rpm /bin/sed
Requires: libselinux >= %{libselinuxver} libsepol >= %{libsepolver} libsemanage >= %{libsemanagever} coreutils audit-libs-python >= %{libauditver} checkpolicy libselinux-python Requires: libselinux >= %{libselinuxver} libsepol >= %{libsepolver} libsemanage-python >= %{libsemanagever} coreutils audit-libs-python >= %{libauditver} checkpolicy libselinux-python
Requires(post): /sbin/service /sbin/chkconfig Requires(post): /sbin/service /sbin/chkconfig
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -192,6 +192,13 @@ if [ "$1" -ge "1" ]; then
fi fi
%changelog %changelog
* Thu Aug 28 2008 Dan Walsh <dwalsh@redhat.com> 2.0.55-1
- Update to upstream
* Merged semanage node support from Christian Kuester.
* Fri Aug 15 2008 Dan Walsh <dwalsh@redhat.com> 2.0.54-7
- Add require libsemanage-python
* Mon Aug 11 2008 Dan Walsh <dwalsh@redhat.com> 2.0.54-6 * Mon Aug 11 2008 Dan Walsh <dwalsh@redhat.com> 2.0.54-6
- Add missing html_util.py file - Add missing html_util.py file

View File

@ -1,2 +1,2 @@
b6756a012c26f414e4a5f8f438ce2188 sepolgen-1.0.13.tgz b6756a012c26f414e4a5f8f438ce2188 sepolgen-1.0.13.tgz
b1d1bc767b4806a17d0986ab4016cf9b policycoreutils-2.0.54.tgz 0c606d0237e6588d0bc01137fe948644 policycoreutils-2.0.55.tgz