Bug 1460818 - python3 type change from selinux.security_get_boolean_names
Summary: python3 type change from selinux.security_get_boolean_names
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: libselinux
Version: 26
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Lautrbach
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-06-12 20:58 UTC by Dusty Mabe
Modified: 2017-06-13 12:41 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-06-13 12:41:17 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Dusty Mabe 2017-06-12 20:58:14 UTC
Description of problem:

In Fedora 25 the return type of the items in the list returned by the python3 selinux.security_get_boolean_names() was 'bytes'. In Fedora 26 this is 'str'.

This causes the ansible seboolean module to blow up here: https://github.com/ansible/ansible/blob/025b52938eb449b48e6ac57254161ad4673ab79c/lib/ansible/modules/system/seboolean.py#L76-L85


Output from f25:
```
[root@vanilla-f25atomic ~]# rpm -q libselinux-python libselinux-python3
libselinux-python-2.5-13.fc25.x86_64
libselinux-python3-2.5-13.fc25.x86_64
[root@vanilla-f25atomic ~]# python3 -c "import selinux; print(type(selinux.security_get_boolean_names()[1][0]))"
<class 'bytes'>
[root@vanilla-f25atomic ~]# 
[root@vanilla-f25atomic ~]# python -c "import selinux; print(type(selinux.security_get_boolean_names()[1][0]))"
<type 'str'>
```

Output from f26:
```
[root@f1 ~]# rpm -q libselinux-python libselinux-python3 
libselinux-python-2.6-6.fc26.x86_64
libselinux-python3-2.6-6.fc26.x86_64
[root@f1 ~]# python3 -c "import selinux; print(type(selinux.security_get_boolean_names()[1][0]))"
<class 'str'>
[root@f1 ~]# python -c "import selinux; print(type(selinux.security_get_boolean_names()[1][0]))"
<type 'str'>
```

Comment 1 Dusty Mabe 2017-06-12 21:00:27 UTC
We are trying to find out if this change was intentional or not.

Comment 2 Petr Lautrbach 2017-06-13 08:54:25 UTC
This change was intentional. The previous version was causing issues
with string manipulation functions like split()

https://github.com/SELinuxProject/selinux/commit/b8711e2eaf4f83bf943ac8ad28c35cb1db9c001f

Comment 3 Dusty Mabe 2017-06-13 12:41:17 UTC
Thanks for the update - I opened a bug upstream against ansible: https://github.com/ansible/ansible/issues/25651


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