Author: Daniel J Walsh Email: dwalsh@redhat.com Subject: Patch to semanage Date: Fri, 17 Jul 2009 06:10:37 -0400
Patch to semanage Chad Sellers: I pulled this patch out of the larger patch. This patch fixes 2 small bugs in seobject.py. The first left the setrans file with the wrong permissions. The second returned a malformed dictionary from portRecords get_all method. Signed-off-by: Chad Sellers <csellers@tresys.com>
This commit is contained in:
parent
8ad29a2725
commit
1f60e9b7a3
1 changed files with 3 additions and 2 deletions
|
@ -21,7 +21,7 @@
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
import pwd, grp, string, selinux, tempfile, os, re, sys
|
import pwd, grp, string, selinux, tempfile, os, re, sys, stat
|
||||||
from semanage import *;
|
from semanage import *;
|
||||||
PROGNAME = "policycoreutils"
|
PROGNAME = "policycoreutils"
|
||||||
import sepolgen.module as module
|
import sepolgen.module as module
|
||||||
|
@ -273,6 +273,7 @@ class setransRecords:
|
||||||
(fd, newfilename) = tempfile.mkstemp('', self.filename)
|
(fd, newfilename) = tempfile.mkstemp('', self.filename)
|
||||||
os.write(fd, self.out())
|
os.write(fd, self.out())
|
||||||
os.close(fd)
|
os.close(fd)
|
||||||
|
os.chmod(newfilename, os.stat(self.filename)[stat.ST_MODE])
|
||||||
os.rename(newfilename, self.filename)
|
os.rename(newfilename, self.filename)
|
||||||
os.system("/sbin/service mcstrans reload > /dev/null")
|
os.system("/sbin/service mcstrans reload > /dev/null")
|
||||||
|
|
||||||
|
@ -983,7 +984,7 @@ class portRecords(semanageRecords):
|
||||||
proto_str = semanage_port_get_proto_str(proto)
|
proto_str = semanage_port_get_proto_str(proto)
|
||||||
low = semanage_port_get_low(port)
|
low = semanage_port_get_low(port)
|
||||||
high = semanage_port_get_high(port)
|
high = semanage_port_get_high(port)
|
||||||
ddict[(low, high)] = (ctype, proto_str, level)
|
ddict[(low, high, proto_str)] = (ctype, level)
|
||||||
return ddict
|
return ddict
|
||||||
|
|
||||||
def get_all_by_type(self, locallist = 0):
|
def get_all_by_type(self, locallist = 0):
|
||||||
|
|
Loading…
Reference in a new issue