python/semaange: fix moduleRecords.customized()
PATCH 1/1 python/semaange: fix moduleRecords.customized()
Return value of "customized" has to be iterable.
Fixes:
"semanage export" with no modules in the system (eg. monolithic policy) crashes:
Traceback (most recent call last):
File "/usr/sbin/semanage", line 970, in <module>
do_parser()
File "/usr/sbin/semanage", line 949, in do_parser
args.func(args)
File "/usr/sbin/semanage", line 771, in handleExport
for c in OBJECT.customized():
TypeError: 'NoneType' object is not iterable
--- python/semanage/seobject.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
python/semanage/seobject.py +1 -1
@@ -380,7 +380,7 @@ class moduleRecords(semanageRecords): def customized(self): all = self.get_all() if len(all) == 0: - return + return [] return ["-d %s" % x[0] for x in [t for t in all if t[1] == 0]] def list(self, heading=1, locallist=0):
Signature · 1 line
2.21.0
Quoted 16 lines · Vit Mojzis
Return value of "customized" has to be iterable.
Fixes:
"semanage export" with no modules in the system (eg. monolithic policy) crashes:Traceback (most recent call last):
File "/usr/sbin/semanage", line 970, in <module>
do_parser()
File "/usr/sbin/semanage", line 949, indo_parser
args.func(args)
File "/usr/sbin/semanage", line 771, in handleExport
for c inOBJECT.customized():
TypeError: 'NoneType' object is not iterable
Quoted 1 line
Signed-off-by Vit Mojzis <[email protected]>
This looks good to me, but there is a misspelling in the subject of the patch: semaange -> semanage.
Thanks!
Nicolas
Quoted 20 lines
--- python/semanage/seobject.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)python/semanage/seobject.py +1
-2@@ -380,7 +380,7 @@ class moduleRecords(semanageRecords): def customized(self): all = self.get_all() if len(all) == 0: - return + return [] return ["-d %s" % x[0] for x in [t for t in all if t[1] == 0]] def list(self, heading=1, locallist=0): --2.21.0
PATCH 1/1 python/semanage: fix moduleRecords.customized()
Return value of "customized" has to be iterable.
Fixes:
"semanage export" with no modules in the system (eg. monolithic policy) crashes:
Traceback (most recent call last):
File "/usr/sbin/semanage", line 970, in <module>
do_parser()
File "/usr/sbin/semanage", line 949, in do_parser
args.func(args)
File "/usr/sbin/semanage", line 771, in handleExport
for c in OBJECT.customized():
TypeError: 'NoneType' object is not iterable
--- python/semanage/seobject.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
python/semanage/seobject.py +1 -1
@@ -380,7 +380,7 @@ class moduleRecords(semanageRecords): def customized(self): all = self.get_all() if len(all) == 0: - return + return [] return ["-d %s" % x[0] for x in [t for t in all if t[1] == 0]] def list(self, heading=1, locallist=0):
Signature · 1 line
2.21.0
Re: [PATCH] python/semanage: fix moduleRecords.customized()
Quoted 15 lines · Vit Mojzis
Return value of "customized" has to be iterable.
Fixes:
"semanage export" with no modules in the system (eg. monolithic policy) crashes:Traceback (most recent call last):
File "/usr/sbin/semanage", line 970, in <module>
do_parser()
File "/usr/sbin/semanage", line 949, indo_parser
args.func(args)
File "/usr/sbin/semanage", line 771, in handleExport
for c inOBJECT.customized():
TypeError: 'NoneType' object is not iterable
Quoted 1 line
Signed-off-by Vit Mojzis <[email protected]>
Thanks, both patches applied.
Quoted 18 lines
--- python/semanage/seobject.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)python/semanage/seobject.py +1
-1@@ -380,7 +380,7 @@ class moduleRecords(semanageRecords): def customized(self): all = self.get_all() if len(all) == 0: - return + return [] return ["-d %s" % x[0] for x in [t for t in all if t[1] == 0]] def list(self, heading=1, locallist=0):