Bug 881594

Summary: sepolicy communicate tracebacks
Product: Red Hat Enterprise Linux 7 Reporter: Milos Malik <mmalik>
Component: policycoreutilsAssignee: Daniel Walsh <dwalsh>
Status: CLOSED CURRENTRELEASE QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0   
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 12:35:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 917049    

Description Milos Malik 2012-11-29 07:36:02 UTC
Description of problem:


Version-Release number of selected component (if applicable):
policycoreutils-2.1.13-34.el7.x86_64
policycoreutils-newrole-2.1.13-34.el7.x86_64
policycoreutils-restorecond-2.1.13-34.el7.x86_64
policycoreutils-devel-2.1.13-34.el7.x86_64
policycoreutils-sandbox-2.1.13-34.el7.x86_64
policycoreutils-python-2.1.13-34.el7.x86_64

How reproducible:
always

Steps to Reproduce:
# sepolicy communicate -s sshd_t -t sshd_t

Actual results:
Traceback (most recent call last):
  File "/usr/bin/sepolicy", line 305, in <module>
    args.func(args)
  File "/usr/bin/sepolicy", line 195, in communicate
    writable = get_types(args.source, args.tclass, args.sourceaccess.split(","))
  File "/usr/lib64/python2.7/site-packages/sepolicy/communicate.py", line 41, in get_types
    allows=search([sepolicy.ALLOW],{sepolicy.SOURCE:src,sepolicy.CLASS:tclass, sepolicy.PERMS:perm})
  File "/usr/lib64/python2.7/site-packages/sepolicy/__init__.py", line 47, in search
    dict_list = filter(lambda x: _dict_has_perms(x, perms), dict_list)
  File "/usr/lib64/python2.7/site-packages/sepolicy/__init__.py", line 47, in <lambda>
    dict_list = filter(lambda x: _dict_has_perms(x, perms), dict_list)
  File "/usr/lib64/python2.7/site-packages/sepolicy/__init__.py", line 51, in _dict_has_perms
    for perm in perms:
TypeError: expected string or Unicode object, list found

Expected results:
 * no traceback

Comment 1 Milos Malik 2012-11-29 14:13:12 UTC
# sepolicy communicate -s sshd_t -t sshd_t -c xxx
ERROR: could not find class xxx
Traceback (most recent call last):
  File "/usr/bin/sepolicy", line 305, in <module>
    args.func(args)
  File "/usr/bin/sepolicy", line 195, in communicate
    writable = get_types(args.source, args.tclass, args.sourceaccess.split(","))
  File "/usr/lib64/python2.7/site-packages/sepolicy/communicate.py", line 43, in get_types
    raise TypeError("The %s type is not allowed to %s any types" % (src, ",".join(perm)))
TypeError: The ['sshd_t'] type is not allowed to open,write any types
#

Comment 2 Daniel Walsh 2012-11-30 05:26:46 UTC
Fixed in policycoreutils-2.1.13-41.el7

Comment 4 Daniel Walsh 2013-03-14 22:17:09 UTC
Fixed in policycoreutils-2.1.14-22.el7

Comment 6 Daniel Walsh 2013-04-11 17:51:19 UTC
Fixed in policycoreutils-2.1.14-36.el7

Comment 8 Ludek Smid 2014-06-13 12:35:47 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.