* Mon Sep 8 2008 Dan Walsh <dwalsh@redhat.com> 2.0.55-5
- Add node support to semanage
This commit is contained in:
parent
f015700775
commit
9f10e60d0d
@ -92,7 +92,7 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
|
|||||||
}
|
}
|
||||||
diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/semanage/semanage policycoreutils-2.0.55/semanage/semanage
|
diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/semanage/semanage policycoreutils-2.0.55/semanage/semanage
|
||||||
--- nsapolicycoreutils/semanage/semanage 2008-08-28 09:34:24.000000000 -0400
|
--- nsapolicycoreutils/semanage/semanage 2008-08-28 09:34:24.000000000 -0400
|
||||||
+++ policycoreutils-2.0.55/semanage/semanage 2008-08-29 14:34:58.000000000 -0400
|
+++ policycoreutils-2.0.55/semanage/semanage 2008-09-08 14:46:57.000000000 -0400
|
||||||
@@ -20,7 +20,7 @@
|
@@ -20,7 +20,7 @@
|
||||||
# 02111-1307 USA
|
# 02111-1307 USA
|
||||||
#
|
#
|
||||||
@ -102,25 +102,18 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
|
|||||||
import seobject
|
import seobject
|
||||||
import selinux
|
import selinux
|
||||||
PROGNAME="policycoreutils"
|
PROGNAME="policycoreutils"
|
||||||
@@ -43,13 +43,14 @@
|
@@ -43,7 +43,9 @@
|
||||||
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|node|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
|
||||||
semanage port -{a|d|m} [-tr] [ -p proto ] port | port_range
|
@@ -60,6 +62,7 @@
|
||||||
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
|
||||||
@ -128,17 +121,7 @@ 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
|
||||||
@@ -81,8 +83,7 @@
|
@@ -91,9 +94,8 @@
|
||||||
-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)
|
||||||
@ -150,18 +133,7 @@ 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])
|
||||||
@@ -111,9 +111,7 @@
|
@@ -124,12 +126,53 @@
|
||||||
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
|
||||||
|
|
||||||
@ -221,11 +193,7 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
|
|||||||
serange = ""
|
serange = ""
|
||||||
port = ""
|
port = ""
|
||||||
proto = ""
|
proto = ""
|
||||||
- mask = ""
|
@@ -151,24 +194,23 @@
|
||||||
selevel = ""
|
|
||||||
setype = ""
|
|
||||||
ftype = ""
|
|
||||||
@@ -151,24 +189,23 @@
|
|
||||||
locallist = False
|
locallist = False
|
||||||
use_file = False
|
use_file = False
|
||||||
store = ""
|
store = ""
|
||||||
@ -243,7 +211,7 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
|
|||||||
|
|
||||||
gopts, cmds = getopt.getopt(args,
|
gopts, cmds = getopt.getopt(args,
|
||||||
- '01adf:lhmnp:s:FCDR:L:r:t:T:P:S:M:',
|
- '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:M:',
|
||||||
['add',
|
['add',
|
||||||
'delete',
|
'delete',
|
||||||
'deleteall',
|
'deleteall',
|
||||||
@ -254,17 +222,16 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
|
|||||||
'list',
|
'list',
|
||||||
'modify',
|
'modify',
|
||||||
'noheading',
|
'noheading',
|
||||||
@@ -183,8 +220,7 @@
|
@@ -184,7 +226,7 @@
|
||||||
'roles=',
|
|
||||||
'type=',
|
'type=',
|
||||||
'trans=',
|
'trans=',
|
||||||
- 'prefix=',
|
'prefix=',
|
||||||
- 'mask='
|
- 'mask='
|
||||||
+ 'prefix='
|
+ 'mask='
|
||||||
])
|
])
|
||||||
for o, a in gopts:
|
for o, a in gopts:
|
||||||
if o not in option_dict[object]:
|
if o not in option_dict[object]:
|
||||||
@@ -193,16 +229,16 @@
|
@@ -193,16 +235,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:
|
||||||
@ -284,7 +251,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
|
||||||
@@ -211,7 +247,7 @@
|
@@ -211,7 +253,7 @@
|
||||||
use_file = True
|
use_file = True
|
||||||
|
|
||||||
if o == "-h" or o == "--help":
|
if o == "-h" or o == "--help":
|
||||||
@ -293,7 +260,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
|
||||||
@@ -221,7 +257,7 @@
|
@@ -221,7 +263,7 @@
|
||||||
|
|
||||||
if o == "-m"or o == "--modify":
|
if o == "-m"or o == "--modify":
|
||||||
if delete or add:
|
if delete or add:
|
||||||
@ -302,7 +269,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':
|
||||||
@@ -229,7 +265,7 @@
|
@@ -229,7 +271,7 @@
|
||||||
|
|
||||||
if o == "-r" or o == '--range':
|
if o == "-r" or o == '--range':
|
||||||
if is_mls_enabled == 0:
|
if is_mls_enabled == 0:
|
||||||
@ -311,7 +278,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":
|
||||||
@@ -237,7 +273,7 @@
|
@@ -237,7 +279,7 @@
|
||||||
|
|
||||||
if o == "-L" or o == '--level':
|
if o == "-L" or o == '--level':
|
||||||
if is_mls_enabled == 0:
|
if is_mls_enabled == 0:
|
||||||
@ -320,27 +287,16 @@ 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':
|
||||||
@@ -252,9 +288,6 @@
|
@@ -280,7 +322,7 @@
|
||||||
if o == "-s" or o == "--seuser":
|
|
||||||
seuser = a
|
|
||||||
|
|
||||||
- if o == "-M" or o == '--mask':
|
if object == "node":
|
||||||
- mask = a
|
OBJECT = seobject.nodeRecords(store)
|
||||||
-
|
-
|
||||||
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":
|
if object == "fcontext":
|
||||||
OBJECT = seobject.fcontextRecords(store)
|
OBJECT = seobject.fcontextRecords(store)
|
||||||
@@ -298,14 +328,14 @@
|
|
||||||
|
@@ -298,14 +340,14 @@
|
||||||
OBJECT.list(heading, locallist, use_file)
|
OBJECT.list(heading, locallist, use_file)
|
||||||
else:
|
else:
|
||||||
OBJECT.list(heading, locallist)
|
OBJECT.list(heading, locallist)
|
||||||
@ -358,7 +314,7 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
|
|||||||
|
|
||||||
target = cmds[0]
|
target = cmds[0]
|
||||||
|
|
||||||
@@ -317,10 +347,7 @@
|
@@ -317,10 +359,7 @@
|
||||||
OBJECT.add(target, setrans)
|
OBJECT.add(target, setrans)
|
||||||
|
|
||||||
if object == "user":
|
if object == "user":
|
||||||
@ -370,15 +326,7 @@ 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)
|
||||||
@@ -328,15 +355,12 @@
|
@@ -336,7 +375,7 @@
|
||||||
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)
|
||||||
|
|
||||||
@ -387,13 +335,7 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
|
|||||||
|
|
||||||
if modify:
|
if modify:
|
||||||
if object == "boolean":
|
if object == "boolean":
|
||||||
@@ -358,13 +382,10 @@
|
@@ -364,7 +403,7 @@
|
||||||
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)
|
||||||
|
|
||||||
@ -402,13 +344,7 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
|
|||||||
|
|
||||||
if delete:
|
if delete:
|
||||||
if object == "port":
|
if object == "port":
|
||||||
@@ -373,22 +394,72 @@
|
@@ -379,16 +418,69 @@
|
||||||
elif object == "fcontext":
|
|
||||||
OBJECT.delete(target, ftype)
|
|
||||||
|
|
||||||
- elif object == "node":
|
|
||||||
- OBJECT.delete(target, mask, proto)
|
|
||||||
-
|
|
||||||
else:
|
else:
|
||||||
OBJECT.delete(target)
|
OBJECT.delete(target)
|
||||||
|
|
||||||
@ -483,39 +419,9 @@ 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.55/semanage/semanage.8
|
|
||||||
--- nsapolicycoreutils/semanage/semanage.8 2008-08-28 09:34:24.000000000 -0400
|
|
||||||
+++ policycoreutils-2.0.55/semanage/semanage.8 2008-08-29 14:34:58.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.55/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.55/semanage/seobject.py
|
||||||
--- nsapolicycoreutils/semanage/seobject.py 2008-08-28 09:34:24.000000000 -0400
|
--- nsapolicycoreutils/semanage/seobject.py 2008-08-28 09:34:24.000000000 -0400
|
||||||
+++ policycoreutils-2.0.55/semanage/seobject.py 2008-08-29 14:34:58.000000000 -0400
|
+++ policycoreutils-2.0.55/semanage/seobject.py 2008-09-08 15:02:04.000000000 -0400
|
||||||
@@ -26,7 +26,6 @@
|
@@ -26,7 +26,6 @@
|
||||||
PROGNAME="policycoreutils"
|
PROGNAME="policycoreutils"
|
||||||
import sepolgen.module as module
|
import sepolgen.module as module
|
||||||
@ -1088,25 +994,30 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
|
|||||||
- (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)
|
||||||
-
|
|
||||||
- (rc,exists) = semanage_user_exists(self.sh, k)
|
|
||||||
- if rc < 0:
|
|
||||||
- raise ValueError(_("Could not check if SELinux user %s is defined") % name)
|
|
||||||
- if not exists:
|
|
||||||
- raise ValueError(_("SELinux user %s is not defined") % name)
|
|
||||||
+ if prefix == "" and len(roles) == 0 and serange == "" and selevel == "":
|
+ if prefix == "" and len(roles) == 0 and serange == "" and selevel == "":
|
||||||
+ if is_mls_enabled == 1:
|
+ if is_mls_enabled == 1:
|
||||||
+ 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"))
|
||||||
|
|
||||||
- (rc,u) = semanage_user_query(self.sh, k)
|
- (rc,exists) = semanage_user_exists(self.sh, k)
|
||||||
- if rc < 0:
|
- if rc < 0:
|
||||||
- raise ValueError(_("Could not query user for %s") % name)
|
- raise ValueError(_("Could not check if SELinux user %s is defined") % name)
|
||||||
|
- if not exists:
|
||||||
|
- raise ValueError(_("SELinux user %s is not defined") % name)
|
||||||
+ (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)
|
||||||
|
|
||||||
|
- (rc,u) = semanage_user_query(self.sh, k)
|
||||||
|
- if rc < 0:
|
||||||
|
- raise ValueError(_("Could not query user for %s") % name)
|
||||||
|
+ (rc,exists) = semanage_user_exists(self.sh, k)
|
||||||
|
+ if rc < 0:
|
||||||
|
+ raise ValueError(_("Could not check if SELinux user %s is defined") % name)
|
||||||
|
+ if not exists:
|
||||||
|
+ raise ValueError(_("SELinux user %s is not defined") % name)
|
||||||
|
|
||||||
- oldserange = semanage_user_get_mlsrange(u)
|
- oldserange = semanage_user_get_mlsrange(u)
|
||||||
- (rc, rlist) = semanage_user_get_roles(self.sh, u)
|
- (rc, rlist) = semanage_user_get_roles(self.sh, u)
|
||||||
- if rc >= 0:
|
- if rc >= 0:
|
||||||
@ -1129,22 +1040,13 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
|
|||||||
- for r in roles:
|
- for r in roles:
|
||||||
- if r not in rlist:
|
- if r not in rlist:
|
||||||
- semanage_user_add_role(self.sh, u, r)
|
- semanage_user_add_role(self.sh, u, r)
|
||||||
+ (rc,exists) = semanage_user_exists(self.sh, k)
|
|
||||||
+ if rc < 0:
|
|
||||||
+ raise ValueError(_("Could not check if SELinux user %s is defined") % name)
|
|
||||||
+ if not exists:
|
|
||||||
+ raise ValueError(_("SELinux user %s is not defined") % name)
|
|
||||||
|
|
||||||
- rc = semanage_begin_transaction(self.sh)
|
|
||||||
- if rc < 0:
|
|
||||||
- raise ValueError(_("Could not start semanage transaction"))
|
|
||||||
+ (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)
|
||||||
|
|
||||||
- rc = semanage_user_modify_local(self.sh, k, u)
|
- rc = semanage_begin_transaction(self.sh)
|
||||||
- if rc < 0:
|
- if rc < 0:
|
||||||
- raise ValueError(_("Could not modify SELinux user %s") % name)
|
- raise ValueError(_("Could not start semanage transaction"))
|
||||||
+ oldserange = semanage_user_get_mlsrange(u)
|
+ oldserange = semanage_user_get_mlsrange(u)
|
||||||
+ (rc, rlist) = semanage_user_get_roles(self.sh, u)
|
+ (rc, rlist) = semanage_user_get_roles(self.sh, u)
|
||||||
+ if rc >= 0:
|
+ if rc >= 0:
|
||||||
@ -1168,6 +1070,10 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
|
|||||||
+ if r not in rlist:
|
+ if r not in rlist:
|
||||||
+ semanage_user_add_role(self.sh, u, r)
|
+ semanage_user_add_role(self.sh, u, r)
|
||||||
|
|
||||||
|
- rc = semanage_user_modify_local(self.sh, k, u)
|
||||||
|
- if rc < 0:
|
||||||
|
- raise ValueError(_("Could not modify SELinux user %s") % name)
|
||||||
|
-
|
||||||
- rc = semanage_commit(self.sh)
|
- rc = semanage_commit(self.sh)
|
||||||
- if rc < 0:
|
- if rc < 0:
|
||||||
- raise ValueError(_("Could not modify SELinux user %s") % name)
|
- raise ValueError(_("Could not modify SELinux user %s") % name)
|
||||||
@ -1372,236 +1278,101 @@ 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:
|
||||||
@@ -1031,236 +1007,11 @@
|
@@ -1035,7 +1011,7 @@
|
||||||
rec += ", %s" % p
|
def __init__(self, store = ""):
|
||||||
print rec
|
semanageRecords.__init__(self,store)
|
||||||
|
|
||||||
-class nodeRecords(semanageRecords):
|
|
||||||
- def __init__(self, store = ""):
|
|
||||||
- semanageRecords.__init__(self,store)
|
|
||||||
-
|
|
||||||
- def add(self, addr, mask, proto, serange, ctype):
|
- def add(self, addr, mask, proto, serange, ctype):
|
||||||
- if addr == "":
|
+ def __add(self, addr, mask, proto, serange, ctype):
|
||||||
- raise ValueError(_("Node Address is required"))
|
if addr == "":
|
||||||
-
|
raise ValueError(_("Node Address is required"))
|
||||||
- if mask == "":
|
|
||||||
- raise ValueError(_("Node Netmask is required"))
|
@@ -1104,23 +1080,20 @@
|
||||||
-
|
if rc < 0:
|
||||||
- if proto == "ipv4":
|
raise ValueError(_("Could not set addr context for %s") % addr)
|
||||||
- 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)
|
- rc = semanage_begin_transaction(self.sh)
|
||||||
- if rc < 0:
|
- if rc < 0:
|
||||||
- raise ValueError(_("Could not start semanage transaction"))
|
- raise ValueError(_("Could not start semanage transaction"))
|
||||||
-
|
-
|
||||||
- rc = semanage_node_modify_local(self.sh, k, node)
|
rc = semanage_node_modify_local(self.sh, k, node)
|
||||||
- if rc < 0:
|
if rc < 0:
|
||||||
- raise ValueError(_("Could not add addr %s") % addr)
|
raise ValueError(_("Could not add addr %s") % addr)
|
||||||
-
|
|
||||||
- rc = semanage_commit(self.sh)
|
- rc = semanage_commit(self.sh)
|
||||||
- if rc < 0:
|
- if rc < 0:
|
||||||
- raise ValueError(_("Could not add addr %s") % addr)
|
- raise ValueError(_("Could not add addr %s") % addr)
|
||||||
-
|
-
|
||||||
- semanage_context_free(con)
|
semanage_context_free(con)
|
||||||
- semanage_node_key_free(k)
|
semanage_node_key_free(k)
|
||||||
- semanage_node_free(node)
|
semanage_node_free(node)
|
||||||
-
|
|
||||||
- def modify(self, addr, mask, proto, serange, setype):
|
- def modify(self, addr, mask, proto, serange, setype):
|
||||||
- if addr == "":
|
+ def add(self, addr, mask, proto, serange, ctype):
|
||||||
- raise ValueError(_("Node Address is required"))
|
+ self.begin()
|
||||||
-
|
+ self.__add(self, addr, mask, proto, serange, ctype)
|
||||||
- if mask == "":
|
+ self.commit()
|
||||||
- raise ValueError(_("Node Netmask is required"))
|
+
|
||||||
- if proto == "ipv4":
|
+ def __modify(self, addr, mask, proto, serange, setype):
|
||||||
- proto = 0
|
if addr == "":
|
||||||
- elif proto == "ipv6":
|
raise ValueError(_("Node Address is required"))
|
||||||
- proto = 1
|
|
||||||
- else:
|
@@ -1158,22 +1131,19 @@
|
||||||
- raise ValueError(_("Unknown or missing protocol"))
|
if setype != "":
|
||||||
-
|
semanage_context_set_type(self.sh, con, setype)
|
||||||
-
|
|
||||||
- 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)
|
- rc = semanage_begin_transaction(self.sh)
|
||||||
- if rc < 0:
|
- if rc < 0:
|
||||||
- raise ValueError(_("Could not start semanage transaction"))
|
- raise ValueError(_("Could not start semanage transaction"))
|
||||||
-
|
-
|
||||||
- rc = semanage_node_modify_local(self.sh, k, node)
|
rc = semanage_node_modify_local(self.sh, k, node)
|
||||||
- if rc < 0:
|
if rc < 0:
|
||||||
- raise ValueError(_("Could not modify addr %s") % addr)
|
raise ValueError(_("Could not modify addr %s") % addr)
|
||||||
-
|
|
||||||
- rc = semanage_commit(self.sh)
|
- rc = semanage_commit(self.sh)
|
||||||
- if rc < 0:
|
- if rc < 0:
|
||||||
- raise ValueError(_("Could not modify addr %s") % addr)
|
- raise ValueError(_("Could not modify addr %s") % addr)
|
||||||
-
|
-
|
||||||
- semanage_node_key_free(k)
|
semanage_node_key_free(k)
|
||||||
- semanage_node_free(node)
|
semanage_node_free(node)
|
||||||
-
|
|
||||||
- def delete(self, addr, mask, proto):
|
- def delete(self, addr, mask, proto):
|
||||||
- if addr == "":
|
+ def modify(self, addr, mask, proto, serange, setype):
|
||||||
- raise ValueError(_("Node Address is required"))
|
+ self.begin()
|
||||||
-
|
+ self.__modify(addr, mask, proto, serange, setype)
|
||||||
- if mask == "":
|
+ self.commit()
|
||||||
- raise ValueError(_("Node Netmask is required"))
|
+
|
||||||
-
|
+ def __delete(self, addr, mask, proto):
|
||||||
- if proto == "ipv4":
|
if addr == "":
|
||||||
- proto = 0
|
raise ValueError(_("Node Address is required"))
|
||||||
- elif proto == "ipv6":
|
|
||||||
- proto = 1
|
@@ -1203,20 +1173,17 @@
|
||||||
- else:
|
if not exists:
|
||||||
- raise ValueError(_("Unknown or missing protocol"))
|
raise ValueError(_("Addr %s is defined in policy, cannot be deleted") % addr)
|
||||||
-
|
|
||||||
- (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)
|
- rc = semanage_begin_transaction(self.sh)
|
||||||
- if rc < 0:
|
- if rc < 0:
|
||||||
- raise ValueError(_("Could not start semanage transaction"))
|
- raise ValueError(_("Could not start semanage transaction"))
|
||||||
-
|
-
|
||||||
- rc = semanage_node_del_local(self.sh, k)
|
rc = semanage_node_del_local(self.sh, k)
|
||||||
- if rc < 0:
|
if rc < 0:
|
||||||
- raise ValueError(_("Could not delete addr %s") % addr)
|
raise ValueError(_("Could not delete addr %s") % addr)
|
||||||
-
|
|
||||||
- rc = semanage_commit(self.sh)
|
- rc = semanage_commit(self.sh)
|
||||||
- if rc < 0:
|
- if rc < 0:
|
||||||
- raise ValueError(_("Could not delete addr %s") % addr)
|
- raise ValueError(_("Could not delete addr %s") % addr)
|
||||||
-
|
-
|
||||||
- semanage_node_key_free(k)
|
semanage_node_key_free(k)
|
||||||
-
|
|
||||||
- def get_all(self, locallist = 0):
|
+ def delete(self, addr, mask, proto):
|
||||||
- ddict = {}
|
+ self.begin()
|
||||||
- if locallist :
|
+ self.__delete(addr, mask, proto)
|
||||||
- (rc, self.ilist) = semanage_node_list_local(self.sh)
|
+ self.commit()
|
||||||
- else:
|
+
|
||||||
- (rc, self.ilist) = semanage_node_list(self.sh)
|
def get_all(self, locallist = 0):
|
||||||
- if rc < 0:
|
ddict = {}
|
||||||
- raise ValueError(_("Could not list addrs"))
|
if locallist :
|
||||||
-
|
@@ -1260,7 +1227,7 @@
|
||||||
- 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)
|
||||||
|
|
||||||
@ -1610,7 +1381,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"
|
||||||
@@ -1314,23 +1065,20 @@
|
@@ -1314,23 +1281,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)
|
||||||
|
|
||||||
@ -1640,7 +1411,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"))
|
||||||
|
|
||||||
@@ -1355,22 +1103,19 @@
|
@@ -1355,22 +1319,19 @@
|
||||||
if setype != "":
|
if setype != "":
|
||||||
semanage_context_set_type(self.sh, con, setype)
|
semanage_context_set_type(self.sh, con, setype)
|
||||||
|
|
||||||
@ -1669,7 +1440,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)
|
||||||
@@ -1387,20 +1132,17 @@
|
@@ -1387,20 +1348,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)
|
||||||
|
|
||||||
@ -1695,7 +1466,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:
|
||||||
@@ -1459,7 +1201,7 @@
|
@@ -1459,7 +1417,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"))
|
||||||
|
|
||||||
@ -1704,7 +1475,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:
|
||||||
@@ -1500,24 +1242,22 @@
|
@@ -1500,24 +1458,21 @@
|
||||||
|
|
||||||
semanage_fcontext_set_type(fcontext, file_types[ftype])
|
semanage_fcontext_set_type(fcontext, file_types[ftype])
|
||||||
|
|
||||||
@ -1726,7 +1497,6 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po
|
|||||||
semanage_fcontext_free(fcontext)
|
semanage_fcontext_free(fcontext)
|
||||||
|
|
||||||
- def modify(self, target, setype, ftype, serange, seuser):
|
- def modify(self, target, setype, ftype, serange, seuser):
|
||||||
+
|
|
||||||
+ def add(self, target, type, ftype = "", serange = "", seuser = "system_u"):
|
+ def add(self, target, type, ftype = "", serange = "", seuser = "system_u"):
|
||||||
+ self.begin()
|
+ self.begin()
|
||||||
+ self.__add(target, type, ftype, serange, seuser)
|
+ self.__add(target, type, ftype, serange, seuser)
|
||||||
@ -1736,7 +1506,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)
|
||||||
@@ -1558,29 +1298,25 @@
|
@@ -1558,29 +1513,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)
|
||||||
|
|
||||||
@ -1773,7 +1543,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)
|
||||||
@@ -1595,11 +1331,9 @@
|
@@ -1595,11 +1546,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)
|
||||||
|
|
||||||
@ -1787,7 +1557,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)
|
||||||
@@ -1616,20 +1350,17 @@
|
@@ -1616,20 +1565,17 @@
|
||||||
else:
|
else:
|
||||||
raise ValueError(_("File context for %s is not defined") % target)
|
raise ValueError(_("File context for %s is not defined") % target)
|
||||||
|
|
||||||
@ -1813,7 +1583,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:
|
||||||
@@ -1711,9 +1442,8 @@
|
@@ -1711,9 +1657,8 @@
|
||||||
|
|
||||||
def modify(self, name, value=None, use_file=False):
|
def modify(self, name, value=None, use_file=False):
|
||||||
|
|
||||||
@ -1825,7 +1595,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"):
|
||||||
@@ -1723,18 +1453,16 @@
|
@@ -1723,18 +1668,16 @@
|
||||||
|
|
||||||
try:
|
try:
|
||||||
boolname, val = b.split("=")
|
boolname, val = b.split("=")
|
||||||
@ -1847,7 +1617,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:
|
||||||
@@ -1751,42 +1479,30 @@
|
@@ -1751,42 +1694,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)
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
Summary: SELinux policy core utilities
|
Summary: SELinux policy core utilities
|
||||||
Name: policycoreutils
|
Name: policycoreutils
|
||||||
Version: 2.0.55
|
Version: 2.0.55
|
||||||
Release: 4%{?dist}
|
Release: 5%{?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
|
||||||
@ -192,6 +192,9 @@ if [ "$1" -ge "1" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Sep 8 2008 Dan Walsh <dwalsh@redhat.com> 2.0.55-5
|
||||||
|
- Add node support to semanage
|
||||||
|
|
||||||
* Mon Sep 8 2008 Dan Walsh <dwalsh@redhat.com> 2.0.55-4
|
* Mon Sep 8 2008 Dan Walsh <dwalsh@redhat.com> 2.0.55-4
|
||||||
- Fix fixfiles to correct unlabeled_t files and remove .? files
|
- Fix fixfiles to correct unlabeled_t files and remove .? files
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user