Bug 1414072 - sepolicy communicate tracebacks: TypeError: 'generator' object has no attribute '__getitem__'
Summary: sepolicy communicate tracebacks: TypeError: 'generator' object has no attribu...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: policycoreutils
Version: 25
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Lautrbach
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-17 16:49 UTC by Milos Malik
Modified: 2017-01-24 16:31 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-23 15:34:04 UTC
Type: Bug


Attachments (Terms of Use)

Description Milos Malik 2017-01-17 16:49:31 UTC
Description of problem:

Version-Release number of selected component (if applicable):
checkpolicy-2.6-0.1.fc25.x86_64
libselinux-2.6-0.1.fc25.x86_64
libselinux-devel-2.6-0.1.fc25.x86_64
libselinux-python-2.6-0.1.fc25.x86_64
libselinux-python3-2.6-0.1.fc25.x86_64
libselinux-utils-2.6-0.1.fc25.x86_64
libsemanage-2.6-0.2.fc25.x86_64
libsemanage-devel-2.6-0.2.fc25.x86_64
libsemanage-python-2.6-0.2.fc25.x86_64
libsemanage-python3-2.6-0.2.fc25.x86_64
libsepol-2.6-0.1.fc25.x86_64
libsepol-devel-2.6-0.1.fc25.x86_64
libsepol-static-2.6-0.1.fc25.x86_64
policycoreutils-2.6-0.2.fc25.x86_64
policycoreutils-devel-2.6-0.2.fc25.x86_64
policycoreutils-python-2.6-0.2.fc25.x86_64
policycoreutils-python3-2.6-0.2.fc25.x86_64
policycoreutils-python-utils-2.6-0.2.fc25.x86_64
policycoreutils-sandbox-2.6-0.2.fc25.x86_64
python-2.7.12-7.fc25.x86_64
python3-3.5.2-4.fc25.x86_64
selinux-policy-3.13.1-225.6.fc25.noarch
selinux-policy-devel-3.13.1-225.6.fc25.noarch
selinux-policy-sandbox-3.13.1-225.6.fc25.noarch
selinux-policy-targeted-3.13.1-225.6.fc25.noarch
setools-console-4.0.1-0.2.fc25.x86_64
setools-python3-4.0.1-0.2.fc25.x86_64
setools-python-4.0.1-0.2.fc25.x86_64

How reproducible:
* always

Steps to Reproduce:
# sepolicy communicate -s aide_t -t crond_t
Traceback (most recent call last):
  File "/usr/bin/sepolicy", line 700, in <module>
    args.func(args)
  File "/usr/bin/sepolicy", line 415, in communicate
    writable = get_types(args.source, args.tclass, args.sourceaccess.split(","))
  File "/usr/lib/python2.7/site-packages/sepolicy/communicate.py", line 49, in get_types
    tlist = tlist + expand_attribute(l)
  File "/usr/lib/python2.7/site-packages/sepolicy/communicate.py", line 37, in expand_attribute
    return sepolicy.info(sepolicy.ATTRIBUTE, attribute)[0]["types"]
TypeError: 'generator' object has no attribute '__getitem__'
# 

Expected results:
* no tracebacks

Comment 1 Petr Lautrbach 2017-01-23 15:34:04 UTC
Fixed in policycoreutils-2.6-0.3

https://github.com/bachradsusi/selinux/commit/7a859d5065a34146d6add34222ee44cdd030f749

Comment 2 Milos Malik 2017-01-24 16:31:04 UTC
I can confirm that:

# rpm -qa policycoreutils\*
policycoreutils-devel-2.6-0.5.fc25.x86_64
policycoreutils-gui-2.6-0.5.fc25.x86_64
policycoreutils-2.6-0.5.fc25.x86_64
policycoreutils-python3-2.6-0.5.fc25.x86_64
policycoreutils-python-2.6-0.5.fc25.x86_64
policycoreutils-python-utils-2.6-0.5.fc25.x86_64
# sepolicy communicate -s aide_t -t crond_t
initrc_tmp_t
aide_t
tmp_t
aide_log_t
mnt_t
aide_db_t
#


Note You need to log in before you can comment on or make changes to this bug.