Bug 1414069 - sepolicy network tracebacks: TypeError: get_types() takes exactly 3 arguments (4 given)
Summary: sepolicy network tracebacks: TypeError: get_types() takes exactly 3 arguments...
Keywords:
Status: CLOSED EOL
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:35 UTC by Milos Malik
Modified: 2017-12-12 10:53 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-12-12 10:53:37 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Milos Malik 2017-01-17 16:35:24 UTC
Description of problem:

Version-Release number of selected component (if applicable):
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

How reproducible:
* always

Steps to Reproduce:
# sepolicy network -d aide_t
Traceback (most recent call last):
  File "/usr/bin/sepolicy", line 700, in <module>
    args.func(args)
  File "/usr/bin/sepolicy", line 318, in network
    _print_net(d, "tcp", "name_connect")
  File "/usr/bin/sepolicy", line 260, in _print_net
    portdict = sepolicy.network.get_network_connect(src, protocol, perm)
  File "/usr/lib/python2.7/site-packages/sepolicy/network.py", line 41, in get_network_connect
    tlist = get_types(src, "%s_socket" % protocol, [perm], check_bools)
TypeError: get_types() takes exactly 3 arguments (4 given)
#

Expected results:
* no traceback

Comment 1 Milos Malik 2017-01-17 16:37:25 UTC
Forgotten NVRs:
checkpolicy-2.6-0.1.fc25.x86_64
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

Comment 2 Milos Malik 2017-01-17 16:44:55 UTC
Different arguments, same result:

# sepolicy network -a /usr/sbin/crond
Traceback (most recent call last):
  File "/usr/bin/sepolicy", line 700, in <module>
    args.func(args)
  File "/usr/bin/sepolicy", line 318, in network
    _print_net(d, "tcp", "name_connect")
  File "/usr/bin/sepolicy", line 260, in _print_net
    portdict = sepolicy.network.get_network_connect(src, protocol, perm)
  File "/usr/lib/python2.7/site-packages/sepolicy/network.py", line 41, in get_network_connect
    tlist = get_types(src, "%s_socket" % protocol, [perm], check_bools)
TypeError: get_types() takes exactly 3 arguments (4 given)
#

Comment 3 Petr Lautrbach 2017-01-24 15:43:04 UTC
Fixed in policycoreutils-2.6-0.5

Comment 4 Milos Malik 2017-01-24 16:28:24 UTC
# 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 network -a /usr/sbin/crond

crond_t: tcp name_connect
Traceback (most recent call last):
  File "/usr/bin/sepolicy", line 700, in <module>
    args.func(args)
  File "/usr/bin/sepolicy", line 318, in network
    _print_net(d, "tcp", "name_connect")
  File "/usr/bin/sepolicy", line 271, in _print_net
    boolean_text = get_conditionals_format_text(cond)
  File "/usr/lib/python3.5/site-packages/sepolicy/__init__.py", line 386, in get_conditionals_format_text
    enabled = len(filter(lambda x: x['boolean'][0][1], cond)) > 0
TypeError: object of type 'filter' has no len()
#

The tool runs for a while and then a different traceback appears.

Comment 5 Petr Lautrbach 2017-01-24 16:30:14 UTC
You are right. I wasn't patient enough. Sadly, all the problems are based on python 2 to python 3 migration.

Comment 6 Petr Lautrbach 2017-01-30 16:00:22 UTC
It should be fixed in policycoreutils-2.6-0.6 now.

Comment 7 Milos Malik 2017-01-30 16:17:29 UTC
Yes, it is:

# sepolicy network -a /usr/sbin/crond

crond_t: tcp name_connect
	111 (portmap_port_t)
	113 (auth_port_t)
	53, 853 (dns_port_t)
	88, 750, 4444 (kerberos_port_t)
	389, 636, 3268, 7389 (ldap_port_t)
	32768-61000 (ephemeral_port_t)
	8955 (dnssec_port_t)
	9080 (ocsp_port_t)
	all ports (port_type)
	all ports < 1024 (reserved_port_type) -- Allowed False [ nis_enabled=0 ]
	all ports with out defined types (port_t)

crond_t: tcp name_bind
	32768-61000 (ephemeral_port_t)
	all ports (port_type)
	all ports with out defined types (port_t)

crond_t: udp name_bind
	32768-61000 (ephemeral_port_t)
	all ports (port_type)
	all ports with out defined types (port_t)
# echo $?
0
#

Comment 8 Fedora End Of Life 2017-11-16 18:46:28 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '25'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 25 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 9 Fedora End Of Life 2017-12-12 10:53:37 UTC
Fedora 25 changed to end-of-life (EOL) status on 2017-12-12. Fedora 25 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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